Connecting Claude Code¶
Claude Code connects to the MCP server over HTTPS at the Resource URL set on the Model Context Protocol (MCP) page, and signs in through the QIE console. This page covers adding the server, signing in and out, and settings that keep a session safe.
Adding the server¶
Add the server with its Resource URL:
Claude Code adds the server for the project you run the command in. To use it in every project, add --scope user to the command.
The name you give the server, qie here, is the prefix Claude Code shows before QIE's prompts and resources, and the name its permission rules use. When one person connects to more than one engine, use the environment label in the name, such as qie-prod and qie-test, the same form get_instance_info reports.
Signing in¶
QIE answers Claude Code's first request by asking it to sign in, and Claude Code marks the server as needing authentication. Run /mcp in Claude Code, select the server and authenticate, or run claude mcp login qie in your shell. Claude Code then:
- Reads where to sign in from QIE's protected resource document.
- Identifies itself to QIE. While Metadata Document Hosts on the Model Context Protocol (MCP) page lists any host, QIE tells clients it accepts client details documents, and Claude Code uses its own, which is on
claude.ai; addclaude.aito the list then, or the sign-in is refused. While the list is empty, Claude Code registers with QIE. See MCP Client Sign-In. - Opens the QIE console's approval page in your browser. Sign in to the console if you are not signed in, choose the access to grant and click Approve.
After you approve, the browser returns to Claude Code through an address on your own computer (localhost), and Claude Code collects its tokens from QIE. QIE accepts only such addresses as return addresses for MCP clients.
Access to grant¶
The approval page offers read-only access by default. Grant the narrowest access the work needs: read only for looking at channels, messages and logs, manage for starting and stopping channels and working error queues, and full access only for changing configuration.
A tool that needs wider access than you granted is refused. Claude Code reports that the server needs additional permissions and marks it as needing authentication in /mcp; it does not sign in again by itself. Run /mcp, authenticate the server again, and choose the wider access on the approval page.
Confirmations¶
Actions that cannot be undone, such as deleting, purging or importing, ask you to confirm in Claude Code. QIE also marks these tools as needing approval on every call, so Claude Code shows its own permission prompt each time, even in its acceptEdits, auto and bypassPermissions modes. It does not offer to stop asking for them, and an allow rule that matches one does not skip the prompt. In its dontAsk mode, which never prompts, Claude Code refuses these calls instead.
Recommended permissions¶
Let Claude Code run QIE's read tools without asking, and have it ask before every tool that changes QIE. QIE cannot protect a session whose client approves changes without asking.
Add allow rules for the read tools to your user settings, ~/.claude/settings.json, so they apply in every project. A rule is mcp__, the server's name as you added it, two underscores and the tool's name; a rule may end in * to cover every tool whose name starts the same way. For a server named qie:
{
"permissions": {
"allow": [
"mcp__qie__get_*",
"mcp__qie__list_*",
"mcp__qie__read_*",
"mcp__qie__search_*",
"mcp__qie__describe_*",
"mcp__qie__validate_*",
"mcp__qie__check_script_syntax",
"mcp__qie__export_configuration",
"mcp__qie__find_usages",
"mcp__qie__identify_session",
"mcp__qie__test_connection"
]
}
}
Every tool these rules cover only reads. For a server added under another name, such as qie-prod, repeat the rules with that name: the server part of a rule cannot use *. Leave every other QIE tool without a rule.
In its Manual mode, whose setting value is default, Claude Code asks before it runs a tool that no rule allows. Current versions of Claude Code start terminal and VS Code sessions in auto mode by default. In auto mode, a classifier reviews such a tool instead of asking you, and bypassPermissions mode runs it without asking. Work with QIE in Manual mode: start Claude Code with claude --permission-mode manual, or add "defaultMode": "default" to the permissions block above so every terminal session starts in it.
Do not add an ask rule for the whole server, such as mcp__qie. Claude Code checks deny rules first, then ask rules, then allow rules, so an ask rule for the server makes the read tools ask too. A deny rule in any settings file outranks an allow rule in another.
Signing out¶
Claude Code keeps a server's tokens in its credential store (the keychain, on macOS) and refreshes them automatically. Treat them like a password: whoever holds them can use QIE as you, with the access you granted.
To sign out, run claude mcp logout qie. Claude Code revokes the tokens at QIE, which supports revocation, and deletes the copy it keeps. Choosing Clear authentication for the server in /mcp also revokes access. Removing the server with claude mcp remove qie deletes the tokens and registration Claude Code keeps for it but does not revoke the tokens at QIE, so sign out first. To be sure a sign-in has ended, revoke it under MCP Sign-Ins in Edit My Profile (see Your own sign-ins), or ask an administrator to revoke it on the Model Context Protocol (MCP) page.
Long results¶
QIE limits each result to the Read Cap (bytes) on the Model Context Protocol (MCP) page, 40,000 bytes by default, and returns the rest in parts (see MCP Tool Results and Errors). Claude Code warns when a result passes 10,000 tokens. It saves a result to a file, and shows the file's path in the conversation instead, when the result is longer than 50,000 characters, or longer than 25,000 tokens by default; the MAX_MCP_OUTPUT_TOKENS environment variable changes the token limit but not the character limit. A read cap of 40,000 bytes keeps every result under the character limit.