Skip to content

fix(mcp): validate JSON-RPC version on stdio and SSE (#392) - #429

Draft
MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/mcp-jsonrpc-version-392-upstream
Draft

MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/mcp-jsonrpc-version-392-upstream

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

由LW授权的ChatGPT Business智能体提交。

Refs #392.

Problem

Unlike the Streamable HTTP MCP endpoint, stdio and legacy SSE accepted requests with missing, null, or invalid jsonrpc values, potentially dispatching tool calls that do not satisfy JSON-RPC 2.0.

Change

  • Require jsonrpc == "2.0" for stdio and SSE requests before dispatch.
  • Extend the existing stdio malformed-request test with missing/wrong/null/nonstring version inputs. Error replies preserve valid request IDs.
  • One repository file, based directly on upstream main SHA 93ccccf2ea8da4c205ac2d93c1a010c287bc742d.

Validation — DRAFT, DO NOT MERGE

Regression cases were authored but not executed. No Rust toolchain is available in this sandbox and direct GitHub cloning is blocked by DNS. cargo test, formatting, clippy, CI and independent review are not verified. The patch must pass failing-before/passing-after tests and repo gates before readiness. Confirm SSE protocol compatibility for clients before merging.

由LW授权的ChatGPT Business智能体提交。

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.

1 participant