next-devtools-mcp

v0.3.6
io.github.vercel/next-devtools-mcp Checked 1 hour ago Published 12 months ago

Next.js development tools MCP server with stdio transport

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

browser_eval

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: - Browser automation actually renders the page and executes JavaScript (curl only fetches HTML) - Detects runtime errors, hydration issues, and client-side problems that curl cannot catch - Verif…

ParameterTypeDescription
actionstringThe action to perform using browser automation
browserstring
buttonstring
doubleClickboolean
elementstring
endElementstring
endRefstring
errorsOnlyboolean
fieldsarray
filesarray
fullPageboolean
headlessboolean
modifiersarray
refstring
scriptstring
startElementstring
startRefstring
textstring
urlstring

enable_cache_components

Migrate Next.js applications to Cache Components mode and complete setup for Next.js 16. Use this tool when you need to: - Migrate to Cache Components mode - Migrate to cache components - Enable Cache Components - Set up Cache Components - Convert to Cache Components This tool handles ALL steps for migrating and enabling Cache Components: - Configuration: Updates cacheComponents flag (experimental in 16.0.0, stable in canary > 16), removes incompatible flags - Dev Server: Starts dev server (MCP is enabled by default in Next.js 16+) - Error Detection: Loads all routes via browser automation,…

ParameterTypeDescription
project_pathstring

init

⚠️ 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 fetches the latest Next.js documentation and establishes ABSOLUTE requirements for using the nextjs_docs tool for ALL Next.js-related queries. Key Points: - Fetches latest Next.js LLM documentation from nextjs.org - Establishes MANDATORY requirement to use nextjs_docs for ALL Next.js concepts - Instructs AI to forget any prior Next.js knowledge and always query docs - Document…

ParameterTypeDescription
project_pathstring

nextjs_docs

Search and retrieve Next.js official documentation. Three actions: 1) 'get' - Fetch full docs with a path (preferred after init). 2) 'search' - Find docs by keyword (redirects to use llms.txt index if init was called). 3) 'force-search' - Bypass init check and force API search (escape hatch only). After calling init, prefer using 'get' directly with paths from the llms.txt index.

ParameterTypeDescription
actionstringAction to perform: 'search' to find docs by keyword, 'get' to fetch full markdown content, 'force-search' to bypass init check and force search
anchorstring
pathstring
querystring
routerTypestringFor 'search' and 'force-search' actions only. Filter by Next.js router type: 'app' (App Router only), 'pages' (Pages Router only), or 'all' (both)

nextjs_index

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…

ParameterTypeDescription
portstring

nextjs_call

Call a specific MCP tool on a running Next.js development server. REQUIREMENTS: - Port number of the target Next.js dev server - Tool name to execute - Optional arguments object (if the tool requires parameters) 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: - The 'args' parameter MUST be an object (e.g., {key: "value"}), NOT a string - If a tool doesn't require arguments, OMIT the 'args' parameter…

ParameterTypeDescription
argsstring
portstringPort number of the Next.js dev server (required).
toolNamestringName of the Next.js MCP tool to call (required). Use 'nextjs_index' first to discover available tool names.

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: - Next.js version upgrade to 16 - Async API changes (params, searchParams, cookies, headers) - Config migration (next.config changes) - Image defaults and optimization - Parallel routes and dynamic segments - Deprecated API removals - React 19 compatibility The codemod requires: - Clean git working directory (commit or stash change…

ParameterTypeDescription
project_pathstring