Next.js DevTools MCP: Your Development Server Just Got Smarter

The Next.js DevTools MCP connects Claude and Cursor to your running dev server. I use it every day.

Trevor I. Lasn Trevor I. Lasn
· 2 min read
Building 0xinsider, real-time Polymarket analytics for sports and esports.

The Next.js DevTools MCP solves a specific problem: coding assistants can read your files, but they can’t see if your app is actually running or what errors you’re getting.

Next.js 16+ includes a built-in MCP endpoint at /_next/mcp. The next-devtools-mcp package discovers this endpoint and exposes live build errors, runtime errors, TypeScript type errors, application routes, page metadata, Server Action definitions, dev server logs, and project configuration.

Installation

Claude Code:

Terminal window
claude mcp add next-devtools npx next-devtools-mcp@latest

OpenAI Codex:

Terminal window
codex mcp add next-devtools -- npx next-devtools-mcp@latest

Google Gemini:

Terminal window
gemini mcp add next-devtools npx next-devtools-mcp@latest

Other editors (.mcp.json in project root):

{
"mcpServers": {
"next-devtools": {
"command": "npx",
"args": ["-y", "next-devtools-mcp@latest"]
}
}
}

Restart your dev server. The package auto-discovers the /_next/mcp endpoint.

Live Error Access

Before:

Terminal window
Error: Cannot read property 'map' of undefined
at Page (app/posts/page.tsx:12)
# You copy/paste the error into Claude

After:

Terminal window
# Claude queries get_errors automatically and sees:
# - Full stack trace + error type
# - Your project structure (get_project_metadata)
# - The actual code in app/posts/page.tsx

Claude checks your project config, searches the docs, writes code, verifies no errors, tests it in the browser, and confirms it works.

The difference: Claude sees your running app instead of guessing from static files.

Available Tools

ToolWhat It Does
get_page_metadataReturns routes, components, and page structure
get_project_metadataExposes project configuration and dependencies
get_server_action_by_idQueries specific Server Actions
get_logsAccess to dev server logs
nextjs_docsSearches official Next.js docs for version-specific patterns
upgrade_nextjs_16Runs codemods for Next.js 16 upgrades
enable_cache_componentsConfigures Cache Components with pre-flight checks
browser_evalPlaywright integration for browser testing

Next.js 16+ gets full support (errors, state, logs). Next.js 15 and below get partial support (upgrades, docs, browser testing).


Trevor I. Lasn

Building 0xinsider, real-time Polymarket analytics for sports and esports.


Found this article helpful? You might enjoy my free newsletter. I share dev tips and insights to help you grow your coding skills and advance your tech career.


Related Articles

Check out these related articles that might be useful for you. They cover similar topics and provide additional insights.

Llm
6 min read

Building Custom MCP Servers with Next.js and mcp-handler

How to build a MCP server that works with Claude Code, Gemini CLI, Cursor, and more.

Jan 28, 2026
Read article
Llm
5 min read

Anthropic's Sequential Thinking MCP

Ever wished your AI agent would slow down and think things through? This MCP server does exactly that

Sep 7, 2025
Read article
Llm
3 min read

Chrome DevTools MCP: Let Your AI Agent Debug Your App

Give your AI agent access to your running application. They can see errors, inspect the network tab, check the DOM, and debug issues while you work.

Nov 10, 2025
Read article
Llm
4 min read

Context7 MCP: Stop LLM Hallucinations with Live Docs

Context7 MCP server pulls version-specific library docs into Claude Code, Cursor, and other AI editors. Setup guide and how it works.

Nov 1, 2025
Read article
Llm
5 min read

Claude Code Superpowers: How to Add Skills That Plan Before Coding

Superpowers is an MCP plugin for Claude Code that enforces planning, TDD, and debugging workflows. Setup guide with real examples.

Nov 4, 2025
Read article
Llm
7 min read

AI Agents Explained

What AI agents are, how the agent loop works, and why they're different from chatbots.

Jan 30, 2026
Read article
Llm
6 min read

Google Search Console MCP for Claude Code

Pull GSC data into Claude Code to find CTR problems, indexing bugs, and keyword gaps — then fix them in the same conversation.

Feb 15, 2026
Read article
Llm
5 min read

I added Agentic Resource Discovery to 0xinsider so agents can find it

ARD is a new proposal from Google, Microsoft and Hugging Face for how agents find tools. What's in it, what 0xinsider publishes, and what a registry returns.

Sep 23, 2026
Read article

This article was originally published on https://www.trevorlasn.com/blog/next-js-devtools-mcp. It was written by a human and polished using grammar tools for clarity.