[BUG] Bug: Project-level MCP server exclusion not preventing tools from consuming context

Resolved 💬 3 comments Opened Sep 28, 2025 by sevakavakians Closed Oct 2, 2025

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

  1. Create .claude_project_config.json in project root
  2. Set configuration to exclude all MCP servers:

{
"mcpServers": {}
}

  1. Start a new Claude Code session in the project
  2. 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.

View original on GitHub ↗

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