[BUG] MCP stdio client fails on specific tool responses from a healthy, freshly-spawned server (works fine via raw JSON-RPC probe)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Using a local stdio MCP server (.NET, ModelContextProtocol SDK 1.2.0). Four of its tools (read_file, update_file, get_project, add_file_to_project) reliably fail with a generic client-side error ("An error occurred invoking ''") — no detail surfaced. Three other tools on the same server (list_files, search_files, create_file) succeed reliably.
Confirmed via direct investigation:
The server process is healthy — not crashing (verified via ps, uptime, and absence of macOS crash reports for the affected window).
Driving the exact same server binary directly with a minimal hand-rolled JSON-RPC/stdio client (bypassing the CLI) succeeds on every one of these calls, including under deliberately induced concurrent load (a create_file call plus 15 rapid read_file calls while file-watcher-triggered async notifications were firing) — no corruption observed at that layer.
So the server itself, and the base protocol exchange, both check out independently. The failure is specific to how this CLI's MCP client processes responses from this server for these particular calls.
Restarting the CLI session (fresh child process spawned) does not resolve it — the failure reproduces on the very first call against a brand-new, single, healthy server process.
This points at something in the CLI's MCP stdio client response handling — possibly related to protocol version/capabilities negotiated at initialize, or something about how these specific tools' response payloads are parsed — rather than the server. Happy to share the server binary/source or a minimal repro if useful.
The MCP server code is available at https://github.com/tatmanblue/the-briefcase
What Should Happen?
Claude should be able to execute any of the MCP tools without error.
Error Messages/Logs
Steps to Reproduce
- Configure claude to use the mcp server
- create a briefcase file through claude (eg "write your plan to a briefcase file")
- ask claude to read the file. specify name if you like.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
claude --version 2.1.228 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗