String request ids are limited to letters, digits, "_" and "-"
I maintainer di solito rispondono entro 1 giorno
@koic ci sta già lavorando.
Dal 14/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
String request ids are only accepted if they consist of letters, digits, _ and -. Anything else is refused as Invalid Request:
server = MCP::Server.new(name: "repro", version: "1.0.0", tools: [], capabilities: { tools: {} })
server.handle_json('{"jsonrpc":"2.0","id":"req.1","method":"tools/list"}')
# => {"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid Request","data":"Request ID must match validation pattern, or be an integer or null"}}
server.handle_json('{"jsonrpc":"2.0","id":"req-1","method":"tools/list"}')
# => {"jsonrpc":"2.0","id":"req-1","result":{"tools":[]}}
The pattern comes from JsonRpcHandler::DEFAULT_ALLOWED_ID_CHARACTERS (/\A[a-zA-Z0-9_-]+\z/). Both JSON-RPC 2.0 and MCP allow any string here ("Requests MUST include a string or integer ID", Basic Protocol, Requests), so a client that uses ids like req.1, call:42 or a URN can't talk to a Ruby server. The error also drops the id, even though it was readable, so the client can't match the answer to its request.
JsonRpcHandler.handle takes an id_validation_pattern: keyword, but MCP::Server#handle and #handle_json don't pass one through, so a server can't loosen it without patching the SDK.
Is the restriction intentional, for example to keep odd characters out of logs? If so, an option on the server would already help. Otherwise accepting any string would match the spec.
Seen with 1.7.0; main at 9d12f51 has the same code.
- Lingua principale
- Ruby
- Stelle
- 924
- Fork
- 136
- Merge medio
- 1g 5h
- PR unite (30g)
- 37
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/ruby-sdk
-
Empty members in the Accept header cause a 500Forse già presa @koic l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/ruby-sdk#609 ·
I maintainer di solito rispondono entro 1 giorno
-
Error responses carry "id": null, which the MCP schema does not allowForse già presa @koic l’ha presa oggi. Apertabug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
modelcontextprotocol/ruby-sdk#606 ·
I maintainer di solito rispondono entro 1 giorno
-
Methods of undeclared capabilities return -32603 instead of -32601Forse già presa @koic l’ha presa 1 giorno fa. Apertabug
modelcontextprotocol/ruby-sdk#602 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Requests with "id": null are run like notificationsForse già presa @koic l’ha presa 1 giorno fa. Apertabug
modelcontextprotocol/ruby-sdk#601 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Support modelcontextprotocol/experimental-ext-triggers-eventsForse già presa @koic l’ha presa 4 giorni fa. Apertaenhancement
modelcontextprotocol/ruby-sdk#594 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/ruby-sdk
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
TheOdinProject/curriculum#31465 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
agent:triaged bug bughunt pm:bundler priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SocketDev/socket-patch#1573 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Generated server webpack config keeps Rspack's manifest and CSS extraction pluginsForse già presa @justin808 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
shakacode/react_on_rails#5184 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chat verified
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 6 giorni