[Bug] Disabled MCP servers still load tool definitions into Claude's context

Resolved 💬 3 comments Opened Nov 10, 2025 by thoeltig Closed Nov 10, 2025

What's Wrong?

Disabled MCP servers still have their tool definitions loaded into Claude's context. When an MCP is added to disabledMcpServers in the config, the console shows it as disabled, but Claude still sees all the tool definitions and they consume context tokens (estimated ~400-650 tokens per MCP depending on complexity).

When Claude tries to actually invoke these tools, it fails with "No such tool available" error. So the tools are loaded but not functional.

What Should Happen?

Disabled MCPs shouldn't load their tool definitions into Claude's context at all. The disabled check should happen before adding tools to the system prompt, not just at execution time.

Error Messages/Logs

<error><tool_use_error>Error: No such tool available: mcp__[disabled-server]__[tool-name]</tool_use_error></error>

Steps to Reproduce

  1. Enable an MCP server with tools in the allowed permissions list
  2. Add the MCP server name to disabledMcpServers in your config file
  3. Restart Claude Code or start a new session
  4. Verify console shows the MCP as disabled
  5. Ask Claude: "Can you see any MCP tools in your context?"
  6. Claude will list the disabled MCP's tools
  7. Ask Claude to invoke one of those tools
  8. It will fail with "No such tool available"

Claude Model

Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)

Is this a regression?

Unknown

Last working version

_No response_

Claude Code version

2.0.36

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

_No response_

Additional Information

  • Feedback ID: a0bdae75-a0ac-4465-b67d-00cfe88a2ea0
  • Possibly related to #11364

View original on GitHub ↗

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