Example Next.js MCP Server
Provides integration with Next.js, allowing the MCP server to be embedded within any Next.js project by updating route handlers.
Integrates with Redis for supporting Server-Sent Events (SSE) transport when deployed on Vercel.
Leverages TypeScript SDK for defining tools, prompts, and resources for the MCP server implementation.
Enables deployment on Vercel's platform with specific optimizations like Fluid compute for efficient execution and support for longer running functions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Example Next.js MCP Serverlist available tools for my Next.js project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Example Next.js MCP Server
Uses @vercel/mcp-adapter
Usage
This sample app uses the Vercel MCP Adapter that allows you to drop in an MCP server on a group of routes in any Next.js project.
Update app/[transport]/route.ts with your tools, prompts, and resources following the MCP TypeScript SDK documentation.
Related MCP server: Example Next.js MCP Server
Notes for running on Vercel
To use the SSE transport, requires a Redis attached to the project under
process.env.REDIS_URLMake sure you have Fluid compute enabled for efficient execution
After enabling Fluid compute, open
app/route.tsand adjustmaxDurationto 800 if you using a Vercel Pro or Enterprise account
Sample Client
script/test-client.mjs contains a sample client to try invocations.
node scripts/test-client.mjs https://mcp-for-next-js.vercel.appThis server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
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
- -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.-