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.
Draft: sources and what is still unconfirmed
Checked on 2026-10-12 against Claude Code 2.1.296 connected to QIE, and against Claude Code's documentation: MCP, Permissions, Permission modes and the settings reference. Check the quoted behavior against the live pages before publishing. Three points are marked unconfirmed below: where Claude Code keeps a server's tokens on disk, which /mcp action revoked the earlier sign-ins seen in testing, and whether a QIE tool with no permission rule asks before it runs in Claude Code's default mode.
Adding the server¶
Add the server with its Resource URL:
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¶
The first request gets an answer asking Claude Code to sign in. 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, so it asks before it runs (unconfirmed for Claude Code's default mode).
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's documentation says it stores a server's tokens securely and refreshes them automatically, but not where (unconfirmed). Treat them like a password: whoever holds them can use QIE as you, with the access you granted.
To sign out, choose Clear authentication for the server in /mcp, or run claude mcp logout qie. Removing the server with claude mcp remove qie also deletes the tokens and registration Claude Code keeps for it. In testing, Claude Code revoked its previous sign-in at QIE before signing in again (which /mcp action does this is unconfirmed). 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 setting changes the token limit but not the character limit. A read cap of 40,000 bytes keeps every result under the character limit.