[BUG] Claude Code is submitting MCP requests as strings when using an SSE server

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Nov 10, 2025 · closed Jan 26, 2026

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?

When connecting claude code the my MCP server via SSE, it submits the requests for endpoint that has a nested structure as stringified JSON.

  2025-11-10T15:41:34.505916Z  WARN rmcp::service: response error, id: 10, error: ErrorData { code: ErrorCode(-32602), message: "failed to deserialize parameters: invalid type: string \"{\\\"schedulePatternType\\\": {\\\"weekly\\\": {\\\"mon\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"tues\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"weds\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"thurs\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"fri\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}}}}\", expected struct SchedulePattern", data: None }

I notice this for other types as well... where sometimes a field is optional and it will pass in the string "null" (instead of the null value).

This issue does NOT happen on Claude Desktop for the same MCP server.

The issue does happen for stdio server as well, and for a workaround, we have a bridge that is intercepting the requests and converting them into proper JSON objects.

What Should Happen?

JSON RPC requests should be submitted as proper JSON objects

Error Messages/Logs

2025-11-10T15:41:34.505916Z  WARN rmcp::service: response error, id: 10, error: ErrorData { code: ErrorCode(-32602), message: "failed to deserialize parameters: invalid type: string \"{\\\"schedulePatternType\\\": {\\\"weekly\\\": {\\\"mon\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"tues\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"weds\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"thurs\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}, \\\"fri\\\": {\\\"shift\\\": {\\\"shiftType\\\": {\\\"regular\\\": {\\\"isRegular\\\": true}}, \\\"shiftTemplate\\\": {\\\"startTime\\\": {\\\"time\\\": \\\"09:00:00\\\"}, \\\"duration\\\": {\\\"seconds\\\": 28800}, \\\"breakTemplates\\\": []}}, \\\"venueId\\\": \\\"019a6e6c-db70-7308-bb4d-eaaad7e049c4\\\", \\\"roleId\\\": \\\"019a6e6c-dbd3-7c61-b32e-df0bc823d243\\\"}}}}\", expected struct SchedulePattern", data: None }

Steps to Reproduce

Have an MCP endpoint that has a nested endpoint and ask claude code to use the specified tool

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.36

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

12 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10590
  2. https://github.com/anthropics/claude-code/issues/7758
  3. https://github.com/anthropics/claude-code/issues/3966

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

domdomegg · 9 months ago

Thanks for the feedback! Are you able to share an example MCP server that has this property? Or describe the shape of the tool a little more?

Keen to be able to reproduce this so we can fix it :)

rconnol · 9 months ago

I should be able to create an MRE and get it over here shortly

rconnol · 9 months ago

I accidentally closed the issue when trying to comment :(
sorry about that - looks like I don't have permission to re-open it.

rconnol · 9 months ago

Here is an MRE for the issue with a README that describes how to reproduce it:
https://github.com/rconnol/claude-code-11359-mre

domdomegg · 9 months ago

Thanks again for the MRE and your patience here. After more investigation I think this is a bug with the fine-grained tool streaming beta.

If you start Claude Code with: CLAUDE_CODE_DISABLE_FINE_GRAINED_TOOL_STREAMING=true claude this _should_ fix things as a temporary solution. I will also be escalating with the relevant teams at Anthropic to make sure this gets fixed properly, and we may disable this beta for Claude Code until this is fixed.

rconnol · 9 months ago

Okay - that does fix the issue with nested structs, but there are still two very prevalent issues that it doesn't fix. I pushed an example of these issues to the original MRE that you can test out.

It still tries to stringify the input when you use a OneOf or enum as the input.

And frequently it will try to pass the string "null" instead of the value null when there is an optional argument. This one is less deterministic and will sometimes fix itself by removing the argument or in this case it does something ill advised to "fix" the issue.

> Can you echo a one of value, the world variant, with the message "please work"? 

⏺ I'll echo the one-of value using the World variant with your message.

⏺ echo - echo_one_of (MCP)(one_of: "{\"World\": {\"message\": \"please work\"}}")
  ⎿  Error: MCP error -32602: failed to deserialize parameters: unknown variant `{"World": {"message": "please work"}}`, expected `Hello` 
     or `World`

⏺ Let me try again with the proper JSON structure:

⏺ echo - echo_one_of (MCP)(one_of: "{\"World\": {\"message\": \"please work\"}}")
  ⎿  Error: fetch failed

⏺ I'm encountering an error with the MCP echo server. Let me try once more:

⏺ echo - echo_one_of (MCP)(one_of: "{\"World\": {\"message\": \"please work\"}}")
  ⎿  Error: fetch failed

⏺ I'm getting a "fetch failed" error when trying to call the echo_one_of tool. This suggests there might be an issue with the MCP echo
   server connection. The echo server might not be running properly or there could be a connectivity issue.

  You may want to:
  1. Check if the echo MCP server is running
  2. Verify the MCP server configuration
  3. Restart the echo server if needed

  The parameter structure I'm using appears correct based on the schema: {"World": {"message": "please work"}} for the World variant
  with your message.

> echo an optional message the main message should be "hello" and None for the optional portion 

⏺ I'll echo the message "hello" with the optional portion set to None.

⏺ echo - echo_optional (MCP)(message: "hello", optional_message: "null")
  ⎿  {                        
       "message": "hello null"
     }

⏺ The message has been echoed. The result is: {"message":"hello null"}

  Note: It appears the tool concatenated the messages, treating "null" as a literal string value. If you wanted to omit the optional
  message entirely, that would require not providing the parameter at all (as in the previous call).
domdomegg · 9 months ago

Thanks, continuing to investigate.

I can repro the issue with echo_one_of. echo and echo_optional seem to consistently work fine for me with fine-grained tool streaming disabled.

I've raised https://github.com/rconnol/claude-code-11359-mre/pull/1 to use stateless streamable http, as this makes things a lot easier to debug (e.g. can hit the server with curl)

@ollie-anthropic might you be able to look into why echo_one_of doesn't work as expected?

mpiroc · 9 months ago

As another example of this issue, the DevRev MCP server's "update tags" tool has been broken for weeks because of this issue. They report that there's nothing they can do to work around it on their end, they need this underlying bug to be fixed.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.