toggle
Toggle an MCP server on or off (enable/disable). Use this to enable a disabled MCP server, disable an enabled MCP server, turn off an MCP server, turn on an MCP server, or manage MCP server availability.
Toggle MCP Server
Enable or disable a specific MCP server by name.
Config File Locations (Claude Code only)
- Global servers are stored in
~/.claude.jsonundermcpServers(enabled) and_mcpServers_disabled(disabled). This is NOT~/.cursor/mcp.json— that file is for Cursor, not Claude Code. - Project servers are defined in
.mcp.jsonat the project root. This file format is shared by Claude Code and Cursor, but MCP Manager only modifies it for Claude Code. - Project toggle state is stored in
.claude/settings.local.jsonunderdisabledMcpjsonServers.
Instructions
-
Check if the MCP Manager server is running:
curl -s --max-time 2 http://localhost:4111/api/health -
If the server is NOT running, start it:
cd "$CLAUDE_PLUGIN_ROOT" && nohup node server/index.js > ~/.mcp-manager.log 2>&1 & sleep 2 -
If the user did not specify which server to toggle, first list available servers:
curl -s http://localhost:4111/api/configThen ask the user which server they want to toggle.
-
Toggle the specified server:
curl -s -X POST http://localhost:4111/api/servers/toggle \ -H "Content-Type: application/json" \ -d '{"name": "<SERVER_NAME>", "scope": "<SCOPE>"}'name: the MCP server name (e.g., "github", "slack")scope: use"global"for global servers, or the full absolute workspace path (e.g.,"/Users/me/my-project") for project servers. Do NOT use the string"project". Check the server'sscopefield from the/api/configresponse.
-
Report the result to the user, confirming whether the server is now enabled or disabled. Mention which file was modified:
- Global toggle:
~/.claude.json - Project toggle:
.claude/settings.local.jsonin the project root
- Global toggle:
-
Remind the user they may need to restart their Claude Code session for changes to take effect.