vercel/mcp-handler
Easily spin up an MCP Server on Next.js, Nuxt, Svelte, and more
Overview
vercel/mcp-handler is a TypeScript MCP server. Easily spin up an MCP Server on Next.js, Nuxt, Svelte, and more
Ranked #47 out of 25632 indexed tools.
In the top 1% of all indexed tools.
Used by 228 other projects.
Has 24 contributors.
Ecosystem
TypeScript No license
Signal Breakdown
Stars 573
Freshness 23d ago
Issue Health 62%
Contributors 24
Dependents 228
Forks 76
Description Good
License None
How to Improve
Description low impact
License low impact
Matched Queries
From the README
# mcp-handler A Vercel adapter for the Model Context Protocol (MCP), enabling real-time communication between your applications and AI models. Supports Next.js and Nuxt. ## Installation ```bash npm install mcp-handler @modelcontextprotocol/[email protected] zod@^3 ``` > **Note**: Versions of `@modelcontextprotocol/sdk` prior to 1.25.1 have a security vulnerability. Use version 1.25.2 or later. ## Quick Start (Next.js) ```typescript // app/api/[transport]/route.ts import { createMcpHandler } from "mcp-handler"; import { z } from "zod"; const handler = createMcpHandler( (server) => { server.registerTool( "roll_dice", { title: "Roll Dice", description: "Roll a dice with a specified number of sides.", inputSchema: { sides: z.number().int().min(2), }, }, async ({ sides }) => { const value = 1 + Math.floor(Math.random() * sides); return { content: [{ type: "text", text: `🎲 You rolled a ${value}Read full README on GitHub →
Are you the maintainer? Claim this listing