Skip to content

Add hosted HTTP MCP service as separate package #147

Closed

Description

@willwashburn

Summary

Add a separate hosted MCP service/package for remote Streamable HTTP MCP, e.g. deployed at mcp.relaycast.dev, instead of mounting MCP inside @relaycast/engine.

Proposed Shape

  • Create a package such as @relaycast/mcp-hosted.
  • Own the MCP Streamable HTTP transport/session handling in that package/service.
  • Use @relaycast/sdk underneath to call the Relaycast API, matching the local @relaycast/mcp behavior.
  • Deploy it as its own service/subdomain, e.g. https://mcp.relaycast.dev/mcp.

Why

The engine should stay focused on Relaycast API/realtime behavior. Not every engine consumer wants or needs MCP, and importing MCP transport/server code from the engine bloats Worker bundles and couples unrelated deployment surfaces.

A hosted MCP layer is still useful for Smithery-style remote MCP, marketplace distribution, OAuth/setup flows, analytics, and clientless install, but it should be composed outside the core engine.

Tradeoffs

This introduces an extra hop for tool calls:

MCP client -> hosted MCP service -> Relaycast API

That is acceptable initially because it keeps boundaries clean and dogfoods the public SDK/API. Later optimizations can use an internal Relaycast base URL or colocated deployment without moving MCP into the engine.

Related

Follow-up from #144.

Activity

  1. willwashburn commented on Jul 13, 2026

    @willwashburn
    MemberAuthor

    Closing as implemented — validated against current main (v6.0.5, f7e86a3). The two load-bearing asks are satisfied, with different packaging than proposed:

    • Hosted Streamable HTTP MCP exists: packages/mcp/src/transports.ts provides createHttpHandler(...), creating a StreamableHTTPServerTransport per session with a SessionLifecycle hook for multi-machine session registries (landed in v5.0.8, 0e1dadb). Deployed at https://cast.agentrelay.com/mcp and published to Smithery via deploy.yml.
    • SDK underneath: the MCP layer talks to the engine exclusively through @relaycast/sdk (createInternalRelayCast), never engine internals — the dogfooding boundary this issue asked for.
    • Engine stays clean: zero MCP/Streamable code in packages/engine — MCP was kept out of the engine as argued here.

    Deviations from the exact proposal: the HTTP transport was folded into @relaycast/mcp alongside stdio rather than a separate @relaycast/mcp-hosted package, and it's served from the engine gateway host (cast.agentrelay.com/mcp) rather than a dedicated mcp.relaycast.dev subdomain. Extracting it into its own package/domain remains possible later since the transport already sits behind the SDK boundary, but the architectural goal here is met.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions