From claude-skills
Toggle MCP servers on/off in .mcp.json and manage git skip-worktree. Use when asked to enable/disable MCP servers, toggle MCP config, or manage .mcp.json ignore state.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills:mcp-toggleThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Toggle MCP servers on/off in the repo's `.mcp.json` and manage `git skip-worktree` so local changes stay ignored.
Toggle MCP servers on/off in the repo's .mcp.json and manage git skip-worktree so local changes stay ignored.
.mcp.jsonFind .mcp.json at the git repo root:
view(<repo-root>/.mcp.json)
Parse the JSON structure. Servers live in two sections:
mcpServers — enabled servers (active)_disabled — disabled servers (inactive, preserved for re-enabling)git ls-files -v .mcp.json
S prefix = skip-worktree is SET (local changes ignored) ✅H prefix = skip-worktree is NOT set (changes will show in git status) ⚠️Use ask_user to present the current state and let the user choose what to toggle.
Build the form dynamically from the JSON:
mcpServers as ✅ Enabled_disabled as ❌ DisabledExample ask_user call:
ask_user({
message: "Select which MCP servers should be ENABLED. Unselected servers will be disabled.\n\nCurrent skip-worktree: [SET/NOT SET]",
requestedSchema: {
properties: {
enabledServers: {
type: "array",
title: "Enabled MCP Servers",
description: "Check the servers you want enabled. Uncheck to disable.",
items: {
type: "string",
enum: ["server1", "server2", "server3"] // all servers from both sections
},
default: ["server1", "server2"] // currently enabled ones
},
skipWorktree: {
type: "boolean",
title: "Ignore .mcp.json in git (skip-worktree)",
description: "When enabled, local changes to .mcp.json won't appear in git status or get committed.",
default: true
}
},
required: ["enabledServers"]
}
})
Based on user selections, rebuild the .mcp.json:
mcpServers and _disabled sectionsmcpServers, unselected go to _disablededit tool — replace the entire file content_disabled would be empty, omit it entirelyTarget JSON structure:
{
"mcpServers": {
"serverA": { ... },
"serverB": { ... }
},
"_disabled": {
"serverC": { ... }
}
}
Based on the user's skipWorktree selection:
# To ignore local changes (default after toggling):
git update-index --skip-worktree .mcp.json
# To stop ignoring (if user explicitly unchecks):
git update-index --no-skip-worktree .mcp.json
Summarize what changed:
MCP Toggle complete:
✅ Enabled: serverA, serverB
❌ Disabled: serverC
🔒 skip-worktree: SET
Note: Restart your Copilot CLI session or run /clear to pick up MCP server changes.
.mcp.json found: Tell the user and offer to create one_disabled section: All servers are currently enabled — that's finemcpServers section: All servers are disabled — warn the user.mcp.json file must be valid JSON — use edit carefully to replace the full content/clear for MCP changes to take effect_disabled key is a convention used by this skill only — it's not part of the MCP specnpx claudepluginhub abdoumoumen/claude-skills-plugin --plugin claude-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.