[BUG] Bug: Project-level MCP server exclusion not preventing tools from consuming context
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When configuring .claude_project_config.json to exclude MCP servers by setting "mcpServers": {}, the MCP tools are still loaded into the context window, consuming significant token space.
What Should Happen?
MCP tools from globally configured servers (Firebase, Stripe, DigitalOcean) should not be loaded into context when explicitly excluded via project configuration.
Error Messages/Logs
Steps to Reproduce
- Create .claude_project_config.json in project root
- Set configuration to exclude all MCP servers:
{
"mcpServers": {}
}
- Start a new Claude Code session in the project
- Run /context command to check context usage
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.112 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
loaded into context when explicitly excluded via project configuration.
Actual Behavior
MCP tools are still consuming context despite the exclusion configuration:
- MCP tools: 154.4k tokens (77.2% of available context)
- This leaves only ~24k tokens for actual work
Impact
- Severely limits available context for code and conversations
- Makes it difficult to work on larger projects
- Project configuration doesn't work as documented/expected
Additional Context
The following MCP servers are being loaded despite exclusion:
- Firebase (multiple tools, ~500-1000 tokens each)
- Stripe (multiple tools, ~400-800 tokens each)
- DigitalOcean (multiple tools, ~400-1000 tokens each)
Workaround
Currently must disable MCP servers globally in Claude Code settings, which affects all projects.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗