fix(mcp): preserve JSON-RPC string ids instead of coercing to int (#253)
JSON-RPC 2.0 §4 permits string request ids, and several MCP clients (including Claude Desktop) send a string id for "initialize". The parser coerced string ids via strtol, yielding 0 for any non-numeric id, so the response echoed the wrong id and the client could not correlate it. Carry the string id verbatim through parse -> dispatch -> response (new id_str field on the request/response structs) and emit it as a JSON string. Numeric ids are unchanged. The method-not-found error path now echoes the original id too.
M
Martin Vogel committed
4abcaa43e7af54ee5f0ed8c9ba37743e802161de
Parent: 9dcc0e3