Skip to content

MCP server doesn't support charset in the content-type header #450

@nerzhulart

Description

@nerzhulart

Request:

POST http://localhost:64342/message?sessionId=dc88f4aa-5e12-40c6-b355-be080a8cd44c HTTP/1.1
content-type: application/json; charset=utf-8
MCP-Protocol-Version: 2025-06-18
Host: localhost:64342

{"jsonrpc":"2.0","method":"initialize"...

Response:

HTTP/1.1 400
content-length: 74
content-type: text/plain; charset=UTF-8

Invalid message: Unsupported content-type: application/json; charset=utf-8)

But it works with this request:

POST http://localhost:64342/message?sessionId=59a02966-377e-459a-9724-ed3a35a4a62d HTTP/1.1
content-type: application/json
MCP-Protocol-Version: 2025-06-18
Host: localhost:64342

{"jsonrpc":"2.0","method":"initialize"...

Response

HTTP/1.1 202
content-length: 8
content-type: text/plain; charset=UTF-8
...

Issue from https://youtrack.jetbrains.com/issue/IJPL-221890

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions