[Feature Request] Enable quick-toggle for MCP servers
As a user of Claude Code who is often experimenting with my usage of the tool, I would like a way to quickly 'toggle' MCP servers on and off, so that I don't have to go through the claude mcp add and claude mcp remove everytime I want to make an adjustment to what's available to my user settings.
perhaps with a per-tool toggles as well? I often only need a tool or two from an server, filtering out the rest would be nice
It would be good to be able to assign mcp servers to subagents only and not need to pollute the main mode with all these tools that may only be required for special agents.
I can see enabledMcpjsonServers and disabledMcpjsonServers config in ~/.claude.json. Perhaps use that for now?
I can see
enabledMcpjsonServersanddisabledMcpjsonServersconfig in~/.claude.json. Perhaps use that for now?
I think that is only per project setting. I don't see it in the global section.
any update on this?
I just discovered that certain MCP servers consume large amounts of context in sessions where I don't plan to use them, it would be great if those could be left in a disabled state and then enabled "on-demand" when I actually need them.
Also discovered MCP tools eat 30% of my context window. I use e.g. MCPs for bitbucket, Jira etc which I can have 90% of time disabled and enable onlyl when I specifically need.
Would be awesome to not take the hassle of editing .json file or doing other workaround stuff but had option e.g. inside /mcp command to enable/disable the MCP.
I made myself a small CLI tool with Claude here for this feature https://www.npmjs.com/package/claude-ext
For the record, I've been using https://github.com/ravitemer/mcphub.nvim which has been a really pleasant way to toggle on and off MCPs and individual tools. Neovim specific, obviously, ideally this feature is native to Claude Code.
I made myself a small CLI tool with Claude here for this feature https://www.npmjs.com/package/claude-ext
Good on you for using ✗ and ✓. I'm so tired of LLMs churning out emojis!
It would be very useful to have MCP toggles that are independent from the general-purpose agent and other subagents. For example, I'd like to use the Supabase and Sentry MCPs with specific agents, without having them take up context or resources for my general agent. This way, the context window of my main agent remains clean, while I can selectively enable MCPs only where they're needed.
Agree with @zoeytabmedia!
Current situation makes using a bunch of mcp servers not worth it. Eg. the Azure devops mcp server is huge context wise.
You're absolutely right! lol
Although there's no command to do so, I just tested using disabledMcpjsonServers in my settings.local.json, and it worked perfectly. It works without regard to enableAllProjectMcpServers
This is a very important feature for me. I have a number of MCPs which accelerate my work, but I have to avoid using them because combined they consume too much context. I agree with @zoeytabmedia - per-agent MCPs make a lot of sense in this case.
I made myself a small CLI tool with Claude here for this feature https://www.npmjs.com/package/claude-ext
Well done! Thanks for this! Will use until Claude gets their crap together and adds this simple feature built in... 🤦
Community Solution: claude-ext with Project Server Support
I've implemented a solution for this MCP server management need via a community tool enhancement.
What I Built
Enhanced claude-ext (https://github.com/jacobycwang/claude-ext) to support both global and project-specific MCP servers:
Pull Request: https://github.com/jacobycwang/claude-ext/pull/2
Features Added
✅ Unified MCP Server View: See all servers (global + project) in one interface
✅ Project Server Detection: Automatically finds .mcp.json files in current directory
✅ Full Toggle Control: Enable/disable both global and project servers
✅ Smart Management:
- Global servers: Toggle between active/disabled states
- Project servers: Toggle between inactive/active-globally (copies to global config)
- Project
.mcp.jsonfiles are never modified (read-only source)
Usage
# Install enhanced version
npm install -g https://github.com/gvago/claude-ext.git
# Use in any project directory
claude-ext mcp
Example Output:
MCP Server Manager
Select which MCP servers should be active in Claude:
❯◉ ✓ archon (active)
◉ ✓ playwright (active)
◉ ✓ shadcn-ui (active)
◯ 📁 supabase (project) ← Now toggleable!
Benefits
- Complete MCP Visibility: See all servers across global and project configs
- Proper Boundaries: Project servers stay in
.mcp.json, global config manages activation - User Control: Toggle any MCP server on/off regardless of source
- Non-Destructive: Never modifies project-specific configurations
This addresses the core need for MCP server management while respecting Claude Code's architecture. Users get full control over which servers are active without breaking project-specific setups.
Technical Implementation
- Detection: Reads
.mcp.jsonfrom current working directory - Management: Copies project servers to global config when activated
- UI: Visual distinction with folder icons for project servers
- Safety: Project configurations remain untouched
Would love feedback from the Claude Code team on this approach! It bridges the gap between Claude Code's MCP architecture and user management needs.
I have a slightly different approach than https://github.com/anthropics/claude-code/issues/1774#issuecomment-3273455792. Rather than global toggle, I use a per-session MCP server selection approach:
https://github.com/gsong/ccmcp
Hope this is added soon! I feel MCPs aren't worth using otherwise since I only need them occasionally, so don't want them bloating my context window
I just discovered the /doctor command and saw:
Context Usage Warnings
└ ⚠ Large MCP tools context (~101,475 tokens > 25,000)
└ MCP servers:
└ github: 104 tools (~71,781 tokens)
└ serena: 18 tools (~14,319 tokens)
└ playwright: 21 tools (~13,666 tokens)
└ context7: 2 tools (~1,709 tokens)
I only installed the github MCP to give myself an easy way to post claude plans to github issues, but it's using 71K tokens!? In addition to giving a way to toggle MCPs on/off (and their individual tools), it would be great if there was a warning for MCPs that by themselves trigger the context usage warning (> 25,000).
You're absolutely right! lol
Although there's no command to do so, I just tested using
disabledMcpjsonServersin mysettings.local.json, and it worked perfectly. It works without regard toenableAllProjectMcpServers
I tried using disabledMcpjsonServers and disabledMcpServers at the root setting level, and it didn't work.
On the other hand, when I use disabledMcpServers inside of a projects: { "some_folder" : { "disabledMcpServers": [...] .... it does work.
Is it supposed to work at a root level? Because that would be much nice
It'd also be nice to be able to allow tools for subagents, but restrict for the main agent. Large context tools (like github) could then allowed only for a specific subagent, so it doesn't consume so much of the main agent's context.
I just discovered the
/doctorcommand and saw:Context Usage Warnings └ ⚠ Large MCP tools context (~101,475 tokens > 25,000) └ MCP servers: └ github: 104 tools (~71,781 tokens) └ serena: 18 tools (~14,319 tokens) └ playwright: 21 tools (~13,666 tokens) └ context7: 2 tools (~1,709 tokens)I only installed the github MCP to give myself an easy way to post claude plans to github issues, but it's using 71K tokens!? In addition to giving a way to toggle MCPs on/off (and their individual tools), it would be great if there was a warning for MCPs that by themselves trigger the context usage warning (> 25,000).
This issue should be closed, as it has been resolved with the release of Claude Code 2.0.10:
2.0.10
- Rewrote terminal renderer for buttery smooth UI
- Enable/disable MCP servers by @mentioning, or in /mcp
- Added tab completion for shell commands in bash mode
- PreToolUse hooks can now modify tool inputs
- Press Ctrl-G to edit your prompt in your system's configured text editor
- Fixes for bash permission checks with environment variables in the command
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.