[FEATURE] Support named MCP profiles (task-specific per-project MCP profiles)
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
When working on full-stack projects, different parts of the codebase benefit from different MCP servers. For example:
- Frontend work: chrome-devtools-mcp, playwright-mcp, figma-mcp
- Backend work: postgres-mcp, redis-mcp, docker-mcp
- Documentation/planning: notion-mcp, linear-mcp
Currently, all configured MCPs load on every session, which causes two issues:
- Context consumption: Each MCP's tool definitions consume tokens from the context window. In projects with 5-10 MCPs configured, this overhead becomes significant, reducing the space available for actual code context.
- Tool noise: Claude sees all available tools regardless of relevance. When working on a CSS animation, having 15 database and infrastructure tools in scope adds cognitive overhead for both Claude (tool selection) and the user (permission prompts for irrelevant tools).
The current configuration model assumes MCPs are either project-wide or user-wide, but real workflows are often task-specific within a project.
Proposed Solution
Introduce named profiles that group MCP configurations, loadable at startup or switchable mid-session.
Configuration (in .mcp.json or .claude/settings.local.json):
{
"mcpProfiles": {
"frontend": ["chrome-devtools-mcp", "playwright-mcp", "figma-mcp"],
"backend": ["postgres-mcp", "redis-mcp"],
"full": ["chrome-devtools-mcp", "playwright-mcp", "postgres-mcp", "redis-mcp"]
},
"defaultProfile": "full",
"mcpServers": {
"chrome-devtools-mcp": { ... },
"playwright-mcp": { ... },
"postgres-mcp": { ... },
"redis-mcp": { ... }
}
}
Usage:
# Launch with a specific profile
claude --mcp-profile frontend
# Or switch mid-session
/mcp-profile backend
The /mcp command could show the active profile and allow switching.
Alternatively we could also conceive multiple full-profiles per-project, but we'd need a mechanism to
"inherit" common settings and commands. This would probably more complex to implement and use.
Alternative Solutions
Current workarounds I've found:
CLAUDE_CONFIG_DIRenvironment variable: create separate config directories and launch with different env vars. Works but clunky, requires separate shell aliases, doesn't allow mid-session switching, and has known issues with local.claude/directories still being created (#3833).
- Community tools: third-party profile managers exist (e.g.,
claude-code-profile-manager) but add external dependencies and don't integrate with the native MCP lifecycle.
- Manual
.mcp.jsonediting: comment/uncomment servers before launching. Error-prone and tedious.
- Multiple
.mcp.jsonfiles with symlinks: similar to workaround 1, requires external scripting.
None of these allow mid-session profile switching, which would be the ideal workflow.
There other also other open issues somewhat related:
- #7075
- #7336
- #6915
The first one is the most similar, advocated for multiple separate profiles with isolated everything (commands, hooks, settings, ...), but in the scenario of this specific problem (MCPs consuming context when not used) it would cause other problems (in a specific project one typically would want to have access to the same commands and hooks)
Priority
High - Significant impact on productivity
Feature Category
MCP server integration
Use Case Example
Scenario: I'm working on a SaaS application with a SolidJS frontend and a Go backend.
- Morning: I start with frontend work, fixing a UI bug. I launch
claude --mcp-profile frontend. Onlychrome-devtools-mcpand/orplaywright-mcpload. Claude has maximum context for my component files.
- Midday: the bug turns out to be a backend issue. Instead of restarting, I run
/mcp-profile backend. Claude disconnects the frontend MCPs and connectspostgres-mcp. I debug the API without restarting or losing conversation context.
- Afternoon: full integration testing.
/mcp-profile fullloads everything for end-to-end work.
Current reality: all 6 MCPs load every time. When doing a focused task I have much less context available (or I am forced to do tricks with config files)
Additional Context
Similar patterns in other tools:
- VS Code profiles: switch between entirely different extension sets for different project types
- Docker Compose profiles:
docker compose --profile frontend upselectively starts services - AWS CLI profiles:
--profileflag for different credential/region configurations
Technical notes:
- MCP servers already support connect/disconnect lifecycle, the infrastructure for mid-session switching likely exists
- Profile definitions could live in
.mcp.json(project-scoped) or~/.claude/settings.json(user-scoped), following existing precedence rules - A
"*"profile or"defaultProfile": nullcould mean "load all MCPs" for backwards compatibility
Related issues:
- #3833 (CLAUDE_CONFIG_DIR behavior)
- #2986 (CLAUDE_CONFIG_DIR and local installations)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗