Skip to content

SHOULD Send with 'application/json' content-type in notifications responses #1356

Closed as not planned

Description

@YifengWong

return new Response(null, { status: 202 });

In notifications responses, there is only the status code 202, but without content-type application/json. It would make my java client requests error, because the java client checks EVERY response with application/json content-type

Activity

  1. YifengWong commented on Jan 4, 2026

    @YifengWong
    Author

    Java client codes in io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport

  2. self-assigned this
    on Jan 9, 2026
  3. mattzcarey commented on Jan 15, 2026

    @mattzcarey
    Member

    Reopening this since it should be fixed on the Java client. I don't play with Java too much but it seems like it may have been fixed in. modelcontextprotocol/java-sdk#589

    Or there is a similar issue open here modelcontextprotocol/java-sdk#396

  4. added
    bugSomething isn't working
    needs confirmationNeeds confirmation that the PR is actually required or needed.
    on Jan 28, 2026
  5. felixweinberger commented on Jan 28, 2026

    @felixweinberger
    Contributor

    this is actually expected behavior per the spec — the server MUST return HTTP status code 202 Accepted with no body for notifications, so setting Content-Type: application/json would be semantically wrong.

    the fix should be on the java client side, which looks like it's been addressed in modelcontextprotocol/java-sdk#589. can you confirm if that fixes things for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions