Files
Alexander Serheyev 1c4bdab123 arch: decouple HTTP API gateway and MCP gateway via shared service resolver, add HTTP SSE support (#4882)
* arch: decouple HTTP API gateway and MCP gateway via shared schema resolver

- Add gateway/schema: shared registry watcher and endpoint schema parser
  used by both gateways, replacing duplicated discovery logic in gateway/mcp
- gateway/mcp: consume schema.Resolver; add NewServer for independent
  lifecycle (discovery/watching in NewServer, transport in Serve, shutdown
  via Stop)
- gateway/api: remove MCPEnabled/MCPAddress fields and background MCP
  spawning; the HTTP gateway no longer starts MCP
- cmd/micro/run and cmd/micro/gateway: instantiate and orchestrate both
  gateways explicitly, shutting down together on signal or first exit
- Mark gateway decoupling tickets 01-03 done

* feat(mcp): add streamable-HTTP transport for browser MCP clients

Implement the MCP streamable-HTTP spec at /mcp: POST JSON-RPC (batches,
notifications -> 202), GET SSE stream with heartbeat and session
lifecycle, DELETE session teardown, Mcp-Session-Id minted on initialize,
30-min idle session sweep. Tool dispatch shares invokeTool with the
legacy /mcp/call route; x402 challenge and tool-execution errors surface
as isError results.

Fixes browser-based clients (llama.cpp web UI): CORS preflight allows
mcp-protocol-version, and serveHTTP now shuts down the HTTP server when
the context is canceled so Ctrl-C/SIGTERM terminate cleanly.

* docs(website): document streamable-HTTP MCP transport and gateway decoupling
2026-08-11 16:50:20 +01:00
..