Claude should proactively connect token env vars to empty Bearer slots in settings files
Summary
When Claude Code is activated remotely and asked to investigate available MCP tools, Claude does not proactively check ~/.claude/settings.json for MCP server configuration, nor does it connect token env vars it has already observed to empty Bearer token slots in that file — even though both facts are visible and the connection is straightforward. This behaviour has been reproduced across multiple independent sessions.
What happened
In a remote session:
MCP_TOKEN=<value>andN8N_TOOLS_TOKEN=<value>were present in the environment.~/.claude/settings.jsoncontained"Authorization": "Bearer "(empty) for both MCP servers.- The MCP servers' tools were absent from the session.
Claude did not check the settings file until explicitly prompted, and did not connect the env vars to the empty token slots until a second prompt. The user had to guide the investigation step by step. This occurred again in a follow-up session after the issue was first observed, confirming it is consistent and reproducible — not a one-off.
Expected behaviour
When investigating why an MCP server's tools are unavailable, Claude should:
- Check Claude Code settings files (
~/.claude/settings.json, project.claude/settings.json) as a first step — this is where MCP server configuration always lives. - When env vars whose names contain
TOKEN,KEY, orSECRETare observed, check whether any correspond to an empty credential slot in any config file already read — using the naming conventionserver-name→UPPER_SNAKE_CASE_TOKENas a first pass, then fuzzy word-overlap matching. - Report the mismatch and proposed fix proactively, before asking the user what to do next.
Why this matters
This is a general reasoning gap: Claude should connect related evidence it has already gathered rather than waiting to be prompted. The settings file and the env vars are both in Claude's context. The fact that it recurred in a second independent session confirms this is a systematic behaviour gap, not an isolated miss.
Environment
- Claude Code version: 2.1.42
- Platform: Linux 6.18.5
- Entrypoint: remote_trigger (Claude Code on the web)
Labels
claude mcp model-behaviour
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗