MCP on Vercel
在 Vercel 上运行 MCP 服务器
使用方法
按照 MCP TypeScript SDK 文档 更新 api/server.ts 中的工具、提示词和资源。
Related MCP server: Next.js MCP Server Template
MCP 客户端集成
将此服务器添加到 MCP 客户端应用程序时,请使用您的部署 URL 后跟 /mcp:
https://your-deployment-url.vercel.app/mcp示例工具
该模板包含两个示例工具,帮助您快速上手:
roll_dice- 掷一个 N 面骰子(最少 2 面)get_weather- 使用纬度、经度和城市名称获取某个地点的当前天气数据(通过 API)
这些工具演示了基本功能和 API 集成模式。请用您自己的工具替换它们。
在 Vercel 上运行的注意事项
确保已启用 Fluid compute 以实现高效执行
启用 Fluid compute 后,打开
vercel.json并将最大持续时间调整为 800(如果您使用的是 Vercel Pro 或 Enterprise 账户)
本地开发
运行
vercel dev进行本地开发或者,将系统集成到您选择的服务器框架中。
示例客户端
scripts/test-streamable-http-client.mjs 包含一个用于尝试调用的示例客户端。
node scripts/test-streamable-http-client.mjs https://mcp-on-vercel.vercel.appThis server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA template for running Model Context Protocol servers on Vercel with Redis support, allowing developers to deploy their custom tools, prompts, and resources using the MCP TypeScript SDK.-
- -licenseNot gradedqualityNot gradedmaintenanceA template for building MCP servers in Next.js applications using the Vercel MCP Adapter. Provides a foundation for adding custom tools, prompts, and resources to any Next.js project with deployment support on Vercel.-
- AlicenseNot gradedqualityDmaintenanceA template for deploying MCP servers on Vercel with example tools for rolling dice and getting weather data. Provides a foundation for building custom MCP servers with tools, prompts, and resources that can be deployed to Vercel's serverless platform.MIT
- AlicenseNot gradedqualityDmaintenanceA template for deploying Model Context Protocol servers as Next.js routes using the mcp-handler adapter, enabling easy integration of MCP tools, prompts, and resources into any Next.js application.MIT