claude-code - 💡(How to fix) Fix [BUG] MCP tools from commented-out server entries still appear in context

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…

In .mcp.json, an MCP server entry is commented out using // (JSONC-style comments). Despite this, the server's tools still appear in the deferred tools list in Claude's system context, making them appear available when they are not.

This caused Claude to incorrectly assume the Atlassian-Rovo-MCP server was active and suggest using its tools.

Root Cause

In .mcp.json, an MCP server entry is commented out using // (JSONC-style comments). Despite this, the server's tools still appear in the deferred tools list in Claude's system context, making them appear available when they are not.

This caused Claude to incorrectly assume the Atlassian-Rovo-MCP server was active and suggest using its tools.

RAW_BUFFERClick to expand / collapse

Description

In .mcp.json, an MCP server entry is commented out using // (JSONC-style comments). Despite this, the server's tools still appear in the deferred tools list in Claude's system context, making them appear available when they are not.

This caused Claude to incorrectly assume the Atlassian-Rovo-MCP server was active and suggest using its tools.

Steps to Reproduce

  1. Add an MCP server to ~/.claude/.mcp.json
  2. Comment it out using // line comments
  3. Start a new Claude Code session
  4. Observe that the commented-out server's tools still appear as deferred tools in context

Expected Behaviour

Commented-out servers should not surface any tools in the deferred tools list.

Actual Behaviour

mcp__Atlassian-Rovo-MCP__* tools appeared as deferred tools, leading Claude to incorrectly assume the server was active.

Environment

  • OS: Windows 11 Enterprise 10.0.26200
  • Model: claude-sonnet-4-6
  • Config file: ~/.claude/.mcp.json

extent analysis

TL;DR

The issue can likely be fixed by properly handling JSONC-style comments in the .mcp.json file or by using a different commenting method.

Guidance

  • Verify that the .mcp.json file is being parsed correctly, considering that JSONC-style comments (//) might not be supported in all JSON parsers.
  • Check if there's an alternative commenting method available for the .mcp.json file, such as using a different character or wrapping the entire server entry in a comment block.
  • Investigate if the issue is specific to the Windows 11 Enterprise environment or if it occurs across different operating systems.
  • Consider modifying the Claude Code session startup process to explicitly exclude commented-out servers from the deferred tools list.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The solution may depend on the specific JSON parser being used by Claude Code, as well as the expected behavior of the .mcp.json file. Further investigation into the parser and file format may be necessary to determine the root cause.

Recommendation

Apply a workaround by using a different commenting method or modifying the startup process to exclude commented-out servers, as the root cause is likely related to the parsing of JSONC-style comments.

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 [BUG] MCP tools from commented-out server entries still appear in context