Server answers transport errors with legacy code -32000 on the 2026-07-28 path
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 70/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- express, node.js, typescript
Rechercherichtung
Grep nach -32e3 / -32000 über die Pakete server, express und node hinweg; die genannten Einstiegspunkte sind modernOnlyStrictRejection und jsonRpcErrorResponse (405) in server sowie die Host/Origin-403-Middleware in express und node. Lies den streamable Transport aus der Handshake-Ära separat, da seine Codes 400/403/406/409/413/415 bleiben müssen. Ändere nur die Antworten, die nicht an eine Handshake-Revision gebunden sind, zu -32600 (oder entferne den Body), aktualisiere die betroffenen Transport-Tests und bestätige mit den beiden curl-Befehlen im Issue.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13.8k
- Forks
- 2.5k
- Ø Merge
- 6 T. 23 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/typescript-sdk
-
v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Evtl. vergeben @mgoldsborough hat das vor 6 Tagen übernommen. Offenv2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Maintainer antworten meist innerhalb von 1 Tag
-
v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyEvtl. vergeben @Tidehyc hat das vor 7 Tagen übernommen. Offenv2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsEvtl. vergeben @yunusemrejs hat das vor 12 Tagen übernommen. Offenv1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modelcontextprotocol/typescript-sdk
Ähnliche Issues
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openclaw/openclaw#212827 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Use one constant for the 10,000-character input limitEvtl. vergeben @NginxL hat das heute übernommen. Offengood first issue refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
aniru-dh21/snap-validate#51 ·
Maintainer antworten meist innerhalb von 1 Tag
-
dependencies effort: small good first issue priority: low
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer antworten meist innerhalb von 1 Tag
-
from-review tech-debt testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
blamechris/chroxy#9520 ·
Maintainer antworten meist innerhalb von 1 Tag