Quick answer: Claude Code can use credentials available through its permitted tools and runtime. Configure MCP for the particular terminal or desktop surface, protect its authentication material, and distinguish permission to retrieve a key from permission to use that key at its provider.
First identify the runtime and its permissions
Claude Code's effective access depends on file and shell permissions, approval settings, sandboxing and the environment of the process doing the work. The model does not automatically see every environment variable, but a permitted tool may read or disclose one.
Do not assume every .env file is automatically loaded or that Claude Code always checks environment credentials before tools. A file can be read, a framework may load it, and child processes may inherit variables; these are different access paths.
A restricted provider key can limit what any consumer does. A broad shared key creates a wider risk, whether delivered through an environment variable or retrieved during a task.
Choose terminal or desktop setup
The maintained Claude Code guide separates two paths:
- Terminal/CLI: remote HTTP MCP configuration and a manual agent token.
- Desktop Code tab: a Gazebo connector using OAuth, with explicit approval of selected service keys.
Normal Claude Chat, the desktop Code tab and terminal Claude Code are different execution surfaces. Do not copy one configuration into another and assume it has the same authentication or privacy properties.
Terminal: use the correct HTTP configuration
Create an agent and its token at Gazebo Agents. Configure only the retrieval access needed for the intended environment. Use a narrow provider credential underneath that policy.
For project-scoped configuration, Claude Code documents .mcp.json at the project root—not .claude/mcp.json:
{
"mcpServers": {
"gazebo": {
"type": "http",
"url": "https://app.gazebohq.com/api/mcp",
"headers": {
"Authorization": "Bearer ${GAZEBO_AGENT_TOKEN}"
}
}
}
}
Set GAZEBO_AGENT_TOKEN in the environment inherited by Claude Code. Its interpolation syntax here is ${NAME}, unlike Cursor's ${env:NAME}. Do not put a live token or a secret fallback value in committed JSON.
Claude Code also supports local and user installation scopes; follow its current MCP documentation for their storage and precedence. A shared project file distributes configuration, not permission to share authentication material.
Use /mcp or the documented CLI status commands to inspect the connection. Connection health is not proof that retrieval, denial and revocation all work. Gazebo's recorded terminal check covered connection health; see the compatibility guide for the exact test coverage.
Desktop: approve named keys through OAuth
In Claude's Code tab, use the connector flow described in the desktop setup guide. Connect the hosted endpoint, authenticate to Gazebo and approve only the keys needed. Do not supply a manual agent token for that OAuth path.
The desktop Code-session OAuth flow has been tested with fictional data, including identity, named retrieval, retrieval history and rejection after revocation. Detailed evidence is in the compatibility guide.
Selecting a local coding session does not make a remote connector local-only. The connector infrastructure and host can receive returned credentials.
Verify with a fictional credential
Start with get_identity and inspect the configured retrieval access. Then substitute your fictional service and approved key name:
get_credential({ service: "your-test-service", key_name: "api_key", method: "GET" })
OAuth requests must include the approved key name. The returned value is the actual stored credential, not a new narrowed token.
Ask the client not to display it, inspect the corresponding event with list_audit_events, and test a retrieval that should be denied using fictional data. Revoke the test connection and confirm a new retrieval fails without signing in again.
These checks concern Gazebo access. They do not establish which downstream provider operations ran.
Separate retrieval policy from execution control
A policy allowing a GET declaration does not make a write-capable Stripe key read-only. Once returned, the key's provider permissions govern its use. Restrict those permissions and apply approvals or sandbox controls at the actual executing tool where appropriate.
Removing unnecessary inherited credentials can reduce alternative access paths. Do not delete application secrets blindly: identify legitimate consumers, separate environments and remove only access the coding runtime should not have. An instruction to use MCP is not enforcement against other available tools.
Understand revocation and attribution
Revoking a Gazebo identity stops future retrieval with that identity. If a key was already received or may have been exposed, restrict, revoke or replace it at the provider as appropriate. That can affect other consumers of a shared key.
Use distinct identities for genuinely different consumers and environments. Reusing one token across developers or sessions weakens attribution and couples their retrieval revocation. A profile label alone does not prove a human identity or session.
Gazebo records credential-retrieval attempts, not every API call, prompt or file operation. Investigate unexpected activity using runtime and provider evidence alongside retrieval history.
For the broader boundaries, see MCP security and environment variables and agents.
Last reviewed: 8 November 2026. Independent editorial; not affiliated with or endorsed by Anthropic. Setup details should be checked against Claude Code's current documentation.