Skip to main content
Glama
vercel

Next.js DevTools MCP

Official
by vercel

nextjs_index

Discover running Next.js dev servers and list their MCP tools for runtime diagnostics, route inspection, and component analysis.

Instructions

Discover all running Next.js development servers and list their available MCP tools.

WHEN TO USE THIS TOOL - Use proactively in these scenarios:

  1. Before implementing ANY changes to the app: When asked to add, modify, or fix anything in the application:

    • "Add a loading state" → Check current component structure and routes first

    • "Fix the navigation" → Inspect existing routes and components

    • "Update the API endpoint" → Query current routes and data flows

    • "Add error handling" → Check runtime errors and component hierarchy

    • "Refactor the auth logic" → Inspect current auth implementation and routes

    • "Optimize performance" → Check runtime diagnostics and component tree Use this to understand where changes should be made and what currently exists.

  2. For diagnostic and investigation questions:

    • "What's happening?" / "What's going on?" / "Why isn't this working?"

    • "Check the errors" / "See what's wrong"

    • "What routes are available?" / "Show me the routes"

    • "Clear the cache" / "Reset everything"

    • Questions about build status, compilation errors, or runtime diagnostics

  3. For agentic codebase search: Use this as FIRST CHOICE for searching the currently running app. If not found, fallback to static codebase search tools.

KEY PRINCIPLE: If the request involves the running Next.js application (whether to investigate OR modify it), query the runtime FIRST to understand current state before proceeding.

REQUIREMENTS:

  • Next.js 16 or later (MCP support was added in v16)

  • If you're on Next.js 15 or earlier, use the 'upgrade-nextjs-16' MCP prompt to upgrade first

Next.js 16+ exposes an MCP (Model Context Protocol) endpoint at /_next/mcp automatically when the dev server starts. No configuration needed - MCP is enabled by default in Next.js 16 and later.

This tool discovers all running Next.js servers and returns:

  • Server port, PID, and URL

  • Complete list of available MCP tools for each server

  • Tool descriptions and input schemas

After calling this tool, use 'nextjs_call' to execute specific tools.

[IMPORTANT] If auto-discovery returns no servers:

  1. Ask the user which port their Next.js dev server is running on

  2. Call this tool again with the 'port' parameter set to the user-provided port

If the MCP endpoint is not available:

  1. Ensure you're running Next.js 16 or later (use the 'upgrade-nextjs-16' prompt to upgrade)

  2. Verify the dev server is running (npm run dev)

  3. Check that the dev server started successfully without errors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, but the description fully discloses behavior: it explains what the tool returns (server port, PID, URL, list of tools), dependencies (Next.js 16+), and error-handling steps (asking user for port if auto-discovery fails). No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is verbose with multiple sections and bullet points, but it is well-structured and front-loaded with the main purpose. Some repetition (e.g., requirements repeated in different forms) could be trimmed, but the structure aids readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (discovery with fallback) and no output schema, the description is complete: it covers return values, error cases, integration with sibling tools, and prerequisites. All necessary context for correct invocation is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has one optional parameter 'port' with no description (0% coverage). The description compensates by explaining that if auto-discovery fails, the tool should be called again with the 'port' parameter set to the user-provided port. This adds meaning beyond the schema, though the exact format is not detailed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Discover all running Next.js development servers and list their available MCP tools.' It uses a specific verb (Discover) and resource (servers and tools), and distinguishes from sibling tools like nextjs_call by explaining the follow-up action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit scenarios for when to use this tool: before implementing changes, for diagnostics, and for agentic search. It includes a 'WHEN TO USE' section and gives fallback instructions, making the usage context very clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/vercel/next-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server