ruby-sdk/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Koichi ITO 81e81c359e Validate Content-Type on POST requests
## Motivation and Context

The MCP Streamable HTTP specification requires POST request bodies to
be JSON-RPC messages with `Content-Type: application/json`. The Ruby
SDK did not validate Content-Type, accepting requests with any or no
Content-Type. The Python SDK validates this and returns 415
Unsupported Media Type for non-JSON Content-Types.

## How Has This Been Tested?

Added tests for Content-Type validation:

- POST without Content-Type returns 415
- POST with `Content-Type: text/plain` returns 415
- POST with `Content-Type: application/json; charset=utf-8` succeeds

## Breaking Changes

POST requests without `Content-Type: application/json` now return
415 Unsupported Media Type. This is a spec compliance fix.
2026-04-08 19:40:55 +09:00
..
mcp Validate Content-Type on POST requests 2026-04-08 19:40:55 +09:00
json_rpc_handler.rb Support POST response SSE streams for server-to-client messages 2026-04-04 19:20:31 +09:00
mcp.rb Introduce ServerSession for per-connection state 2026-03-29 08:04:56 +09:00