mcp-server-nuxt
mcp-server-nuxt is a standalone MCP server that statically inspects a Nuxt project and exposes tools/resources for routing, Nitro, auto-imports, config/layers/modules, quality checks, search, and guarded scaffolding.
Explain concrete URLs: matched page, params, parents, layout, middleware order, data fetching, API handlers, and render mode.
Inspect routing and middleware: list/get routes, route metadata, middleware behavior, and route rules.
Explore Nitro/server code: list server routes/middleware/plugins, find API callers, analyze data fetching, and scaffold H3 handlers with optional Zod validation.
Discover components/composables/auto-imports/injections: list, inspect, find usages or unused items, read type info, and generate Vue SFCs/composables.
Analyze project/config: overview, health, dependencies, resolved config, runtime config, modules, layers, Nuxt 4 migration, type errors, and SSR safety.
Search source code and get targeted offline Nuxt documentation.
Read large cacheable context via resources: project overview, routes, config, modules, layers, auto-imports, and generated types.
Scaffold or update routes, APIs, components, composables, config values, and modules with dry-run defaults; real writes require explicit server write enablement and return diffs.
Provides tools and resources for inspecting and modifying Nuxt applications, exposing resolved routes, config, modules, layers, auto-imports, components, composables, Nitro server routes, and generated types.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-nuxt show me all resolved routes and which layers they come from"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Quick start
Add this to .cursor/mcp.json (Cursor), .mcp.json (Claude Code), or your client's MCP config:
{
"mcpServers": {
"nuxt": {
"command": "npx",
"args": ["-y", "mcp-server-nuxt@latest", "/absolute/path/to/your/nuxt/app"]
}
}
}Restart your client and ask something like:
What happens when someone opens /users/42?
Requirements: Node.js 18+, macOS or Linux. Write tools stay in dry-run mode until you enable writes.
Related MCP server: mcp-artisan
Why
A generic agent sees a Nuxt repo as a folder tree. It doesn't know that:
pages/users/[id].vueserves/users/:id, and which layout and middlewaredefinePageMetaaddscomponents/base/BaseButton.vueis usable as<BaseButton>with no importcomposables/useFoo.tsmakesuseFoo()available everywhereextends: ['../ui-kit']layers components, pages, and config over your appserver/api/hello.get.tsregistersGET /api/hello
So it guesses, and invents import paths, misnames components, and misreads layer precedence. mcp-server-nuxt reads Nuxt's own config loader and .nuxt/ output (with a source-level fallback) and hands the agent the real answers through 34 tools and 7 read-only resources.
It runs as a standalone CLI, so it works on a freshly cloned repo before anyone has installed dependencies or started npm run dev.
Highlight: explain_route
Most tools tell you which routes exist. explain_route tells you what actually happens for one real URL.
// input
{ "route": "/users/42" }
// output (abridged)
{
"matched": true,
"page": { "file": "pages/users/[id].vue", "pattern": "/users/:id", "params": { "id": "42" } },
"parents": [{ "file": "pages/users.vue", "pattern": "/users" }],
"layout": { "name": "default", "file": "layouts/default.vue" },
"middleware": [
{ "name": "logger", "type": "global", "file": "middleware/logger.global.ts" },
{ "name": "auth", "type": "named", "file": "middleware/auth.ts" }
],
"dataFetching": [
{ "composable": "useFetch", "keyOrUrl": "/api/hello", "line": 4, "file": "pages/users/[id].vue" }
],
"serverRoutes": [{ "url": "/api/hello", "file": "server/api/hello.get.ts", "method": "GET" }]
}Middleware comes back in run order (global first, then named), catch-all params come back as arrays, and an unmatched URL returns suggestions.
Tools
Tool | What it does |
| Resolve one URL: page, parents, layout, middleware order, data fetching, |
| Middleware type (global/named/inline), alphabetical global run order, routes it applies to, |
| Resolve a URL's Nitro render mode from |
| All routes: dynamic, optional, catch-all, nested |
| One route by pattern, e.g. |
|
|
| Scaffold a page under |
Tool | What it does |
| Endpoints, server middleware, and plugins with method and middleware chain |
| Find every caller of a server route ( |
| List |
| Generate an H3 handler with optional Zod body validation |
Tool | What it does |
| Components from |
| Find every file using a component/composable (imports, auto-imports, |
| Trace Nuxt plugin injections: where |
| Props, emits, and slots of one component |
| Generate a typed Vue SFC |
| User-defined and auto-imported composables |
| Scaffold a typed |
| Auto-import registry with source paths and signatures |
| Generated type info ( |
Tool | What it does |
| Nuxt version, layers, directories, and counts |
| Health check with dependency warnings and prepare hints |
| Check a Nuxt project against the official Nuxt 4 upgrade guide: version, |
| Resolved |
| Change a config value, keeping comments, and return a diff |
| Installed modules with version, source, and options |
| Add a module to |
| The full |
| Flatten |
Tool | What it does |
| Run |
| Flag missing or misplaced dependencies |
| Search the codebase with line numbers and context |
| Flag SSR hazards: browser globals at setup/module scope, non-deterministic values in templates and computed, shared composable state |
| Offline Nuxt guidance for routing, Nitro, modules, layers |
✏️ = write tool, dry-run by default. Full mapping: docs/SPEC_MATRIX.md.
Resources
Large, cacheable context is served as read-only resources so the agent doesn't re-scan files every turn.
URI | Content |
| Nuxt version, layers, directories, counts |
| Route map with files, params, middleware, layouts, children |
| Resolved |
| Modules with status, source, and options |
| Layer hierarchy with override order ( |
| Auto-imported symbols with source paths and signatures |
| Raw generated types |
auto-imports and types need .nuxt/ to exist (nuxi prepare or a build). Everything else falls back to reading source.
Write protection
add_route, scaffold_nitro_api, generate_component, generate_composable, update_config, and add_nuxt_module all work the same way:
They default to
dryRun: trueand return the planned file or diff without touching disk.A real write needs
dryRun: falseand a server started with writes enabled.Config edits only touch the affected lines and always return a diff.
{
"mcpServers": {
"nuxt": {
"command": "npx",
"args": ["-y", "mcp-server-nuxt@latest", "/absolute/path/to/your/nuxt/app"],
"env": { "MCP_NUXT_ALLOW_WRITES": "1" }
}
}
}Or on the command line: mcp-server-nuxt /absolute/path/to/app --allow-writes.
Client setup
The JSON in Quick start works for Cursor, Claude Code, Claude Desktop, and Windsurf. Always pass an absolute project path, since MCP clients often start servers with an undefined working directory.
Client | File |
Cursor |
|
Claude Code |
|
Claude Desktop (macOS) |
|
Windsurf | Cascade → MCP settings |
VS Code uses servers instead of mcpServers. In .vscode/mcp.json:
{
"servers": {
"nuxt": {
"command": "npx",
"args": ["-y", "mcp-server-nuxt@latest", "--project", "/absolute/path/to/your/nuxt/app"]
}
}
}npx -y mcp-server-nuxt@latest /absolute/path/to/app
pnpm dlx mcp-server-nuxt@latest /absolute/path/to/app
bunx mcp-server-nuxt@latest /absolute/path/to/app
npm install -g mcp-server-nuxt
mcp-server-nuxt --helpThe project path can be passed positionally or with --project. Omit it to use the current directory. The server speaks MCP over stdio; it is not a web service.
FAQ
How is this different from DevTools-style Nuxt MCP servers?
Those attach to a running dev server, so the agent sees nothing until npm run dev is up. mcp-server-nuxt is a standalone CLI that reads the project directly, so it works on a fresh clone, in CI, or anywhere the app isn't running.
Does it support Windows? Not officially yet. It's tested on macOS and Linux.
Contributing
Pull requests are welcome.
git clone https://github.com/rynx-cc/mcp-server-nuxt.git
cd mcp-server-nuxt
npm install
npm run typecheck && npm test && npm run buildUse Conventional Commits (
feat:,fix:,chore:).Add tests under
tests/for new tools and resources.Keep
@nuxt/kitoptional; every integration needs a fallback. Resolved config loads Kit from the target project'snode_modulesfirst (Kit 3 for Nuxt 3, Kit 4 for Nuxt 4), then this package's optional Kit 3, then the source parser. Kit errors are logged to stderr.Write tools default to dry-run and go through
WriteGuard.
License
Available Tools
34 toolsadd_nuxt_moduleA
Add a Nuxt module to the modules array in nuxt.config, optionally with options. Returns a diff; dry-run by default.
Inputs: name (required), dryRun, options.
add_routeA
Scaffold a new page route under the project pages directory (honoring srcDir) following Nuxt conventions. Supports static, dynamic (:id -> [id]), optional ([[id]]), optional catch-all ([[...slug]]), and catch-all ([...slug]) segments.
Inputs: path (required), dryRun, layout, middleware.
analyze_bundle_depsA
Analyze package.json dependencies: classify Nuxt modules vs runtime/dev dependencies and surface warnings for misplaced or missing modules.
Inputs: no named parameters.
analyze_projectA
Analyze overall project health: overview counts, dependency warnings, component sample with pagination, and hints (e.g. type auto-generation when .nuxt is missing).
Inputs: limit, offset.
check_nuxt4_migrationA
Check a Nuxt project against the official Nuxt 4 upgrade guide: current package.json version, app/ directory or future.compatibilityVersion 4, legacy root directories, singleton data-fetching conflicts, data/error/pending/shallow-reactivity changes, and removed APIs/options (route.meta, Unhead v2, window.NUXT, generate, experimental, pages:extend meta). Static analysis only — no DevServer or nuxi prepare.
Inputs: root.
check_runtime_configA
Parse runtimeConfig from nuxt.config, list flattened keys with types and env vars, scan useRuntimeConfig() accesses, and report undefined/unused keys plus private keys read in client code. Never prints values. Static analysis only — no DevServer or nuxi prepare.
Inputs: root.
check_ssr_safetyA
Statically flag SSR hazards: browser-only globals at setup top level / module scope, non-deterministic values (Date.now / Math.random / crypto.randomUUID) rendered in templates or computed, and shared ref/reactive state in composables. Static analysis only — no DevServer or nuxi prepare.
Inputs: path, root.
check_type_errorsA
Run a TypeScript type check against Nuxt-generated tsconfig (auto-generated into a cache when .nuxt is missing) or the project tsconfig.json. Returns structured diagnostics with file, line, column, code and severity.
Inputs: no named parameters.
explain_data_fetchingA
List useFetch / useLazyFetch / useAsyncData / useLazyAsyncData / $fetch calls with URL or key, method and detected options, and flag duplicate keys, $fetch in onMounted, bare await $fetch at setup top level, server: false without lazy, and lazy results rendered without pending/status. Accepts a page/component file or a URL resolved like explain_route. Static analysis only — no DevServer or nuxi prepare.
Inputs: path, root.
explain_injectionsA
Trace Nuxt plugin injections: find where useNuxtApp().$name values are provided (returned provide objects or nuxtApp.provide calls, including .client/.server plugins), list every file that references them, and report resolution status, multiple providers, unresolved third-party names, limitations and skipped/unreadable files. Static analysis only — no DevServer or nuxi prepare, and no automatic fixes.
Inputs: root, injection.
explain_middlewareA
Explain a Nuxt middleware (global / named / inline): its type, global run order, the routes it applies to, and whether it calls navigateTo or abortNavigation. Omit name to list all middleware and flag pages referencing missing middleware. Static analysis only — no DevServer or nuxi prepare.
Inputs: name, root.
explain_render_modeA
Explain how Nitro resolves the render mode for a concrete URL from nuxt.config routeRules / nitro.routeRules (ssr, spa, prerender, isr, swr, static) plus cache, redirect, cors, headers and proxy. Static analysis only — no DevServer or nuxi prepare.
Inputs: route (required), root.
explain_routeA
Explain how Nuxt resolves a concrete URL (e.g. /users/42): matched page, dynamic params, nested parents, layout, middleware order, data-fetching calls, and mapped /api server handlers. Static analysis only — no DevServer or nuxi prepare.
Inputs: route (required), root.
find_api_callersA
Find every page/component/composable/layout/plugin/middleware/util that calls a server API route via useFetch, useLazyFetch, $fetch, or useAsyncData($fetch). Accepts a handler file path (server/api/users/[id].get.ts) or a concrete URL (/api/users/42). Static analysis only — no DevServer or nuxi prepare.
Inputs: target (required), root.
find_usagesA
Find every file that uses a component or composable (explicit imports, Nuxt auto-imports, Lazy prefix, kebab-case templates). Omit target to list unused components and composables. Static analysis only — no DevServer or nuxi prepare.
Inputs: root, target.
generate_componentA
Generate a new Vue SFC under the project components directory (honoring srcDir) with typed defineProps/defineEmits and slots.
Inputs: name (required), emits, props, slots, +1 more.
generate_composableA
Generate a new composable under the project composables directory (honoring srcDir) with a typed export. Names are normalized to useXxx.
Inputs: name (required), dryRun, returns.
get_auto_importsA
Read the auto-imports registry (imports.d.ts): every auto-imported symbol with its source path and type signature. Auto-generates types into a cache when .nuxt is missing.
Inputs: filter.
get_nuxt_docsA
Get targeted offline Nuxt documentation guidance for a feature area (routing, nitro, modules, layers, composables, config, components).
Inputs: topic (required).
get_project_overviewA
Get a high-level overview of the Nuxt project: root, name, Nuxt version, config file, directory layout, layer list, and counts of routes, components, composables, server routes, middleware, plugins and modules.
Inputs: no named parameters.
get_routeA
Get detailed information about a single page route by its resolved URL path (e.g. /users/:id).
Inputs: path (required).
get_type_infoA
Read generated Nuxt type information (imports.d.ts, types/*, nuxt.schema.json). Auto-generates types into a cache when .nuxt is missing — no nuxi prepare required.
Inputs: no named parameters.
inspect_componentA
Get one component by the auto-imported name Nuxt would generate (prefix, path segments, and components.d.ts). Returns props, slots, and emits.
Inputs: name (required).
inspect_layersA
Resolve and return the full Nuxt extends hierarchy (layers). Returns layers ordered by override priority (project first), with each layer's config file, raw extends, and sub-layers.
Inputs: no named parameters.
inspect_route_metaA
Inspect a single route: returns route params, middleware, layout, page meta plus the component props, emits and slots. Accepts a route path (e.g. /users/:id) or a page file path.
Inputs: path (required).
list_componentsA
List Vue components using .nuxt/components.d.ts when it exists, otherwise the components config (dirs, prefix, pathPrefix, extensions, aliases). Includes props, emits, and slots.
Inputs: name, limit, offset, directory.
list_composablesA
List all composables, both auto-imported and explicit. Returns name, file path, parameters, and return type. Use this to discover reusable logic before writing new code.
Inputs: name.
list_modulesA
List Nuxt modules discovered from nuxt.config and package.json, with version, status (active/inactive) and source. Use this to understand which Nuxt features are available.
Inputs: status.
list_routesA
List all page routes with their resolved URL paths, source files, params, middleware, layouts and children. Use this to understand the page/routing surface of the project.
Inputs: pattern.
list_server_routesA
List all Nitro server API routes, middleware, and plugins. Returns route path, handler file, HTTP method, and middleware chain. Use this to understand the server/API surface of the project.
Inputs: type.
read_configA
Read the resolved Nuxt config, or a single key by dot-notation (e.g. runtimeConfig.public.apiBase). Omit the key to return the whole config.
Inputs: key.
scaffold_nitro_apiA
Generate a new Nitro server API handler under the project server/api directory (honoring serverDir) with H3 defineEventHandler and optional Zod body validation.
Inputs: path (required), zod, dryRun, method.
search_codeA
Search project source files for a substring or regex. Returns matching files with line/column numbers and surrounding context lines.
Inputs: query (required), limit, offset, fileTypes, +1 more.
update_configA
Update a nuxt.config value by dot-notation key. Returns a diff of the change. Dry-run by default; real writes require the server to be started with write authorization.
Inputs: key (required), value (required), dryRun.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Most tools target distinct analyses, but several clusters overlap: get_route / inspect_route_meta / explain_route all describe one route, get_project_overview / analyze_project both summarize project health, and read_config / check_runtime_config / get_project_overview all report config-and-count data. The detailed descriptions help disambiguate, but an agent must read carefully to pick the right one.
Names consistently follow a snake_case verb_noun pattern across a small set of verbs (get_, list_, check_, explain_, generate_, inspect_, find_, analyze_). Minor deviations exist, e.g. scaffold_nitro_api vs generate_component and add_nuxt_module vs generate_composable, but the convention is predictable.
34 tools is heavy for a project-analysis server and several diagnostics (analyze_project/get_project_overview, read_config/check_runtime_config, explain_route/inspect_route_meta) could be consolidated behind one entry point. Each tool is individually meaningful, so it is not an extreme mismatch, but the surface is on the excessive side.
Coverage of the Nuxt domain is strong: routes, components, composables, server routes, config read/update, modules, layers, type info, and a deep set of static diagnostics and migration checks. The main gap is lifecycle symmetry — there are generators (add_route, generate_component, generate_composable, scaffold_nitro_api) but no delete/remove or edit operations for existing routes, components, or modules.
Maintenance
Related MCP Connectors
Gives AI agents direct access to your Sanity projects and guidance for working with them
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Serves your design system and coding standards to coding agents, so they stop guessing.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients to inspect Next.js codebases, analyze App Router and Pages Router structure, discover API routes, and audit build performance through controlled tools.MIT
- AlicenseAqualityDmaintenanceProvides read-only, structurally safe introspection of a Laravel codebase, letting AI agents inspect routes, models, migrations, jobs, and config without risk of mutation or secret disclosure.8MIT
- FlicenseNot gradedqualityCmaintenanceProvides AI clients with safe, structured access to local filesystem, Git repositories, and project contexts, featuring file operations, git status/diff, project management, and built-in code review/bug analysis prompts.-
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents and compatible clients to query real-time editor language-server diagnostics, type/symbol information, and code navigation without waiting for slow tsc/eslint checks, plus workspace-aware operations such as finding references, renaming symbols, opening files, and executing editor commands.MIT