Claude should proactively connect token env vars to empty Bearer slots in settings files

Resolved 💬 3 comments Opened May 5, 2026 by xu2xulim Closed May 8, 2026

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:

  1. MCP_TOKEN=<value> and N8N_TOOLS_TOKEN=<value> were present in the environment.
  2. ~/.claude/settings.json contained "Authorization": "Bearer " (empty) for both MCP servers.
  3. 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:

  1. Check Claude Code settings files (~/.claude/settings.json, project .claude/settings.json) as a first step — this is where MCP server configuration always lives.
  2. When env vars whose names contain TOKEN, KEY, or SECRET are observed, check whether any correspond to an empty credential slot in any config file already read — using the naming convention server-nameUPPER_SNAKE_CASE_TOKEN as a first pass, then fuzzy word-overlap matching.
  3. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗