Agent skill
next-devtools-guide
Provides guidance on using the next-devtools MCP server. Use when working with Next.js projects that have the MCP server configured, when the user encounters connection issues, or when needing help with error detection, route inspection, Server Action tracing, or Cache Components migration.
Install this agent skill to your Project
npx add-skill https://github.com/FradSer/dotclaude/tree/main/next-devtools/skills/next-devtools-guide
SKILL.md
Next.js DevTools MCP
Requirements: Node.js v20.19+, npm or pnpm, Next.js 16+ for runtime diagnostics.
Total capabilities: 7 Tools + 2 Prompts + 17 Resources = 26 available features.
Tool naming: All tools follow mcp__plugin_next-devtools_next-devtools__<tool-name>. This file uses abbreviated names for brevity.
See references/tools-reference.md for the complete tools table and nextjs_call tool names.
Tools (7)
| Tool | Purpose |
|---|---|
init |
Initialize MCP context with documentation-first behavior |
nextjs_index |
Discover running Next.js dev servers and available MCP tools |
nextjs_call |
Call a specific MCP tool on a running Next.js dev server |
nextjs_docs |
Fetch Next.js official documentation by path |
browser_eval |
Playwright browser automation for testing |
enable_cache_components |
Migrate to Next.js 16 Cache Components mode |
upgrade_nextjs_16 |
Guide through upgrade to Next.js 16 |
Prompts (2)
| Prompt | Purpose |
|---|---|
upgrade-nextjs-16 |
Complete upgrade guide including codemod execution and manual fixes |
enable-cache-components |
Complete Cache Components setup with automated error fixing |
Resources (17)
Cache Components (13):
cache-components://overview- Critical errors AI agents make, quick referencecache-components://core-mechanics- Fundamental paradigm shift and cacheComponents behaviorcache-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 rulescache-components://request-apis- Async params, searchParams, cookies(), headers() patternscache-components://cache-invalidation- updateTag(), revalidateTag() patterns and strategiescache-components://advanced-patterns- cacheLife(), cacheTag(), draft modecache-components://build-behavior- Prerendering, static shells, build-time behaviorcache-components://error-patterns- Common errors and solutionscache-components://test-patterns- Real test-driven patterns from 125+ fixturescache-components://reference- Mental models, API reference, checklistscache-components://route-handlers- Using 'use cache' in Route Handlers (API Routes)
Other (4):
nextjs-fundamentals://use-client- Learn when and why to use 'use client' in Server Componentsnextjs16://migration/beta-to-stable- Complete guide for migrating from Next.js 16 beta to stablenextjs16://migration/examples- Real-world examples of migrating to Next.js 16nextjs-docs://llms-index- Complete Next.js documentation index
Session Initialization
Call init at the start of every session to establish documentation-first behavior and tool usage guidance.
Quick Start
Next.js 16+ (runtime diagnostics):
- Start the dev server:
npm run dev(orpnpm dev) - Call
initto initialize MCP context - Call
nextjs_indexto discover the running server and available tools - Call
nextjs_callwith the desiredtoolNameto execute tools on the dev server
All Next.js versions (automation and docs):
After init, use upgrade_nextjs_16, enable_cache_components, nextjs_docs, or browser_eval as needed.
Common Workflows
Before implementing changes: Call nextjs_index to understand current application state, then nextjs_call with the appropriate tool.
Error detection: Call nextjs_index, then nextjs_call with toolName="get_errors".
Route inspection: Call nextjs_index, then nextjs_call with toolName="get_routes".
Server Action tracing: Call nextjs_call with toolName="get_server_action_by_id" and appropriate args.
Documentation search: Read the nextjs-docs://llms-index MCP resource to get the correct path, then call nextjs_docs with that path.
Important: The args parameter for nextjs_call MUST be an object. Omit args entirely if the tool takes no arguments.
Troubleshooting
MCP server not connecting:
- Verify Next.js v16+
- Confirm
next-devtools-mcpis configured in.mcp.json - Start or restart the dev server (
npm run dev) - If
nextjs_indexauto-discovery fails, ask the user which port their dev server is running on and pass it as theportparameter
"No server info found": Dev server must be running. Use the upgrade_nextjs_16 tool if on Next.js 15 or earlier.
Module not found: Clear the npx cache and restart the MCP client.
Best Practices
- Call
initat session start before using other tools - Start the dev server before using
nextjs_indexornextjs_call - Prefer
nextjs_index/nextjs_calloverbrowser_evalfor error detection and diagnostics - Use
browser_evalonly for tasks requiring actual page rendering or JavaScript execution - Read
nextjs-docs://llms-indexresource first before callingnextjs_docs
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
optimize-plugin
This skill should be used when the user asks to "validate a plugin", "optimize plugin", "check plugin quality", "review plugin structure", or "run plugin optimizer".
plugin-best-practices
This skill should be used when the user asks to "validate plugin structure", "review manifest files", "check frontmatter compliance", "verify tool invocation patterns", "explain plugin component types", or needs Claude Code plugin architectural guidance.
init-config
Generates a CLAUDE.md file with AI-driven environment detection and advanced configuration options. This skill should be used when the user asks to "initialize config", "setup claude config", "create CLAUDE.md", or needs help configuring project instructions.
start-feature
Starts working on a new feature branch using git-flow. This skill should be used when the user asks to "start a feature", "create feature branch", "begin new feature", "git flow feature start", or wants to start a new feature.
finish-feature
Finalizes and merges a feature branch into develop using git-flow. This skill should be used when the user asks to "finish a feature", "merge feature branch", "complete feature", "git flow feature finish", or wants to finalize a feature branch.
finish-hotfix
Finalizes a hotfix and merges it into main and develop using git-flow. This skill should be used when the user asks to "finish a hotfix", "merge hotfix branch", "complete hotfix", "git flow hotfix finish", or wants to finalize a hotfix.
Didn't find tool you were looking for?