mcp-server-nuxt

v0.9.2
mcp-server-nuxt Checked 9 hours ago Published 14 hours ago

MCP 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.

ParameterTypeDescription
patternstringOptional 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).

ParameterTypeDescription
path *stringThe 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.

ParameterTypeDescription
route *stringConcrete URL path to explain, e.g. /users/42 or /blog/hello/world
rootstringOptional 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.

ParameterTypeDescription
path *stringRoute path, e.g. /users/:id or /about
dryRunbooleanWhen true (default), return the planned file without writing
layoutstringOptional layout name to set in definePageMeta
middlewarearrayOptional 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.

ParameterTypeDescription
directorystringOptional directory filter (e.g. components)
limitintegerMax results to return (default 200)
namestringOptional substring filter on component name
offsetintegerNumber 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.

ParameterTypeDescription
name *stringAuto-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.

ParameterTypeDescription
name *stringComponent name, e.g. BaseButton or ui/BaseButton
dryRunbooleanWhen true (default), return the planned file without writing
emitsarrayEvent names to declare with defineEmits
propsobjectProp name -> type, e.g. { "label": "string", "count": "number" }
slotsarraySlot 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.

ParameterTypeDescription
namestringOptional 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.

ParameterTypeDescription
filterstringOptional 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.

ParameterTypeDescription
name *stringComposable name, e.g. useCounter or counter
dryRunbooleanWhen true (default), return the planned file without writing
returnsstringOptional 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.

ParameterTypeDescription
typestringFilter 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.

ParameterTypeDescription
path *stringAPI path, e.g. /api/hello or /api/users/:id
dryRunbooleanWhen true (default), return the planned file without writing
methodstringHTTP method (default: handle all methods)
zodbooleanInclude 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.

ParameterTypeDescription
statusstringFilter 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.

ParameterTypeDescription
name *stringModule name, e.g. @nuxtjs/i18n
dryRunbooleanWhen true (default), return the planned change without writing
optionsstringOptional 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.

ParameterTypeDescription
path *stringRoute 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.

ParameterTypeDescription
keystringDot-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.

ParameterTypeDescription
key *stringDot-notation config key, e.g. ssr or runtimeConfig.public.apiBase
value *stringNew value as JSON or a JS expression, e.g. "false" or "'https://api.example.com'"
dryRunbooleanWhen 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.

ParameterTypeDescription
query *stringSubstring or regex to search for
fileTypesarrayOptional file extensions, e.g. ["vue", "ts"]
limitintegerMaximum number of results (default 50)
maxResultsintegerMaximum number of results (default 50; alias of limit)
offsetintegerSkip 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).

ParameterTypeDescription
topic *stringFeature 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).

ParameterTypeDescription
limitintegerMax component/package items (default 50)
offsetintegerOffset 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.

ParameterTypeDescription
route *stringConcrete URL path to explain, e.g. /blog/hello or /old
rootstringOptional 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.

ParameterTypeDescription
target *stringServer API route target: a handler file path or a concrete URL, e.g. server/api/users/[id].get.ts or /api/users/42
rootstringOptional 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.

ParameterTypeDescription
rootstringOptional project root override (defaults to the server project path)
targetstringComponent 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.

ParameterTypeDescription
pathstringOptional file or directory to limit the scan (relative to the project root).
rootstringOptional 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.

ParameterTypeDescription
namestringMiddleware name or a file under middleware/, e.g. auth or middleware/auth.ts. Omit to list all middleware.
rootstringOptional 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.

ParameterTypeDescription
rootstringOptional 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.

ParameterTypeDescription
pathstringOptional page/component file (or directory) or a concrete URL like /users/42. Omit to scan all pages, components, layouts and composables.
rootstringOptional 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.

ParameterTypeDescription
rootstringOptional 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.

ParameterTypeDescription
injectionstringOptional injection name filter, e.g. api or $api (normalized internally).
rootstringOptional project root override (defaults to the server project path)