Next.js

v1.0.0Coding Agentsstable

Enables AI assistants to automate Next.js development including project scaffolding, React component generation, API route creation, and full-stack application workflows with TypeScript and Tailwind CSS support.

next-js-mcp-servermcpai-integration
Share:
98
Stars
0
Downloads
0
Weekly
0/5

What is Next.js?

Next.js is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai assistants to automate next.js development including project scaffolding, react component generation, api route creation, and full-stack application workflows with typescript and tailwind c...

Enables AI assistants to automate Next.js development including project scaffolding, React component generation, API route creation, and full-stack application workflows with TypeScript and Tailwind CSS support.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables AI assistants to automate Next.js development includ

Use Cases

Automate Next.js development with scaffolding, component generation, and API route creation. Build full-stack apps with TypeScript and Tailwind CSS via AI.
vertile-ai

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMar 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx next-js-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Next.js

The Next.js MCP Server is a developer tool that analyzes Next.js App Router projects and exposes their API route structure to AI assistants. Its primary tool, get-routers-info, scans the app directory, extracts every route file, and returns a structured map of HTTP methods, paths, request parameters, status codes, and request/response schemas — information that AI assistants can then use to generate accurate API clients, write tests, or scaffold new routes without guessing at the shape of your API.

Prerequisites

  • Node.js 18 or later
  • A Next.js project using the App Router (not Pages Router)
  • The MCP server must run on the same machine as your Next.js project (filesystem access required)
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Install the package

Install next-mcp-server as a dependency in your Next.js project, or globally. The server needs filesystem access to your app directory.

npm install next-mcp-server
2

Build the server

If running from source or after a local install, build the TypeScript project to produce the runnable dist/index.js.

npm run build
3

Configure your MCP client

Add the server to your MCP client configuration. The server runs as a local process and needs to be pointed at your Next.js project root via the working directory or arguments.

{
  "mcpServers": {
    "next.js": {
      "command": "node",
      "args": ["node_modules/next-mcp-server/dist/index.js"]
    }
  }
}
4

Alternative: run via Docker with SSE transport

For Cursor users, build and run the Docker image, then configure Cursor to connect to the SSE endpoint. This keeps the server isolated from your project's node_modules.

docker build -t mcp/next -f Dockerfile .
docker run -p 4857:4857 mcp/next
5

Verify the route analysis tool

Ask your AI assistant to invoke get-routers-info. It will scan your app directory and return a JSON array describing every API route, its HTTP methods, parameters, and status codes.

Next.js Examples

Client configuration

Claude Desktop configuration running next-mcp-server from local node_modules in a Next.js project.

{
  "mcpServers": {
    "next.js": {
      "command": "node",
      "args": ["/path/to/your/nextjs-app/node_modules/next-mcp-server/dist/index.js"]
    }
  }
}

Prompts to try

Prompts that use the route analysis output to generate tests, clients, and documentation.

- "Analyze all API routes in this Next.js project and give me a summary"
- "Generate a TypeScript API client for all the routes in my app directory"
- "Write Jest tests for the POST /api/users route"
- "Which routes accept a request body and what schema do they expect?"
- "List all routes that return a 404 status code"

Troubleshooting Next.js

get-routers-info returns empty results or cannot find routes

This tool only supports Next.js App Router projects. Ensure your routes are in an 'app' directory (not 'pages'). The server process must run with its working directory set to the Next.js project root so it can locate the app folder.

Cannot connect via SSE/Docker in Cursor

Confirm the Docker container is running and port 4857 is exposed. The Cursor mcp.json should use 'url': 'http://localhost:4857/sse'. The port can vary based on the .env settings in the project — check the server's .env file for the configured port.

Module not found error when running node dist/index.js

Run 'npm run build' first to compile TypeScript to dist/. If installing from node_modules, the dist folder should already be included in the published package — verify with 'ls node_modules/next-mcp-server/dist/'.

Frequently Asked Questions about Next.js

What is Next.js?

Next.js is a Model Context Protocol (MCP) server that enables ai assistants to automate next.js development including project scaffolding, react component generation, api route creation, and full-stack application workflows with typescript and tailwind css support. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Next.js?

Follow the installation instructions on the Next.js GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Next.js?

Next.js works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Next.js free to use?

Yes, Next.js is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "next-js-mcp-server": { "command": "npx", "args": ["-y", "next-js-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Next.js?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides