claude-code - 💡(How to fix) Fix Feature: Per-MCP-server toggle within plugins [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46373Fetched 2026-04-11 06:22:00
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Root Cause

Users report disabling MCP servers during a session, only to have them reactivate on the next session because the plugin re-injects them from its .mcp.json manifest.

Code Example

{
  "enabledPlugins": {
    "engineering@knowledge-work-plugins": {
      "enabled": true,
      "disabledMcpServers": ["pagerduty", "datadog", "slack"]
    }
  }
}

---

{
  "disabledMcpServers": ["pagerduty", "datadog", "intercom", "hex"]
}
RAW_BUFFERClick to expand / collapse

Problem

Plugins (especially knowledge-work-plugins) bundle multiple MCP servers, but there's no way to selectively disable individual MCP servers within an enabled plugin. It's all-or-nothing at the plugin level.

This creates two problems:

1. Massive MCP server duplication across plugins

When multiple knowledge-work plugins are enabled, the same MCP servers load multiple times. For example, with just engineering, design, and data enabled:

MCP ServerDeclared In
slackengineering, design
atlassianengineering, design, data
notionengineering, design
gmailengineering, design
google-calendarengineering, design
asanaengineering, design
linearengineering, design

The slack MCP server alone is declared in 12+ knowledge-work plugins.

2. Unnecessary context window consumption

Each MCP server injects tool definitions into the deferred tools list, consuming context space on every turn — even if the user never calls those tools. Users who want a plugin's skills/agents but not all of its MCP servers have no way to reduce this overhead.

3. Disabling MCP servers doesn't persist

Users report disabling MCP servers during a session, only to have them reactivate on the next session because the plugin re-injects them from its .mcp.json manifest.

Proposed Solution

Add per-MCP-server toggles within plugins. For example, in settings.json:

{
  "enabledPlugins": {
    "engineering@knowledge-work-plugins": {
      "enabled": true,
      "disabledMcpServers": ["pagerduty", "datadog", "slack"]
    }
  }
}

Or alternatively, a global MCP server blocklist:

{
  "disabledMcpServers": ["pagerduty", "datadog", "intercom", "hex"]
}

Additional considerations

  • Deduplication: When multiple plugins declare the same MCP server (e.g., slack), only one instance should load. Currently each plugin loads its own copy.
  • Hooks are insufficient: A PreToolUse hook can block MCP tool execution, but the tool definitions still load into context, so the context overhead remains.

Environment

  • Claude Code CLI (macOS)
  • Multiple knowledge-work-plugins + standalone plugins enabled simultaneously

🤖 Generated with Claude Code

extent analysis

TL;DR

Implement per-MCP-server toggles within plugins or a global MCP server blocklist to selectively disable individual MCP servers and reduce duplication and context overhead.

Guidance

  • Introduce a disabledMcpServers setting within each plugin's configuration to allow users to selectively disable MCP servers.
  • Consider implementing a global MCP server blocklist to disable specific MCP servers across all plugins.
  • To address deduplication, ensure that only one instance of an MCP server loads when multiple plugins declare the same server.
  • Review the PreToolUse hook to determine if it can be modified to prevent tool definitions from loading into context when an MCP server is disabled.

Example

{
  "enabledPlugins": {
    "engineering@knowledge-work-plugins": {
      "enabled": true,
      "disabledMcpServers": ["slack", "atlassian"]
    }
  }
}

Notes

The proposed solution requires modifications to the plugin configuration and potentially the PreToolUse hook. The implementation details may vary depending on the specific requirements and constraints of the Claude Code CLI and knowledge-work-plugins.

Recommendation

Apply a workaround by introducing a disabledMcpServers setting within each plugin's configuration to selectively disable individual MCP servers, as this approach allows for more fine-grained control over MCP server loading and reduces context overhead.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING