next.js development server introspection via mcp protocol
Exposes Next.js development server state and metadata through the Model Context Protocol (MCP) using stdio transport, enabling Claude and other MCP clients to query active routes, middleware configuration, build status, and server-side rendering details without direct filesystem access. Implements MCP resource and tool schemas that map to Next.js internal APIs, allowing structured queries about the running development environment.
Unique: Bridges Next.js development server internals directly into MCP protocol, allowing AI agents to query live app state without parsing source code or making HTTP requests to the dev server — uses stdio transport for zero-configuration local integration
vs alternatives: Unlike generic Next.js API clients or REST-based dev server inspection, this MCP server provides structured, schema-validated access to Next.js metadata through a standardized protocol that Claude and other AI tools natively understand
route and page metadata extraction from next.js app directory
Scans the Next.js app directory structure and extracts metadata about all registered routes, including path patterns, dynamic segments, layouts, and page component locations. Implements directory traversal logic that understands Next.js file conventions (page.tsx, layout.tsx, route.ts) and maps them to runtime route definitions without requiring a full build or server restart.
Unique: Implements Next.js file convention parsing (page.tsx, layout.tsx, route.ts patterns) directly in the MCP server, enabling real-time route discovery without requiring a build step or accessing Next.js internal compiler state
vs alternatives: More accurate than regex-based route extraction because it understands Next.js file conventions; faster than building and inspecting the Next.js manifest because it reads the filesystem directly
middleware configuration and execution order inspection
Reads and parses the middleware.ts/middleware.js file from a Next.js project and exposes its configuration, matcher patterns, and execution order through MCP resources. Analyzes the middleware code structure to extract route matchers, conditional logic, and any custom headers or redirects defined, allowing AI agents to understand request processing pipelines without executing the middleware.
Unique: Parses Next.js middleware.ts as a static artifact and extracts matcher patterns and configuration without executing the middleware code, enabling safe inspection of request processing logic from within an AI agent context
vs alternatives: Safer and faster than running middleware in a test environment; more accurate than regex-based route matching because it understands Next.js matcher syntax natively
build status and compilation error reporting
Monitors the Next.js development server's build state and exposes compilation errors, warnings, and build progress through MCP resources. Queries the dev server's internal build status (via internal APIs or log parsing) and surfaces TypeScript errors, module resolution failures, and other build-time diagnostics in a structured format that AI agents can parse and act upon.
Unique: Exposes Next.js dev server build state through MCP, allowing AI agents to query compilation status and errors without parsing console output or making direct HTTP requests to the dev server
vs alternatives: More reliable than parsing console logs because it accesses structured build state; more timely than waiting for CI/CD feedback because it reports live dev server status
server-side rendering and static generation configuration inspection
Analyzes page and route component files to detect and expose rendering mode configuration (SSR, SSG, ISR, dynamic rendering) through static code analysis. Parses export statements for getServerSideProps, getStaticProps, getStaticPaths, and dynamic() calls, and identifies dynamic segments and searchParams usage to determine rendering behavior without executing the code.
Unique: Performs static code analysis on page components to infer rendering mode without executing the code, enabling AI agents to understand data fetching and rendering strategy for code generation and optimization
vs alternatives: More accurate than guessing based on file location because it reads actual export statements; faster than building and inspecting the Next.js manifest because it analyzes source code directly
environment variable and configuration schema exposure
Reads .env files, .env.local, and next.config.js from the Next.js project and exposes available environment variables and configuration options through MCP resources. Parses environment variable names and types (inferred from usage or explicit schema) and exposes Next.js configuration settings (image optimization, API routes, redirects, rewrites) in a structured format for AI agents to reference when generating code.
Unique: Exposes Next.js project configuration and environment variables through MCP, allowing AI agents to reference project-specific settings when generating code without requiring manual configuration input
vs alternatives: More reliable than hardcoding configuration assumptions because it reads actual project files; more complete than environment variable discovery alone because it also exposes next.config.js settings
file system aware code generation with path resolution
Provides MCP tools that enable AI agents to generate or modify Next.js files with automatic path resolution, import statement generation, and file location validation. Understands Next.js file conventions and directory structure to suggest appropriate file locations for new pages, components, API routes, and middleware, and validates that generated imports will resolve correctly within the project structure.
Unique: Integrates Next.js file convention understanding directly into MCP tools, enabling AI agents to generate files in correct locations and with proper import paths without manual path specification
vs alternatives: More accurate than generic file generation because it understands Next.js-specific conventions; more reliable than AI-generated paths because it validates against actual project structure
component and utility discovery with usage analysis
Scans the Next.js project for reusable components, utilities, and hooks, and exposes their signatures, prop types, and usage patterns through MCP resources. Performs static analysis on component files to extract TypeScript/JSDoc type information, identifies commonly-used utilities, and tracks which components are used where, enabling AI agents to reference existing code when generating new features.
Unique: Performs static analysis on Next.js components to extract type information and usage patterns, enabling AI agents to discover and reuse existing components without manual documentation or imports
vs alternatives: More accurate than searching for components by name because it analyzes actual type signatures; more complete than component documentation because it discovers components automatically