Skip to content

feat(mcp): add HTTP/SSE transport support #419

Description

@joshrotenberg

Summary

Add HTTP transport support to the MCP server, in addition to the existing stdio transport.

Parent tracking issue: joshrotenberg/jpx-cloud#1 (jpx-server as multi-agent query service)

Motivation

  • Enables remote MCP server deployment (not just local stdio)
  • Allows multiple clients to connect to a single server instance
  • Better suited for containerized/cloud deployments
  • Foundation for SaaS offering

Current State

  • Using rmcp v0.12 with transport-io feature (stdio only)
  • rmcp already supports HTTP via transport-streamable-http-server feature
  • Latest rmcp is v0.14.0

Proposed Implementation

  1. Update rmcp to latest version

  2. Add feature flag in Cargo.toml:

    mcp-http = ["rmcp/transport-streamable-http-server", ...]
  3. Add CLI flags via clap:

    # Current behavior (default)
    jpx-server --transport stdio
    
    # HTTP mode
    jpx-server --transport http --port 3000
    jpx-server --transport http --port 3000 --host 0.0.0.0
  4. Transport selection in mcp/mod.rs:

    match args.transport {
        Transport::Stdio => service.serve(stdio()).await?,
        Transport::Http => service.serve(StreamableHttpService::new(...)).await?,
    }

Open Questions

  1. Authentication: Should we support API keys in this PR or separate? (Leaning separate - keep this focused on transport)
  2. TLS: Support HTTPS directly or assume reverse proxy handles it initially?
  3. Default port: 3000? 8080? Something else?

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions