Repository navigation
Description
Motivation
The MCP spec (2025-06-18) defines two standard transports: stdio and Streamable HTTP. The legacy HTTP+SSE transport from protocol version 2024-11-05 is now deprecated.
Uteke currently has two separate binaries with a transport gap:
| Binary | Transport | Status |
|---|---|---|
uteke-mcp |
stdio (JSON-RPC over stdin/stdout) | ✅ implemented |
uteke-server |
HTTP REST (not MCP) | ❌ no JSON-RPC |
| both | Streamable HTTP | ❌ not implemented |
| both | SSE (legacy, deprecated) | ❌ not implemented |
Additionally, uteke-mcp advertises protocolVersion: "2024-11-05" (the old spec version). The current spec is 2025-06-18.
Sources:
crates/uteke-mcp/src/main.rs:170—protocolVersion: "2024-11-05"crates/uteke-server/src/main.rs— pure REST routes (/remember,/recall, …), no JSON-RPC handling- MCP Transports spec (2025-06-18)
Proposal
1. Bump protocolVersion to 2025-06-18
uteke-mcp and any new HTTP MCP endpoint must negotiate the current protocol version.
2. Add Streamable HTTP transport to uteke-server
Expose a single MCP endpoint (e.g. POST /mcp) on the existing HTTP server that:
- Accepts JSON-RPC messages (initialize / tools/list / tools/call / notifications/initialized).
- Returns either
Content-Type: application/json(single response) orContent-Type: text/event-stream(SSE stream) per spec § "Streamable HTTP". - Validates the
Accept: application/json, text/event-streamheader. - Implements
Mcp-Session-Idsession management (optional but recommended for stateful servers). - Supports
DELETE /mcpfor session termination. - Includes the
MCP-Protocol-Versionheader on all post-initialize responses.
This lets remote MCP clients (Claude Desktop, web clients, etc.) talk to uteke over HTTP instead of having to spawn a subprocess — important for Docker / server deployments.
3. Backward-compat (optional, defer if low demand)
For pre-2025-06-18 clients: keep the old GET /sse + POST /messages endpoints alive alongside the new /mcp endpoint, as the spec recommends in § "Backwards Compatibility".
Scope
- Bump
protocolVersionto2025-06-18inuteke-mcpinitializeresponse. - Extract the JSON-RPC dispatcher (
handle_request) fromuteke-mcpinto a reusable module so both transports share tool definitions and handlers. - Add
POST /mcp(and optionalGET/DELETE) touteke-serverimplementing Streamable HTTP. - Validate
Acceptheader, return SSE or JSON content type accordingly. - Implement
Mcp-Session-Idsession management (generate on initialize, require on subsequent requests). - Add
MCP-Protocol-Versionheader handling on responses. - Security: validate
Originheader; bind localhost by default; reuse existing--auth-tokenbearer auth. - Tests: initialize handshake, tools/list, tools/call over HTTP; session lifecycle; invalid session 404.
- Docs:
docs/cli-reference.mdor a newdocs/mcp.mdcovering both transports.
Non-Goals
- Full SSE streaming of long-running tool results (premature —
tools/callresults are fast). - Replacing the REST API on
/rememberetc. — those stay for non-MCP clients. - WebSocket transport (not in spec).
Dependencies
- None blocking. Refactor of
handle_requestis the only cross-crate change.
Activity
fix(#381): restore dropped params + body size limit
fix(#381): restore room/author params in exec_remember
fix(#381): safe ID slicing + reject oversized MCP bodies
feat(#381): MCP Streamable HTTP transport + protocol version bump (#397)
feat(#381): MCP Streamable HTTP transport + protocol version bump (#397)