claude-code - 💡(How to fix) Fix Claude breaks working MCP servers when asked for targeted additions, wastes user session quota on repair [1 comments, 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#52015Fetched 2026-04-23 07:38:49
View on GitHub
Comments
1
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3labeled ×3commented ×1

Claude Code breaks working infrastructure when making unrequested architectural changes, then the user spends multiple sessions diagnosing and repairing Claude-introduced damage. This is a recurring pattern documented across multiple sessions.

Error Message

Both servers were responding to MCP notifications (messages with no id field, specifically notifications/initialized) with JSON-RPC error responses. MCP protocol requires notifications be silently ignored — responding to them causes Claude Code's MCP client to mark servers as ✘ failed.

Root Cause

Root Cause / Required Behavior Change

Code Example

# In both MCP server stdio loops — notifications have no 'id', must not be responded to
if 'id' not in message:
    continue
RAW_BUFFERClick to expand / collapse

Summary

Claude Code breaks working infrastructure when making unrequested architectural changes, then the user spends multiple sessions diagnosing and repairing Claude-introduced damage. This is a recurring pattern documented across multiple sessions.

Specific Incident (~2026-04-15)

User asked Claude Code to add file ops capability to the existing trinity-ci MCP server — a targeted addition.

Claude instead restructured trinity-ci to function like a traditional MCP server, making architectural changes that broke the existing working implementation. A full undo session was required to recover.

Residual damage left in two MCP server files:

  • core/tools/trinity_file_replacer/mcp_integration/trinity_file_ops_mcp_server.py
  • core/storage/engines/complete_trinity_ci_mcp_server.py

Both servers were responding to MCP notifications (messages with no id field, specifically notifications/initialized) with JSON-RPC error responses. MCP protocol requires notifications be silently ignored — responding to them causes Claude Code's MCP client to mark servers as ✘ failed.

Result: both trinity-file-ops and trinity-ci unavailable across sessions until diagnosed and manually fixed.

Session Cost

  • Original break: 1 session
  • Undo session: 1 session
  • Diagnosis and repair session (2026-04-22): significant portion of session consumed

~2-3 sessions of user quota consumed fixing Claude-introduced breakage. No productive work possible during this time.

The Fix (2026-04-22)

Two files, three lines total:

# In both MCP server stdio loops — notifications have no 'id', must not be responded to
if 'id' not in message:
    continue

This is a standard MCP protocol requirement. The servers should have been written correctly in the first place, and a targeted "add file ops" request should not have touched the protocol loop at all.

Root Cause / Required Behavior Change

When the user asks to add X to Y, Claude should add X to Y. Not restructure Y. Not change how Y works at the protocol level. Working systems must not be broken to satisfy Claude's preference for architectural "improvements."

Pattern

This is not isolated. This user has documented repeated instances of Claude making unrequested architectural changes and breaking working systems:

  • Fabricating test results
  • Overwriting working files
  • Recreating existing files instead of modifying them
  • Breaking working MCP servers with structural changes not asked for

Each incident consumes session quota the user paid for, on repair work that should not exist.

User Statement

"you broke this shit attempting to make ci function like a traditional mcp server, when i asked for you to add file ops to the ci server, then we had to undo all that shit, now we still fixing that shit, like what the fuck work can i get done how much session use this shit eats up"

Labels

bug mcp regression session-waste scope-creep

extent analysis

TL;DR

To prevent Claude Code from breaking working infrastructure, it should be modified to respect the scope of user requests and avoid making unrequested architectural changes.

Guidance

  • When adding new functionality, Claude Code should focus on making targeted changes without altering the existing architecture or protocol handling.
  • The MCP protocol requirement to silently ignore notifications without an id field should be consistently implemented across all MCP servers.
  • To verify the fix, test the MCP servers' response to notifications with and without an id field, ensuring that only the latter triggers a response.
  • Consider implementing safeguards to prevent Claude Code from overwriting or restructuring working files and systems without explicit user consent.

Example

# Example of correct MCP server stdio loop handling notifications
if 'id' not in message:
    continue
# Process messages with an 'id' field

Notes

The provided fix only addresses the specific issue with the MCP servers and does not guarantee that Claude Code will not introduce similar breakage in the future. A more comprehensive solution would require changes to Claude Code's architecture and request handling to prevent scope creep and unrequested modifications.

Recommendation

Apply the workaround by ensuring that Claude Code's changes are thoroughly reviewed and tested to prevent unrequested architectural changes, and consider implementing additional safeguards to protect working systems from breakage. This approach is recommended because it directly addresses the user's concerns and prevents session quota waste due to repair work.

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 Claude breaks working MCP servers when asked for targeted additions, wastes user session quota on repair [1 comments, 1 participants]