ADR 0002: Use Fetch-first Streamable HTTP transport

Context

TypeScript users need an HTTP adapter that works with Next.js route handlers and other runtimes that expose Web Standard Request and Response objects. The MCP SDK provides a Web Standard Streamable HTTP server transport. Implementing custom JSON-RPC parsing, session rules, or a legacy SSE abstraction would duplicate protocol-sensitive behavior.

Decision

The @theorvane/type-mcp/http subpath will expose a Fetch-style handler:

type McpHandler = (request: Request) => Promise<Response>;

It will delegate protocol/session behavior to the official MCP SDK's Web Standard Streamable HTTP transport. The adapter will support the HTTP methods required by that transport and return a valid method error for unsupported methods.

Consequences

Positive

Trade-offs

Rejected alternatives