fix(client): send MCP standard POST headers#2178
Conversation
🦋 Changeset detectedLatest commit: 4ef7e48 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
|
Code looks correct for the single-request happy path. A few test coverage gaps I'd like to see addressed before merge:
The implementation itself is solid — the ternary with |
bc6a658 to
4ef7e48
Compare
Fixes #2176.
This makes the streamable HTTP client include the SEP-2243 standard POST headers for non-batch JSON-RPC requests:
Mcp-Methodis set from the JSON-RPC method name.Mcp-Nameis set fromparams.nameorparams.uriwhen present.Validation:
pnpm --filter @modelcontextprotocol/client test -- streamableHttp.test.tspnpm --filter @modelcontextprotocol/client typecheckpnpm --filter @modelcontextprotocol/client lintpnpm --filter @modelcontextprotocol/client buildgit diff --check