vercel-labs/mcp-handler

Easily spin up an MCP Server on Next.js, Nuxt, Svelte, and more

What it solves

mcp-handler is a framework-agnostic HTTP adapter that allows developers to host Model Context Protocol (MCP) servers in JavaScript and TypeScript applications. It removes the need to write framework-specific boilerplate when deploying MCP servers to modern web frameworks that use Web-standard Request and Response APIs.

How it works

The library provides a createMcpHandler function that converts an MCP server definition into a standard Web-standard (Request) => Promise<Response> handler. This handler can then be mounted directly into routes in frameworks like Next.js, Nuxt/Nitro, SvelteKit, and Hono. It natively supports the 2026-07-28 MCP specification (stateless) and provides a transparent fallback for 2025-era Streamable HTTP clients.

Who it’s for

Developers building MCP servers using JavaScript or TypeScript who want to deploy them on serverless or edge-compatible frameworks that support Fetch-compatible APIs.

Highlights

  • Framework Agnostic: Works with any framework that exposes Web-standard Request and Response APIs.
  • Dual-Protocol Support: Handles both the latest 2026-07-28 stateless protocol and 2025-era Streamable HTTP from a single handler.
  • Simplified Deployment: Eliminates the need for Redis or complex session management for stateless operations.
  • TypeScript Support: Includes full type definitions for a type-safe development experience.

Related

  • Project
  • Project
  • Project
  • Project