Project-level scoping for claude.ai cloud MCP servers (per-directory allowlist/denylist)
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
Cloud MCP servers connected via claude.ai (Gmail, Google Calendar, etc.) are either globally enabled or globally disabled. There's no way to scope them to specific project directories.
This matters when you work across multiple directories with different security boundaries. For example:
~/personal-projects— Gmail and Google Calendar should be available~/client-work— only client-specific tools should be available, no personal email access
Today the only option is ENABLE_CLAUDEAI_MCP_SERVERS=true/false, which is all-or-nothing for all cloud servers across all directories. Even with per-server granularity (#31249), there's no way to vary availability by project.
Proposed Solution
Allow project-level .mcp.json (or project settings) to include a deniedCloudMcpServers / allowedCloudMcpServers field that filters which claude.ai cloud servers are active when working in that directory.
Example .mcp.json in a project root:
{
"mcpServers": {},
"cloudMcpServers": {
"denied": ["Gmail", "Google Calendar"]
}
}
This would let each project directory opt out of specific cloud servers without affecting other projects or requiring env var tricks.
Alternatives Considered
- Env var per session (
ENABLE_CLAUDEAI_MCP_SERVERS=false) — kills all cloud servers - Shell aliases to set the env var per directory — fragile, easy to forget
- SessionStart hook to check
$PWDand toggle — works but is a workaround for what should be a config option - Per-server granularity (#31249) — helps choose which servers to load globally, but doesn't solve per-directory scoping
Related Issues
- #31249 — per-server granularity for
ENABLE_CLAUDEAI_MCP_SERVERS(prerequisite) - #20412 — cloud servers auto-injected without opt-in
- #11085 — persistent enable/disable for MCP servers
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗