← Back to all tweets

Tweet by @rauchg

View original on X

We’re simplifying MCP deployment on Vercel. Good chance this becomes one of the most important frontends on the internet in coming years.

Vercel
Vercel
@vercel

MCP allows you to build integrations for AI models. Deploy your Model Context Protocol (MCP) server on Vercel and connect to it from clients like Claude, Cursor, and more. Learn more and get started with our updated template. vercel.com/changelog/mcp-…

Code snippet: // app/api/[transport]/route.ts

import { createMcpHandler } from '@vercel/mcp-adapter';

const handler = createMcpHandler(server => {
  server.tool(
    'roll_dice',
    'Rolls an N-sided die',
    { 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}!` }] };
    }
  );
});

export { handler as GET, handler as POST, handler as DELETE };
759
Reply