Deploy MCP servers to Vercel.
npm install @modelfetch/vercelimport handle from "@modelfetch/vercel";
import server from "./server"; // Import your McpServer
const handler = handle(server);
// Export as Next.js App Router API route handlers
export const GET = handler;
export const POST = handler;
export const DELETE = handler;import handle from "@modelfetch/vercel";
import server from "./server"; // Import your McpServer
const handler = handle(server);
// Export as Next.js App Router API route handlers
export const GET = handler;
export const POST = handler;
export const DELETE = handler;
// Use Node.js or Fluid Compute (default)
export const runtime = "nodejs";import handle from "@modelfetch/vercel";
import server from "./server"; // Import your McpServer
const handler = handle(server);
// Export as Next.js App Router API route handlers
export const GET = handler;
export const POST = handler;
export const DELETE = handler;
// Use Edge runtime
export const runtime = "edge";Creates a Vercel-compatible Next.js App Router API route handler from an McpServer instance
- server: Required
McpServerinstance from@modelcontextprotocol/sdk