Next.js DevTools MCP
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NEXT_TELEMETRY_DISABLED | No | Set to '1' to disable anonymous usage telemetry collection. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| browser_evalA | Automate and test web applications using Playwright browser automation. This tool connects to playwright-mcp server and provides access to all Playwright capabilities. CRITICAL FOR PAGE VERIFICATION: When verifying pages in Next.js projects (especially during upgrades or testing), you MUST use browser automation to load pages in a real browser instead of curl or simple HTTP requests. This is because:
IMPORTANT FOR NEXT.JS PROJECTS: If working with a Next.js application, PRIORITIZE using the 'nextjs_index' and 'nextjs_call' tools instead of browser console log forwarding. Next.js has built-in MCP integration that provides superior error reporting, build diagnostics, and runtime information directly from the Next.js dev server. Only use browser_eval's console_messages action as a fallback when these Next.js tools are not available or when you specifically need to test client-side browser behavior that Next.js runtime cannot capture. Available actions:
Note: The playwright-mcp server will be automatically installed if not present. |
| enable_cache_componentsA | Migrate Next.js applications to Cache Components mode and complete setup for Next.js 16. Use this tool when you need to:
This tool handles ALL steps for migrating and enabling Cache Components:
Key Features:
Requires:
This tool embeds complete knowledge base for:
|
| initA | ⚠️ CALL THIS FIRST - Initialize Next.js DevTools MCP context and establish MANDATORY documentation requirements. IMPORTANT: This tool MUST be called at the START of every Next.js development session. This tool:
Use this tool at the beginning of a Next.js session to:
|
| nextjs_docsA | Fetch Next.js official documentation by path. IMPORTANT: You MUST first read the Workflow:
Example: nextjs_docs({ path: "/docs/app/api-reference/functions/refresh" }) |
| nextjs_indexA | Discover all running Next.js development servers and list their available MCP tools. WHEN TO USE THIS TOOL - Use proactively in these scenarios:
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+ 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:
After calling this tool, use 'nextjs_call' to execute specific tools. [IMPORTANT] If auto-discovery returns no servers:
If the MCP endpoint is not available:
|
| nextjs_callA | Call a specific MCP tool on a running Next.js development server. REQUIREMENTS:
Use 'nextjs_index' first to discover available servers, tools, and their input schemas. If 'nextjs_index' auto-discovery fails, ask the user for the port and call 'nextjs_index' again with the 'port' parameter. IMPORTANT: When calling tools:
Common Next.js MCP tools include:
Example usage:
|
| upgrade_nextjs_16A | Guide through upgrading Next.js to version 16. CRITICAL: Runs the official codemod FIRST (requires clean git state) for automatic upgrades and fixes, then handles remaining issues manually. The codemod upgrades Next.js, React, and React DOM automatically. Covers:
The codemod requires:
After codemod runs, provides manual guidance for any remaining issues not covered by the codemod. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| upgrade-nextjs-16 | Guide through upgrading Next.js to version 16. CRITICAL: Runs the official codemod FIRST (requires clean git state) for automatic upgrades and fixes, then handles remaining issues manually. The codemod upgrades Next.js, React, and React DOM automatically. Covers async API changes, config moves, image defaults, parallel routes, and deprecations. |
| enable-cache-components | Complete Cache Components setup for Next.js 16. Handles ALL steps: updates experimental.cacheComponents flag, removes incompatible flags, migrates Route Segment Config, starts dev server with MCP, detects all errors via chrome_devtools + get_errors, automatically fixes all issues by adding Suspense boundaries, 'use cache' directives, generateStaticParams, cacheLife profiles, cache tags, and validates everything with zero errors. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| cache-components-overview | Critical errors AI agents make, quick reference for Cache Components |
| cache-components-core-mechanics | Fundamental paradigm shift and cacheComponents behavior |
| cache-components-public-caches | Public cache mechanics using 'use cache' |
| cache-components-private-caches | Private cache mechanics using 'use cache: private' |
| cache-components-runtime-prefetching | Prefetch configuration and stale time rules |
| cache-components-request-apis | Async params, searchParams, cookies(), headers() patterns |
| cache-components-cache-invalidation | updateTag(), revalidateTag() patterns and cache invalidation strategies |
| cache-components-advanced-patterns | cacheLife(), cacheTag(), draft mode and advanced caching strategies |
| cache-components-build-behavior | What gets prerendered, static shells, and build-time behavior |
| cache-components-error-patterns | Common errors and solutions for Cache Components |
| cache-components-test-patterns | Real test-driven patterns from 125+ fixtures |
| cache-components-reference | Mental models, API reference, and checklists for Cache Components |
| cache-components-route-handlers | Using 'use cache' directive in Route Handlers (API Routes) - must extract to helper function |
| nextjs-fundamentals-use-client | Learn when and why to use 'use client' in Server Components |
| nextjs16-migration-beta-to-stable | Complete guide for migrating from Next.js 16 beta to stable release |
| nextjs16-migration-examples | Real-world examples of migrating to Next.js 16 |
| Next.js Documentation Index (llms.txt) | Complete Next.js documentation index from nextjs.org/docs/llms.txt. You MUST read this resource first to find the correct path, then call nextjs_docs with that path. |
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