Skip to content

Migrate /api/mcp to the SDK's webStandardStreamableHttp; unify the three server transports #92

Description

@adamstankiewicz

The deployed MCP endpoint hand-rolls its JSON-RPC. Both documented reasons have expired:

  1. @modelcontextprotocol/sdk@1.30 ships server/webStandardStreamableHttp — a Streamable HTTP transport speaking Web Request/Response, which is what a Next route handler has.
  2. MCP Apps' _meta.ui flows through server.registerTool fine — mcp/app.mjs already does it.

Shape: one shared tool-definition module (definitions + handlers) consumed by three thin transports — the route (webStandardStreamableHttp, stateless mode), stdio (mcp/server.mjs), local HTTP (mcp/server-http.mjs). Deletes ~200 lines of hand-written JSON-RPC and makes tool drift between the deployed and local servers impossible (today app.mjs already lags: 14 kinds described, no find_activity/build_pathway).

Sequencing: strictly after #75 and #76 merge — both edit api/mcp/route.ts, and this migration rewrites it. Wire behavior is unchanged (same protocol, same tools), so no contract implications; verify with the Claude Desktop QA plan's Pass 1–2 after migration.

🤖 Generated with Claude Code

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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions