MCP Protocol Compatibility¶
The specmem-mcp stdio server speaks JSON-RPC 2.0 and supports MCP revision
2026-07-28 (stateless) while still answering the older initialize handshake.
The server is a small custom loop, not the official SDK, so there is no SDK
upgrade involved.
Behavior¶
| Feature | Behavior |
|---|---|
| Framing | One JSON-RPC 2.0 message per line on stdin and stdout. Responses always carry jsonrpc: "2.0" and the request id. |
| Sessions | None. No Mcp-Session-Id, and no state depends on initialize. The workspace client is created lazily on first tool use. |
| Version header | params._meta["io.modelcontextprotocol/protocolVersion"] is checked when present. Unsupported values return -32022 with data.supported and data.requested. |
server/discover |
Returns supportedVersions, capabilities, instructions, ttlMs, cacheScope, and _meta serverInfo. |
initialize |
Still answered for legacy clients. It negotiates down to 2025-11-25 and keeps no per-connection state. notifications/* are accepted silently and ping is still answered. |
tools/list |
Deterministic order, with ttlMs and cacheScope: "public". |
tools/call |
Returns content (one text block of JSON), structuredContent, and isError. An unknown tool or missing name returns -32602. |
resources/list, resources/read |
Exposes specmem://tldr (pinned specs summary) with ttlMs and cacheScope: "private". Unknown URI returns -32602. |
resultType |
Every result carries resultType: "complete". |
| Errors | -32700 parse, -32600 invalid request, -32601 unknown method, -32602 invalid params or resource not found, -32022 unsupported protocol version. |
Compatibility matrix¶
| Client | SpecMem server | Outcome |
|---|---|---|
| Modern (2026-07-28) | dual-era | Works. server/discover is optional; any request with _meta is served statelessly. |
| Modern, wrong version | dual-era | -32022; the client retries with a listed version. |
| Dual-era | dual-era | Works. The stdio probe server/discover succeeds, so the client stays modern. |
| Legacy (2025-11-25 or earlier) | dual-era | Works. initialize is answered, later requests are served without session state. |
Behavior change for clients of earlier SpecMem releases: responses used to be
{"id", "result": <raw dict>} without jsonrpc, and tools/call returned the raw
dict. It now returns a spec-shaped result. The raw dict is available as
structuredContent.
Not implemented¶
subscriptions/listen, the tasks extension and multi round-trip requests (SpecMem tools never need server-initiated input).- Streamable HTTP transport (stdio only).
- Skills over MCP (SEP-2640,
io.modelcontextprotocol/skills): deferred. It needsskills/list,skills/get,skill://resources for every skill file, digests and optional directory reads. Tracked as a follow-up issue.