Next.js MCP Server
使用 Next.js 的无头 MCP(来自注册表)
使用@vercel/mcp-adapter和可配置的 MCP 注册表
部署 URL
此应用程序部署于: https://nextjs-mcp-use.vercel.app
Related MCP server: Example Next.js MCP Server
特征
MCP 注册表:在单个 JSON 文件中配置多个 MCP 服务器
GitHub Actions :使用计划和手动工作流程测试和监控您的 API 端点
错误处理:优雅地处理超时和连接失败
环境变量:为每个 MCP 服务器配置环境变量
MCP 注册
MCP 注册表是一个 JSON 配置文件,用于存储所有可用 MCP 服务器的信息。每个服务器都可以启用或禁用,并拥有各自的环境变量。
注册表位于config/mcp-registry.json并具有以下结构:
{
"server-name": {
"url": "http://localhost:3002/sse",
"enabled": true,
"env": {
"API_KEY": "your-api-key"
}
},
"another-server": {
"url": "https://example.com/sse",
"enabled": false
}
}用法
此示例应用程序使用Vercel MCP 适配器,允许您在任何 Next.js 项目中的一组路由上放入 MCP 服务器。
按照MCP TypeScript SDK 文档,使用您的工具、提示和资源更新app/[transport]/route.ts 。
API 端点
聊天 API :
/api/chat- 流聊天端点完成 API :
/api/completions- 非流式聊天完成端点
测试 API
您可以使用提供的测试脚本测试 API 端点:
# Test the chat endpoint
npm run test:chat -- --message "Your message here"
# Test the completions endpoint
npm run test:completions -- --message "Your message here"
# Test with a custom URL
npm run test:chat -- --url http://localhost:3000/api/chat --message "Your message here"GitHub Actions
本项目包含用于测试和监控 API 端点的 GitHub Actions 工作流程。更多信息请参阅.github/workflows/README.md文件。
在 Vercel 上运行的注意事项
要使用 SSE 传输,需要在
process.env.REDIS_URL下将 Redis 附加到项目确保已启用Fluid Compute以实现高效执行
启用 Fluid compute 后,打开
app/route.ts并将maxDuration调整为 800(如果您使用 Vercel Pro 或 Enterprise 帐户)
示例客户端
scripts/test-client.mjs包含一个用于尝试调用的示例客户端。
node scripts/test-client.mjs https://nextjs-mcp-use.vercel.appTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The official MCP Server for the Mux API
- ArcjetOAuthcom.arcjet
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
MCP server for Vonage API documentation, code snippets, tutorials, and troubleshooting.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA drop-in MCP server implementation for Next.js projects using Vercel MCP Adapter, allowing developers to integrate model context protocol functionality with custom tools, prompts, and resources.-
- AlicenseNot gradedqualityDmaintenanceA sample implementation of a Model Context Protocol server using Next.js and the Vercel MCP Adapter, allowing developers to create AI assistants with custom tools and resources.MIT
- AlicenseNot gradedqualityDmaintenanceA sample implementation of Model Context Protocol server using Next.js and the Vercel MCP Adapter, allowing developers to create custom AI agent backends with tools, prompts, and resources.MIT
- AlicenseNot gradedqualityDmaintenanceA basic MCP server implementing a weather tool using Next.js and the Vercel MCP adapter.71ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/cameronking4/nextjs-mcp-use'
If you have feedback or need assistance with the MCP directory API, please join our Discord server