Feature request: Global disabledMcpServers support (user-level, not just per-project)
Summary
The /mcp command allows disabling MCP servers, but the disabled state is stored per-project (under projects[path].disabledMcpServers in ~/.claude.json). There is no way to globally disable an MCP server across all projects.
Problem
Users who have many MCP servers configured (e.g., google-workspace, chrome-devtools, gcloud, proxyman, etc.) but only use a subset regularly must disable the unused ones in every new project individually via /mcp. This is tedious and easy to forget, leading to unnecessary context window usage from tool definitions that are never invoked.
The /doctor command even warns about this:
Context Usage Warnings
Large MCP tools context (~143,546 tokens > 25,000)
Proposed solution
Support a top-level disabledMcpServers array in ~/.claude.json (alongside the existing mcpServers). The isMcpServerDisabled() function in src/services/mcp/config.ts would check both the global list and the per-project list:
export function isMcpServerDisabled(name: string): boolean {
const projectConfig = getCurrentProjectConfig()
if (isDefaultDisabledBuiltin(name)) {
const enabledServers = projectConfig.enabledMcpServers || []
return !enabledServers.includes(name)
}
// Check global disabled list
const globalConfig = getGlobalConfig()
const globalDisabled = globalConfig.disabledMcpServers || []
if (globalDisabled.includes(name)) return true
// Check per-project disabled list
const disabledServers = projectConfig.disabledMcpServers || []
return disabledServers.includes(name)
}
Per-project settings would override global (a project could re-enable a globally disabled server via its enabledMcpServers list).
Alternatives considered
- Removing servers entirely (
claude mcp remove): Loses the configuration. Re-adding later requires remembering the exact command/args/env. - Managed settings denylist (
/Library/Application Support/ClaudeCode/managed-settings.json): Designed for enterprise IT policy, overkill for personal preference. Requires sudo. - Per-project disabling: The current approach. Works but doesn't scale across many projects.
Additional context
The /mcp UI could add a "scope" option (similar to how claude mcp add has --scope user|project|local) to let users choose whether to disable globally or per-project.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗