[BUG] WebFetchTool returns invalid JSON when invoked via MCP
Resolved 💬 2 comments Opened Mar 28, 2025 by paulgb Closed Nov 30, 2025
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: MCP in Claude Desktop
- Claude CLI version: 0.2.56
- Operating System: Mac OS
- Terminal: N/A (Claude Desktop)
Bug Description
When invoked via MCP, the WebFetchTool returns a line containing getClaudeMdHosts Set(0) {} before sending a line with valid JSON, which causes an issue to pop up in Claude.
<img width="1112" alt="Image" src="https://github.com/user-attachments/assets/65db0a62-5140-4ad4-a741-17d87d59b739" />
I can also reproduce it when calling the MCP tool via the CLI:
<img width="1481" alt="Image" src="https://github.com/user-attachments/assets/0122d788-3215-4e31-84a0-c16b6681dd54" />
Steps to Reproduce
- In a terminal, run
claude mcp serve - When the MCP server starts, paste
{"jsonrpc":"2.0","id":"toolu_0115GhU2yDntaQ2FkEMwqNf4","method":"tools/call","params":{"name":"WebFetchTool","arguments":{"url": "https://modelcontextprotocol.io/introduction", "prompt": "Summarize the ModelContextProtocol introduction, including the title, description, and any important comments or context."}}}and hit enter - Observe that the invalid JSON comes back
Expected Behavior
The getClaudeMdHosts Set(0) {} line should be entirely omitted
Actual Behavior
It is not
Additional Context
Similar repro to #646, but I'm filing a separate issue as I believe these are unrelated.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗