内容
# 在 Vercel 上运行 MCP Server
## 使用方法
根据 [MCP TypeScript SDK 文档](https://github.com/modelcontextprotocol/typescript-sdk/tree/main?tab=readme-ov-file#server) 更新 `api/server.ts`,添加你的工具、提示和资源。
## 在 Vercel 上运行的注意事项
- 需要在 `process.env.REDIS_URL` 下将 Redis 附加到项目中
- 确保你已启用 [Fluid compute](https://vercel.com/docs/functions/fluid-compute) 以实现高效执行
- 启用 Fluid compute 后,打开 `vercel.json`,如果你使用的是 Vercel Pro 或 Enterprise 账户,请将最大持续时间调整为 800
- [部署 MCP 模板](https://vercel.com/templates/other/model-context-protocol-mcp-with-vercel-functions)
## 示例客户端
`script/test-client.mjs` 包含一个示例客户端用于尝试调用。
```sh
node scripts/test-client.mjs https://mcp-on-vercel.vercel.app
```