Skip to content

unified-mcp-server: add a streamable-HTTP transport behind MCP_HTTP_PORT #410

Description

@jobordu

Part of #408. Depends on the response-sink refactor.

Why

MCP stdio spawns one child per client by design, so the best stdio can do is one process per session. A machine-wide singleton needs a transport many clients can share.

What

Add an HTTP listener behind an env flag (MCP_HTTP_PORT), keeping stdio as the default so existing installs are untouched.

Must match the streamable-HTTP MCP profile Claude Code already speaks — it connects to HTTP MCP servers with {"type":"http","url":...}, SSE-framed replies and an mcp-session-id header. Evidence it works: the daintree entry in a real ~/.claude.json is exactly this shape.

Note http/https are already imported in the server, but only for outbound provider health checks (transport.request at :498 and :579) — there is no listener today.

Acceptance

  • MCP_HTTP_PORT=N starts a listener; unset keeps pure stdio
  • initialize / tools/list / tools/call all answer over HTTP
  • replies are SSE-framed and mcp-session-id is honoured
  • a real Claude Code session can connect with {"type":"http","url":...} and call a provider

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions