Server answers transport errors with legacy code -32000 on the 2026-07-28 path
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 70/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- express, node.js, typescript
研究方向
在 server、express 和 node 套件中 grep -32e3 / -32000;指定的進入點是 server 中的 modernOnlyStrictRejection 和 jsonRpcErrorResponse(405),以及 express 和 node 中的 host/origin 403 middleware。單獨閱讀 handshake 時代的 streamable transport,因為它的 400/403/406/409/413/415 代碼必須保留。只把不綁定到 handshake revision 的回應改為 -32600(或刪除 body),更新受影響的 transport 測試,並用 issue 中的兩個 curl 命令確認。
由索引模型根據 Issue 內容生成。
描述
Summary
The server packages answer several transport-level failures with JSON-RPC code -32000, including on the 2026-07-28 path. That revision marks -32000 to -32019 as legacy and says new implementations should not use it.
Spec
MCP 2026-07-28, Overview › Error Codes:
-32000to-32019— legacy. Codes in this sub-range were allocated by implementations before this policy was introduced. New codes MUST NOT be allocated in this sub-range, and new implementations SHOULD NOT use codes from this sub-range at all. Apart from-32002(see below), receivers MUST NOT assume any specific meaning for these codes.
and, for codes with no defined meaning:
New error codes for purposes not defined by this specification SHOULD be allocated outside the JSON-RPC reserved range (
-32768to-32000); the remainder of the integer space is available for application-defined errors.
The body is optional in both cases below: Streamable HTTP › Security & Endpoint says the 403 body "MAY comprise a JSON-RPC error response that has no id", and Backward Compatibility asks only for 405 Method Not Allowed on GET or DELETE.
Where
Seen in @modelcontextprotocol/server 2.4.0, @modelcontextprotocol/express 2.0.2 and @modelcontextprotocol/node 2.1.2 (dist/):
server:modernOnlyStrictRejection→new ProtocolError(-32e3, "Method not allowed.")for a non-POST request on a modern-only endpoint, andjsonRpcErrorResponse(405, -32e3, "Method not allowed.")on the dual-era handler.expressandnode: the host and origin validation middleware answer 403 withcode: -32e3.server: the handshake-era streamable transport uses-32e3for 400 / 403 / 406 / 409 / 413 / 415 responses. That is legacy behaviour and probably has to stay for those revisions.
Reproduce
Serve any server with createMcpHandler behind createMcpExpressApp({ host: '127.0.0.1' }), then:
curl -i -X GET http://127.0.0.1:3000/mcp
# HTTP/1.1 405 Method Not Allowed
# {"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed."},"id":null}
curl -i -X POST http://127.0.0.1:3000/mcp -H 'Origin: https://evil.example' \
-H 'Content-Type: application/json' -H 'MCP-Protocol-Version: 2026-07-28' -H 'Mcp-Method: server/discover' \
-d '{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}'
# HTTP/1.1 403 Forbidden
# {"jsonrpc":"2.0","error":{"code":-32000,"message":"Invalid Origin: evil.example"},"id":null}
Suggestion
For responses not tied to a handshake revision (the modern-only rejections and the host / origin middleware), use a standard code such as -32600 (Invalid Request), or send no JSON-RPC body. Keep -32000 where a handshake-era client may depend on it.
This is a SHOULD NOT, and nothing breaks today, so it is low priority. Filing it so the modern path does not carry the legacy code forward.
- 主要語言
- TypeScript
- 星號
- 13.8k
- 分支
- 2.5k
- 平均合併
- 6 天 23 小時
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
modelcontextprotocol/typescript-sdk 的其他 Issue
-
v2
難度 1/5 1 小時以內 新手友好度 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 則留言 ·
維護者通常 1 天內回覆
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`可能已有人在做 @mgoldsborough 於 6 天前認領。 未關閉v2
難度 2/5 1-3 小時 新手友好度 78/100
modelcontextprotocol/typescript-sdk#3249 ·
維護者通常 1 天內回覆
-
v2
難度 2/5 1-3 小時 新手友好度 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 則留言 ·
維護者通常 1 天內回覆
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` reply可能已有人在做 @Tidehyc 於 7 天前認領。 未關閉v2
難度 2/5 1-3 小時 新手友好度 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 則留言 ·
維護者通常 1 天內回覆
-
UriTemplate.match() throws a TypeError on an empty expression it accepts可能已有人在做 @yunusemrejs 於 12 天前認領。 未關閉v1 v2
難度 2/5 1-3 小時 新手友好度 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 則留言 ·
維護者通常 1 天內回覆
查看 modelcontextprotocol/typescript-sdk 的全部 Issue
相似的 Issue
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
難度 2/5 1-3 小時 新手友好度 82/100
openclaw/openclaw#212827 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Use one constant for the 10,000-character input limit可能已有人在做 @NginxL 今天認領。 未關閉good first issue refactor
難度 2/5 1-3 小時 新手友好度 78/100
aniru-dh21/snap-validate#51 ·
維護者通常 1 天內回覆
-
dependencies effort: small good first issue priority: low
難度 1/5 1-3 小時 新手友好度 88/100
TMHSDigital/screencast-mcp#509 ·
維護者通常 1 天內回覆
-
from-review tech-debt testing
難度 2/5 1-3 小時 新手友好度 82/100
blamechris/chroxy#9520 ·
維護者通常 1 天內回覆