MCP Handler
MCP server by vercel-labs Verified · npm:mcp-handler
mcp-handler is a framework-agnostic HTTP adapter for hosting Model Context Protocol servers in JavaScript and TypeScript apps. It turns an MCP server definition into a Web-standard request handler for frameworks such as Next.js, Nuxt, SvelteKit and Hono.
Install MCP Handler
Built from the published package, never by AI.
claude mcp add mcp-handler -- npx -y mcp-handlerRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"mcp-handler": {
"args": [
"-y",
"mcp-handler"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"mcp-handler": {
"args": [
"-y",
"mcp-handler"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"mcp-handler": {
"args": [
"-y",
"mcp-handler"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add mcp-handler -- npx -y mcp-handler{
"mcpServers": {
"mcp-handler": {
"args": [
"-y",
"mcp-handler"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add mcp-handler npx -y mcp-handlerGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the mcp-handler block.
About
mcp-handler is a framework-agnostic HTTP adapter for hosting Model Context Protocol servers in JavaScript and TypeScript applications. It turns an MCP server definition into a Web-standard request handler that can be mounted in Next.js, Nuxt/Nitro, SvelteKit, Hono, and other Fetch-compatible frameworks.
It is built on MCP SDK v2 and serves the 2026-07-28 specification natively. It falls back to stateless Streamable HTTP for 2025-era clients, so one handler supports both protocol generations. It also includes withMcpAuth for bearer token checks and OpenTelemetry spans for each MCP message. It is aimed at developers who build MCP servers in Node.js 20+ applications.
Written from the project's README and checked against it.
What you need
- Node.js 20+
- @modelcontextprotocol/server ^2.0.0
- zod ^4.2.0
- A framework with Web-standard Request and Response APIs
Try asking
- Help me mount an MCP server in my Next.js route handler
- Add a registerTool definition with a zod input schema to my MCP server
- Set up withMcpAuth to check bearer tokens on my MCP endpoint
Good to know
- Frameworks based on Node.js IncomingMessage, such as Express, need a Web Request adapter or official middleware
- HTTP+SSE transport from 2024-11-05 was removed in 2.x
- GET and DELETE session operations answer 405 because serving is stateless
- Requires mcp-handler 1.x for @modelcontextprotocol/sdk 1.x
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
What you can do with it
- Hosting an MCP server in Next.js
- Serving MCP over Streamable HTTP
- Adding bearer token checks to an MCP server
Alternatives to MCP Handler
All alternatives →Turns GitHub repositories into architecture diagrams, written explanations, Mermaid source and narrated explainer videos. Built for developers who want to understand a codebase, and for AI agents that need to read one.
Mocks, records, and chaos-tests HTTP(S) dependencies for development and testing. One port serves many protocols, including gRPC, WebSockets, and LLM chat APIs. Built for developers and testers who need stand-in services during tests.
Provides MCP server and CLI tools that let AI coding agents build, test and manage iOS and macOS projects with Xcode and simulators. It is aimed at developers working on Apple platform apps.
Creates editable draw.io diagrams in AI chat from Mermaid, PlantUML, CSV or draw.io XML. Built for people who want diagrams from text prompts that stay editable in draw.io.
Indexes your code, git history, tests and decisions on your machine so AI coding agents can query the index instead of re-reading files. Built for developers who want fewer files opened and clearer answers about change risk and code health.
Gives your AI assistant hosted codebase intelligence for repos indexed on repowise.dev. Use it to ask how code works, what a change may break, and which tests to run.
Compare with GitDiagram, mockserver or XcodeBuildMCP
MCP Handler: common questions
Does mcp-handler only work with Vercel?
No. The source says createMcpHandler returns a Web-standard request handler and is not tied to Vercel or any particular framework.
Which MCP specification versions does it support?
It serves the 2026-07-28 specification natively and uses stateless Streamable HTTP for 2025-era clients through the same handler.
Do I need Redis to run it?
No. The source says Redis is no longer needed or used in version 2.x.
How do I install MCP Handler?
In Claude Code run claude mcp add mcp-handler -- npx -y mcp-handler. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is MCP Handler the official server?
MCP Handler is published by npm:mcp-handler from its verified domain in the official MCP Registry.
Is MCP Handler free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is MCP Handler safe to use?
It scores 88 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to MCP Handler?
Similar MCP servers: GitDiagram, mockserver, XcodeBuildMCP, draw.io.
Does MCP Handler work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
