Skip to content

Ensure JSONRPCError messages are sent for streamable http #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mhart
Copy link

@mhart mhart commented Apr 25, 2025

Prior to this, any JSONRPCError message sent when enableJsonResponse is true would be ignored (and response.end() never called)

Motivation and Context

There's a bug when enableJsonResponse is true and an error is sent, say, by the protocol. The current logic will just ignore any message that isn't a JSONRPCResponse – and JSONRPCError is one of these.

How Has This Been Tested?

I tested this by sending a message that would parse, but fail at the protocol layer due to no handler being found.

{"jsonrpc":"2.0","id":"0","method":"a"}

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines

Additional context

Prior to this, any JSONRPCError message sent when `enableJsonResponse` is true would be ignored (and response.end() never called)
@ihrpr ihrpr added this to the release 1.10.3 milestone Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants