Skip to content

Fix MCP JSON-RPC request ids#2304

Open
0rdep wants to merge 3 commits into
Effect-TS:mainfrom
0rdep:fix/mcp-json-rpc-request-ids
Open

Fix MCP JSON-RPC request ids#2304
0rdep wants to merge 3 commits into
Effect-TS:mainfrom
0rdep:fix/mcp-json-rpc-request-ids

Conversation

@0rdep
Copy link
Copy Markdown

@0rdep 0rdep commented May 29, 2026

Summary

  • Preserve arbitrary JSON-RPC request ids for MCP HTTP clients, including strings, numbers, null, and omitted ids.
  • Map external JSON-RPC ids to safe internal RPC ids so the core RPC RequestId can remain bigint-based.
  • Add regression coverage for JSON-RPC serialization and the MCP HTTP server path.

Testing

  • pnpm lint-fix
  • pnpm test packages/effect/test/rpc/RpcSerialization.test.ts --run
  • pnpm test packages/effect/test/unstable/ai/McpServer.test.ts --run
  • pnpm --filter effect check
  • git diff --check

pnpm check:tsgo was also run earlier and still fails on unrelated existing diagnostics in packages/effect/typetest/Effect.tst.ts about missing OtherError expectations.

Fixes #2303

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 21ece75

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/openapi-generator Patch

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

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.

Failed to parse requestId on McpServer

1 participant