mcp-server-nuxt
v0.9.2MCP server for Nuxt projects — exposes routes, components, config, and more to AI agents
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_project_overview
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.
get_type_info
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.
list_routes
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.
| Parameter | Type | Description |
|---|---|---|
pattern | string | Optional substring filter matched against the route path or file |
get_route
Get detailed information about a single page route by its resolved URL path (e.g. /users/:id).
| Parameter | Type | Description |
|---|---|---|
path * | string | The resolved route path, e.g. /users/:id |
explain_route
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.
| Parameter | Type | Description |
|---|---|---|
route * | string | Concrete URL path to explain, e.g. /users/42 or /blog/hello/world |
root | string | Optional project root override (defaults to the server project path) |
add_route
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Route path, e.g. /users/:id or /about |
dryRun | boolean | When true (default), return the planned file without writing |
layout | string | Optional layout name to set in definePageMeta |
middleware | array | Optional middleware names to set in definePageMeta |
list_components
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.
| Parameter | Type | Description |
|---|---|---|
directory | string | Optional directory filter (e.g. components) |
limit | integer | Max results to return (default 200) |
name | string | Optional substring filter on component name |
offset | integer | Number of results to skip (default 0) |
inspect_component
Get one component by the auto-imported name Nuxt would generate (prefix, path segments, and components.d.ts). Returns props, slots, and emits.
| Parameter | Type | Description |
|---|---|---|
name * | string | Auto-imported component name, e.g. BaseButton |
generate_component
Generate a new Vue SFC under the project components directory (honoring srcDir) with typed defineProps/defineEmits and slots.
| Parameter | Type | Description |
|---|---|---|
name * | string | Component name, e.g. BaseButton or ui/BaseButton |
dryRun | boolean | When true (default), return the planned file without writing |
emits | array | Event names to declare with defineEmits |
props | object | Prop name -> type, e.g. { "label": "string", "count": "number" } |
slots | array | Slot names (default slot is always included) |
list_composables
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.
| Parameter | Type | Description |
|---|---|---|
name | string | Optional substring filter on composable name |
get_auto_imports
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.
| Parameter | Type | Description |
|---|---|---|
filter | string | Optional substring filter on the symbol name or source path |
generate_composable
Generate a new composable under the project composables directory (honoring srcDir) with a typed export. Names are normalized to useXxx.
| Parameter | Type | Description |
|---|---|---|
name * | string | Composable name, e.g. useCounter or counter |
dryRun | boolean | When true (default), return the planned file without writing |
returns | string | Optional return type annotation, e.g. { count: Ref<number> } |
list_server_routes
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.
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by route kind |
scaffold_nitro_api
Generate a new Nitro server API handler under the project server/api directory (honoring serverDir) with H3 defineEventHandler and optional Zod body validation.
| Parameter | Type | Description |
|---|---|---|
path * | string | API path, e.g. /api/hello or /api/users/:id |
dryRun | boolean | When true (default), return the planned file without writing |
method | string | HTTP method (default: handle all methods) |
zod | boolean | Include readValidatedBody with a Zod schema (default false) |
list_modules
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.
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by module status |
add_nuxt_module
Add a Nuxt module to the modules array in nuxt.config, optionally with options. Returns a diff; dry-run by default.
| Parameter | Type | Description |
|---|---|---|
name * | string | Module name, e.g. @nuxtjs/i18n |
dryRun | boolean | When true (default), return the planned change without writing |
options | string | Optional module options as a JSON object string, e.g. {"locales": ["en"]} |
inspect_route_meta
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Route path (e.g. /users/:id) or page file (e.g. pages/users/[id].vue) |
read_config
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.
| Parameter | Type | Description |
|---|---|---|
key | string | Dot-notation config key to read |
update_config
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.
| Parameter | Type | Description |
|---|---|---|
key * | string | Dot-notation config key, e.g. ssr or runtimeConfig.public.apiBase |
value * | string | New value as JSON or a JS expression, e.g. "false" or "'https://api.example.com'" |
dryRun | boolean | When true (default), return the planned change without writing |
search_code
Search project source files for a substring or regex. Returns matching files with line/column numbers and surrounding context lines.
| Parameter | Type | Description |
|---|---|---|
query * | string | Substring or regex to search for |
fileTypes | array | Optional file extensions, e.g. ["vue", "ts"] |
limit | integer | Maximum number of results (default 50) |
maxResults | integer | Maximum number of results (default 50; alias of limit) |
offset | integer | Skip the first N matches (default 0) |
get_nuxt_docs
Get targeted offline Nuxt documentation guidance for a feature area (routing, nitro, modules, layers, composables, config, components).
| Parameter | Type | Description |
|---|---|---|
topic * | string | Feature topic, e.g. routing, nitro, modules, layers |
inspect_layers
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.
check_type_errors
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.
analyze_bundle_deps
Analyze package.json dependencies: classify Nuxt modules vs runtime/dev dependencies and surface warnings for misplaced or missing modules.
analyze_project
Analyze overall project health: overview counts, dependency warnings, component sample with pagination, and hints (e.g. type auto-generation when .nuxt is missing).
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max component/package items (default 50) |
offset | integer | Offset into the component list (default 0) |
explain_render_mode
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.
| Parameter | Type | Description |
|---|---|---|
route * | string | Concrete URL path to explain, e.g. /blog/hello or /old |
root | string | Optional project root override (defaults to the server project path) |
find_api_callers
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.
| Parameter | Type | Description |
|---|---|---|
target * | string | Server API route target: a handler file path or a concrete URL, e.g. server/api/users/[id].get.ts or /api/users/42 |
root | string | Optional project root override (defaults to the server project path) |
find_usages
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.
| Parameter | Type | Description |
|---|---|---|
root | string | Optional project root override (defaults to the server project path) |
target | string | Component name (UserCard), component file path, or composable name (useAuth). Omit to list unused components/composables. |
check_ssr_safety
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.
| Parameter | Type | Description |
|---|---|---|
path | string | Optional file or directory to limit the scan (relative to the project root). |
root | string | Optional project root override (defaults to the server project path) |
explain_middleware
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.
| Parameter | Type | Description |
|---|---|---|
name | string | Middleware name or a file under middleware/, e.g. auth or middleware/auth.ts. Omit to list all middleware. |
root | string | Optional project root override (defaults to the server project path) |
check_runtime_config
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.
| Parameter | Type | Description |
|---|---|---|
root | string | Optional project root override (defaults to the server project path) |
explain_data_fetching
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.
| Parameter | Type | Description |
|---|---|---|
path | string | Optional page/component file (or directory) or a concrete URL like /users/42. Omit to scan all pages, components, layouts and composables. |
root | string | Optional project root override (defaults to the server project path) |
check_nuxt4_migration
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.
| Parameter | Type | Description |
|---|---|---|
root | string | Optional project root override (defaults to the server project path) |
explain_injections
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.
| Parameter | Type | Description |
|---|---|---|
injection | string | Optional injection name filter, e.g. api or $api (normalized internally). |
root | string | Optional project root override (defaults to the server project path) |