mcpField
E
Example Next.js MCP Server

Example Next.js MCP Server

Local
github.com/rajatsandeepsenDeveloper Tools1Updated 74w ago

About Example Next.js MCP Server

Example Next.js MCP Server is a sample app showing how to add MCP routes to a Next.js project with `@vercel/mcp-adapter`. It includes a sample client for testing invocations.

Key features

  1. 01MCP routes in Next.js
  2. 02Configurable tools, prompts, and resources
  3. 03SSE transport guidance
  4. 04Sample invocation client

Use cases

  1. 01Add an MCP server to a Next.js project
  2. 02Define MCP tools, prompts, and resources
  3. 03Test server invocations with the sample client

MCP support

The sample uses `@vercel/mcp-adapter` to provide an MCP server on Next.js routes, with SSE transport guidance for Vercel deployments.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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.

Notes for running on Vercel

  • To use the SSE transport, requires a Redis attached to the project under process.env.REDIS_URL
  • Make sure you have Fluid compute enabled for efficient execution
  • After enabling Fluid compute, open app/route.ts and adjust maxDuration to 800 if you using a Vercel Pro or Enterprise account
  • Deploy the Next.js MCP template

Sample Client

script/test-client.mjs contains a sample client to try invocations.

node scripts/test-client.mjs https://mcp-for-next-js.vercel.app

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.