loading…
Search for a command to run...
loading…
A starter template for deploying Model Context Protocol (MCP) servers on Vercel using TypeScript and Vercel Functions. It includes example tools for rolling dic
A starter template for deploying Model Context Protocol (MCP) servers on Vercel using TypeScript and Vercel Functions. It includes example tools for rolling dice and checking weather to demonstrate tool integration patterns.
Update api/server.js with your tools, prompts, and resources following the MCP TypeScript SDK documentation.
There is also a Next.js version of this template
When adding this server to an MCP client application, use your deployment URL followed by /mcp (Streamable HTTP). The SSE transport is available at /sse:
https://your-deployment-url.vercel.app/mcp
This template registers an MCP Apps UI resource at ui://hello_app_panel and links it to the hello_world tool via _meta.ui.resourceUri. MCP hosts that support MCP Apps will render the panel inline and forward tool calls initiated from the UI.
The template includes one example tool to get you started:
hello_world - Returns a hello message with an allowlisted style input.vercel.json and adjust max duration to 800 if you using a Vercel Pro or Enterprise accountvercel dev for local developmentYou can list tools via the included clients:
node scripts/test-streamable-http-client.mjs http://localhost:3000
Or for SSE transport:
node scripts/test-client.mjs http://localhost:3000
To manually call the tool via Streamable HTTP, use a simple JSON-RPC request (replace the origin as needed):
curl -sS http://localhost:3000/mcp \\
-H 'content-type: application/json' \\
-d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"hello_world\",\"arguments\":{\"style\":\"friendly\"}}}'
scripts/test-client.mjs contains a sample client to try invocations.
node scripts/test-client.mjs https://mcp-on-vercel.vercel.app
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"vercel-mcp-server-template": {
"command": "npx",
"args": []
}
}
}