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.

523 stars

Best use case

next-devtools-guide is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using next-devtools-guide should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/next-devtools-guide/SKILL.md --create-dirs "https://raw.githubusercontent.com/FradSer/dotclaude/main/next-devtools/skills/next-devtools-guide/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/next-devtools-guide/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How next-devtools-guide Compares

Feature / Agentnext-devtools-guideStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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 reference
- `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 strategies
- `cache-components://advanced-patterns` - cacheLife(), cacheTag(), draft mode
- `cache-components://build-behavior` - Prerendering, static shells, build-time behavior
- `cache-components://error-patterns` - Common errors and solutions
- `cache-components://test-patterns` - Real test-driven patterns from 125+ fixtures
- `cache-components://reference` - Mental models, API reference, checklists
- `cache-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 Components
- `nextjs16://migration/beta-to-stable` - Complete guide for migrating from Next.js 16 beta to stable
- `nextjs16://migration/examples` - Real-world examples of migrating to Next.js 16
- `nextjs-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):**

1. Start the dev server: `npm run dev` (or `pnpm dev`)
2. Call `init` to initialize MCP context
3. Call `nextjs_index` to discover the running server and available tools
4. Call `nextjs_call` with the desired `toolName` to 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-mcp` is configured in `.mcp.json`
- Start or restart the dev server (`npm run dev`)
- If `nextjs_index` auto-discovery fails, ask the user which port their dev server is running on and pass it as the `port` parameter

**"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 `init` at session start before using other tools
- Start the dev server before using `nextjs_index` or `nextjs_call`
- Prefer `nextjs_index`/`nextjs_call` over `browser_eval` for error detection and diagnostics
- Use `browser_eval` only for tasks requiring actual page rendering or JavaScript execution
- Read `nextjs-docs://llms-index` resource first before calling `nextjs_docs`

Related Skills

update-readme

523
from FradSer/dotclaude

Updates README.md and README.zh-CN.md to reflect the project's current state. Use this skill whenever the user asks to "update the README", "sync the docs", "update documentation", "reflect latest changes in README", or wants both the English and Chinese READMEs to match the current project. Always triggers when the user mentions updating or regenerating README files, especially for bilingual (EN/ZH) projects.

swiftui-review

523
from FradSer/dotclaude

Reviews SwiftUI code for best practices on modern APIs, maintainability, and performance. This skill should be used when the user asks to review SwiftUI code, check for deprecated iOS/macOS APIs, validate data flow patterns, or audit accessibility compliance in Swift projects.

writing-plans

523
from FradSer/dotclaude

Creates executable implementation plans that break down designs into detailed tasks. This skill should be used when the user has completed a brainstorming design and asks to "write an implementation plan" or "create step-by-step tasks" for execution.

systematic-debugging

523
from FradSer/dotclaude

Provides a systematic debugging methodology with a 4-phase root cause analysis process. This skill should be used when the user reports a bug, error, test failure, or unexpected behavior, ensuring thorough investigation precedes any code changes.

need-vet

523
from FradSer/dotclaude

This skill should be used when the user invokes /need-vet to enable work verification for the current task. Claude must verify completion and append the verified tag before the session can end.

executing-plans

523
from FradSer/dotclaude

Executes written implementation plans efficiently using agent teams or subagents. This skill should be used when the user has a completed plan.md, asks to "execute the plan", or is ready to run batches of independent tasks in parallel following BDD principles.

build-like-iphone-team

523
from FradSer/dotclaude

Applies Apple's Project Purple design philosophy for radical innovation. This skill should be used when the user wants to challenge industry conventions, approach open-ended problems requiring disruptive thinking, or when standard brainstorming needs a breakthrough approach.

brainstorming

523
from FradSer/dotclaude

Structures collaborative dialogue to turn rough ideas into implementation-ready designs. This skill should be used when the user has a new idea, feature request, ambiguous requirement, or asks to "brainstorm a solution" before implementation begins.

behavior-driven-development

523
from FradSer/dotclaude

Applies behavior-driven development principles including Gherkin scenarios and test-driven development. This skill should be used when the user asks to implement features, fix bugs, or when writing executable specifications and tests before writing production code.

agent-team-driven-development

523
from FradSer/dotclaude

Provides guidance on coordinating multiple specialized teammates working in parallel. This skill should be used when the user needs to execute complex implementation plans, resolve cross-cutting concerns, or coordinate independent work streams requiring communication.

shadcn

523
from FradSer/dotclaude

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".

refactor

523
from FradSer/dotclaude

Executes automated refactoring for specific files, directories, or semantic queries. This skill should be used when the user asks to refactor specific files or directories, simplify recently changed code, clean up dead code in a limited scope, or invokes "/refactor".