Skip to main content
Glama

在 Vercel 上运行 MCP 服务器

使用方法

按照 MCP TypeScript SDK 文档 更新 api/server.ts 中的工具、提示词和资源。

此模板还有一个 Next.js 版本

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 账户)

  • 部署 MCP 模板

本地开发

  • 运行 vercel dev 进行本地开发

  • 或者,将系统集成到您选择的服务器框架中。

示例客户端

scripts/test-streamable-http-client.mjs 包含一个用于尝试调用的示例客户端。

node scripts/test-streamable-http-client.mjs https://mcp-on-vercel.vercel.app
-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prncsclo-create/hardcover-mcp-on-vercel-main'

If you have feedback or need assistance with the MCP directory API, please join our Discord server