mcpField
E
Example Next.js MCP Server

Example Next.js MCP Server

Local
opengov-mcp-server-vercel-nextjs.vercel.appCloud & Infra0Updated 77w ago

About Example Next.js MCP Server

A Next.js sample that uses @vercel/mcp-adapter to add MCP routes to a project. It is intended for developers customizing tools, prompts, and resources with the MCP TypeScript SDK.

Key features

  1. 01MCP routes in Next.js
  2. 02Custom tools, prompts, and resources
  3. 03SSE transport with Redis configuration
  4. 04Sample client script

Use cases

  1. 01Adding an MCP server to a Next.js app
  2. 02Trying server invocations with the sample client

MCP support

Provides MCP routes in a Next.js project, where developers define tools, prompts, and resources. It uses @vercel/mcp-adapter and supports SSE transport.

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.