Server facts
mcp-adapter
GitHub stars
711
Last commit
Nov 18, 2026
Runtime
node
License
—
Project
- Author
- vercel
- Repository
- github.com/vercel/mcp-adapter
- Category
- Cloud & DevOps
Tech
- Runtime
- node
- Transports
- streamable-http
- Remote access
- Yes
- Authentication
- Optional Bearer / OAuth via withMcpAuth (RFC 9728)
Activity
- GitHub stars
- 711
- Last commit
- Data as of
Overview
Rather than shipping pre-built third-party SaaS tools, Vercel Labs' `vercel/mcp-adapter` repository (distributed on npm as `mcp-handler`) is a framework-agnostic TypeScript library for turning custom MCP tool definitions into a deployable HTTP endpoint. Calling `createMcpHandler` produces a standard `(Request) => Promise<Response>` function that mounts cleanly inside Next.js 13+ Route Handlers, Nuxt 3+ / Nitro via `fromWebHandler`, SvelteKit server routes, Hono via `c.req.raw`, or any Fetch-compliant runtime on Node.js 20+. Because it ignores request pathnames, you can expose your server at `/api/mcp` or any route URL and connect Streamable HTTP clients directly (or stdio-only hosts like Claude Desktop via `mcp-remote`).
Version 2 targets `@modelcontextprotocol/server` ^2.0.0 and `zod` ^4.2.0, serving the stateless MCP 2026-07-28 specification (`server/discover`, per-request `_meta`) while falling back transparently to stateless 2025-era Streamable HTTP from the exact same handler—dropping legacy 2024-11-05 HTTP+SSE and removing Redis entirely. For OAuth protection, `withMcpAuth` validates bearer tokens with RFC 9728 `WWW-Authenticate` challenges and `protectedResourceHandler` publishes Protected Resource Metadata compatible with Client ID Metadata Documents (CIMD), while OpenTelemetry spans plug into Vercel MCP observability.
Install & configure
Requirements
- Node.js 20+ and a Fetch-compatible JS/TS framework (Next.js 13+, Nuxt 3+/Nitro, SvelteKit, or Hono)
- Peer dependencies for v2: `@modelcontextprotocol/server@^2` and `zod@^4` (use `mcp-handler@1` if staying on `@modelcontextprotocol/sdk` 1.x)
- Optional OAuth authorization server if enabling `withMcpAuth` and `protectedResourceHandler`
npm install mcp-handler@^2 @modelcontextprotocol/server@^2 zod@^4Install with `npm install mcp-handler@^2 @modelcontextprotocol/server@^2 zod@^4`, register tools with `server.registerTool(...)` inside `createMcpHandler`, and export `GET` and `POST` from your route handler (such as `app/api/mcp/route.ts`).
Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.
A supported configuration example is not available for this client and transport. Check the client documentation for its connection flow; do not substitute an undocumented JSON format.
Read the Claude Desktop setup guideConfig file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"remote-example": {
"url": "http://localhost:3000/api/mcp"
}
}
}Config file · Workspace: .vscode/mcp.json
For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.
{
"servers": {
"remote-example": {
"type": "http",
"url": "http://localhost:3000/api/mcp"
}
}
}Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"remote-example": {
"serverUrl": "http://localhost:3000/api/mcp"
}
}
}Config file · Project scope: .mcp.json at the repository root
The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"remote-example": {
"type": "http",
"url": "http://localhost:3000/api/mcp"
}
}
}Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Use cases
- Add a stateless Streamable HTTP MCP API route to an existing Next.js, Nuxt, SvelteKit, or Hono application using standard `Request`/`Response` handlers.
- Secure a remote SaaS MCP server with RFC 9728 Protected Resource Metadata and bearer token checks via `withMcpAuth` and `protectedResourceHandler`.
- Support both MCP 2026-07-28 and 2025-era Streamable HTTP clients from a single serverless route without managing session stores or Redis.
- Emit per-message OpenTelemetry spans for MCP traffic observability and experiment with in-page WebMCP bridging or MCP webhook events.
Strengths
- Framework-agnostic Fetch `(Request) => Promise<Response>` design works across Next.js, Nuxt/Nitro, SvelteKit, Hono, and non-Vercel hosts.
- Handles MCP 2026-07-28 and 2025-era Streamable HTTP simultaneously in stateless mode without requiring Redis.
- Includes first-class RFC 9728 OAuth resource-server helpers (`withMcpAuth`, `protectedResourceHandler`) and built-in OpenTelemetry tracing.
- Full TypeScript definitions under an Apache-2.0 license.
Limitations
- It is a developer SDK/adapter library for building MCP servers rather than a turnkey server with pre-configured external tools.
- Version 2 removes legacy HTTP+SSE (2024-11-05) support and breaks 1.x APIs (`server.tool` becomes `registerTool`, and `zod@^4` + SDK v2 are mandatory).
- Node `IncomingMessage`/`ServerResponse` frameworks like Express need an extra Web Request adapter rather than working natively.
mcp-adapter setup notes
- mcp-adapter's example uses http, while its catalog transports are streamable-http; use the example's connection type.
- mcp-adapter has no recorded license; confirm reuse terms in its repository.