[Bug] Disabled MCP servers still load tool definitions into Claude's context
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
- Enable an MCP server with tools in the allowed permissions list
- Add the MCP server name to
disabledMcpServersin your config file - Restart Claude Code or start a new session
- Verify console shows the MCP as disabled
- Ask Claude: "Can you see any MCP tools in your context?"
- Claude will list the disabled MCP's tools
- Ask Claude to invoke one of those tools
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗