enable_cache_components
Migrates Next.js applications to Cache Components mode. Automatically configures settings, starts dev server, detects errors via browser automation, adds Suspense boundaries and 'use cache' directives, and verifies zero errors.
Instructions
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, collects errors using Next.js MCP
Automated Fixing: Adds Suspense boundaries, "use cache" directives, generateStaticParams, cacheLife profiles, cache tags
Verification: Validates all routes work with zero errors
Key Features:
One-time dev server start (no restarts needed)
Automated error detection using Next.js MCP tools
Browser-based testing with browser automation
Fast Refresh applies fixes instantly
Comprehensive fix strategies for all error types
Support for "use cache", "use cache: private", Suspense boundaries
Cache invalidation with cacheTag() and cacheLife() configuration
Requires:
Next.js 16.0.0+ (stable or canary only - beta versions are NOT supported)
Clean working directory preferred
Browser automation installed (auto-installed if needed)
This tool embeds complete knowledge base for:
Cache Components mechanics
Error patterns and solutions
Caching strategies (static vs dynamic)
Advanced patterns (cacheLife, cacheTag, draft mode)
Build behavior and prefetching
Test-driven patterns from 125+ fixtures
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No |