[FEATURE] MCP Profiles for Rapid Context-Aware Tool Switching
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
MCP configuration is currently all-or-nothing: configure an MCP server and it becomes available everywhere (Claude Code, Cowork, all projects). This creates three operational pain points:
- Context waste from unintended MCPs: Developers configure MCPs for Cowork workflows (e.g., Slack for knowledge work) and those tools now consume 10-15% of Claude Code's context budget—even when Code doesn't need them. There's no way to disable them without removing them entirely.
- No scoped tool management:
disallowedToolsdoesn't work for MCP servers (#12863). Project-level exclusion doesn't work (#8321). Developers must manually edit.claude.jsonbetween sessions or maintain separate machine profiles—friction that breaks rapid task switching.
- Behavioral drift: Without tool scoping, Claude Code may autonomously search/use MCPs it wasn't intended to access. Example: mentioning a person's name while working on a GitHub issue triggers Slack searches—unexpected autonomous behavior that requires explicit negative instructions to prevent.
Proposed Solution
Implement bundled MCP profiles that can be loaded, switched, and hotloaded per context:
{
"mcp": {
"profiles": {
"coding": {
"description": "Claude Code defaults",
"mcpServers": {
"github": { "..." : "..." },
"context7": { "..." : "..." }
}
},
"knowledge-work": {
"description": "Cowork defaults",
"mcpServers": {
"slack": { "..." : "..." },
"notion": { "..." : "..." },
"github": { "..." : "..." }
}
},
"empty": {
"description": "No MCPs",
"mcpServers": {}
}
},
"defaults": {
"code": "coding",
"cowork": "knowledge-work",
"project": "coding"
}
}
}
Scoping options:
- Tool-level:
coworkprofiles only,codeprofiles only,shared - Session-level:
claude --mcp-profile coding - Project-level:
.mcp.jsonor.claude/settings.jsonspecifies profile override - Runtime hotloading:
/mcp-profile switch knowledge-work - Default fallback:
nullor empty profile loads nothing
Profiles loadable from:
- User level:
~/.claude/mcp-profiles.json - Project level:
.claude/mcp-profiles.json - Profile inheritance: Project overrides user; explicit flags override both
Alternative Solutions
Current workarounds, all unsatisfactory:
- Manually editing
.claude.jsonbetween sessions to add/remove MCP servers - Maintaining separate machine profiles for different workflows
- Setting
ENABLE_CLAUDEAI_MCP_SERVERS=falseand losing all MCP access in Claude Code - Adding explicit negative instructions ("never use Slack MCP") to prevent autonomous behavior
- Using
permissions.denyto block specific MCP tools (coarse, no bundling)
Priority
High - Significant impact on productivity
Feature Category
MCP server integration
Use Case Example
Platform engineer working on infrastructure:
- Morning:
claude --mcp-profile coding— loads GitHub, context7, Netbox for Terraform/Kubernetes work - Incident review:
/mcp-profile switch knowledge-work— loads Slack, Notion, Linear for knowledge synthesis - Pair debugging with sensitive credentials:
/mcp-profile switch empty— zero MCPs loaded
Today: Loses 10% context to Slack MCPs in Code sessions. Must manually edit config to exclude them. Claude autonomously searches Slack when names are mentioned in code context.
With profiles: MCPs load/unload atomically per context. Behavior is explicit and predictable.
Additional Context
Refiled from #24000 (auto-closed for inactivity, locked without team engagement) and freeform #39487.
This feature request subsumes:
- #7328: MCP tool filtering (granular)
- #7289: Disabling MCP in specific contexts
- #8321: Project-level MCP exclusion
Supporting data point from #24000: /doctor flags cloud MCP integrations consuming ~31K tokens of context overhead, with Notion alone at ~22K across 13 tools.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗