claude-code - 💡(How to fix) Fix [FEATURE] Skills that depend on MCP servers should be disabled (not loaded) when their MCP is disconnected [1 comments, 2 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#54711Fetched 2026-04-30 06:38:09
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Root Cause

MCP servers can silently disconnect (network issue, config change, server restart). When that happens:

  1. The skill still occupies context on every turn — burning tokens for zero benefit
  2. The problem is not visible until the skill is invoked and fails

Skipping dependent skills entirely is the correct behaviour: it saves context, gives an immediate signal that something is wrong, and avoids misleading the model into thinking a tool is available when it is not.

RAW_BUFFERClick to expand / collapse

Feature Request

When a skill depends on one or more MCP tools, it should not be loaded at all if its underlying MCP server is disconnected — and this should be reflected in /context.

Current behaviour

All skills are loaded unconditionally, regardless of whether their required MCP servers are connected. A skill like /contentful consumes context tokens whether or not mcp__contentful__* is reachable. The only way to discover the problem is to invoke the skill and have it fail.

Expected behaviour

Skills that declare MCP dependencies should be skipped at load time if their MCP is not connected:

  • No context tokens wasted on a skill that cannot function
  • /context should indicate the skill was not loaded and why (e.g. contentful [skipped — MCP unavailable])

Why this matters

MCP servers can silently disconnect (network issue, config change, server restart). When that happens:

  1. The skill still occupies context on every turn — burning tokens for zero benefit
  2. The problem is not visible until the skill is invoked and fails

Skipping dependent skills entirely is the correct behaviour: it saves context, gives an immediate signal that something is wrong, and avoids misleading the model into thinking a tool is available when it is not.

Suggested approach

  • Skills declare their MCP dependencies (e.g. a requires_mcp field in the skill definition)
  • At startup, Claude Code cross-references declared dependencies against connected MCP servers
  • Skills with unmet dependencies are not loaded; /context surfaces them as skipped with a reason

extent analysis

TL;DR

Implement a dependency check at skill load time to skip skills with disconnected MCP servers and reflect this in /context.

Guidance

  • Introduce a requires_mcp field in the skill definition to declare MCP dependencies.
  • At startup, cross-reference declared dependencies against connected MCP servers to identify skills with unmet dependencies.
  • Modify the skill loading process to skip skills with unmet dependencies and update /context to indicate the skill was not loaded due to an unavailable MCP server.
  • Consider adding logging or monitoring to detect and report MCP server disconnections.

Example

# Example skill definition with MCP dependency
skill_definition = {
    'name': 'contentful',
    'requires_mcp': ['mcp__contentful__*']
}

# Example startup code to cross-reference dependencies
connected_mcp_servers = ['mcp__server1', 'mcp__server2']
skills_to_load = []
for skill in skill_definitions:
    if all(dependency in connected_mcp_servers for dependency in skill['requires_mcp']):
        skills_to_load.append(skill)

Notes

This approach assumes that the list of connected MCP servers is available at startup. If this information is not readily available, additional infrastructure may be needed to detect MCP server connections.

Recommendation

Apply workaround: Implement the suggested approach to skip skills with disconnected MCP servers and update /context accordingly, as this directly addresses the issue and provides a clear solution.

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

claude-code - 💡(How to fix) Fix [FEATURE] Skills that depend on MCP servers should be disabled (not loaded) when their MCP is disconnected [1 comments, 2 participants]