Skip to main content
Glama
mcp-server-nuxt

mcp-server-nuxt

by rynx-cc

npm version npm downloads CI node license

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].vue serves /users/:id, and which layout and middleware definePageMeta adds

  • components/base/BaseButton.vue is usable as <BaseButton> with no import

  • composables/useFoo.ts makes useFoo() available everywhere

  • extends: ['../ui-kit'] layers components, pages, and config over your app

  • server/api/hello.get.ts registers GET /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

explain_route

Resolve one URL: page, parents, layout, middleware order, data fetching, /api files, render mode

explain_middleware

Middleware type (global/named/inline), alphabetical global run order, routes it applies to, navigateTo/abortNavigation, missing page references

explain_render_mode

Resolve a URL's Nitro render mode from routeRules (ssr/spa/prerender/isr/swr/static)

list_routes

All routes: dynamic, optional, catch-all, nested

get_route

One route by pattern, e.g. /users/:id

inspect_route_meta

definePageMeta, layout, middleware, props/emits/slots of a page

add_route ✏️

Scaffold a page under pages/

Tool

What it does

list_server_routes

Endpoints, server middleware, and plugins with method and middleware chain

find_api_callers

Find every caller of a server route (useFetch / $fetch / useAsyncData($fetch)) by file path or URL

explain_data_fetching

List useFetch / useLazyFetch / useAsyncData / $fetch calls with URL or key, method and options; flag duplicate keys, $fetch in onMounted, bare setup await $fetch, server: false without lazy, and missing pending checks

scaffold_nitro_api ✏️

Generate an H3 handler with optional Zod body validation

Tool

What it does

list_components

Components from .nuxt/components.d.ts, or from components / components.dirs config

find_usages

Find every file using a component/composable (imports, auto-imports, Lazy, kebab-case), or list unused ones

explain_injections

Trace Nuxt plugin injections: where $name comes from, which files reference it, multiple providers, unresolved third-party names

inspect_component

Props, emits, and slots of one component

generate_component ✏️

Generate a typed Vue SFC

list_composables

User-defined and auto-imported composables

generate_composable ✏️

Scaffold a typed useXxx composable

get_auto_imports

Auto-import registry with source paths and signatures

get_type_info

Generated type info (.nuxt/types, schema)

Tool

What it does

get_project_overview

Nuxt version, layers, directories, and counts

analyze_project

Health check with dependency warnings and prepare hints

check_nuxt4_migration

Check a Nuxt project against the official Nuxt 4 upgrade guide: version, app/ structure, data-fetching defaults, removed APIs/options, readiness summary

read_config

Resolved nuxt.config from the project's own @nuxt/kit when Nuxt is installed, otherwise a source parse. Filterable by dot path

update_config ✏️

Change a config value, keeping comments, and return a diff

list_modules

Installed modules with version, source, and options

add_nuxt_module ✏️

Add a module to modules

inspect_layers

The full extends hierarchy in precedence order

check_runtime_config

Flatten runtimeConfig keys with NUXT_* env vars, scan useRuntimeConfig() use, flag undefined/unused keys and private keys read in client code

Tool

What it does

check_type_errors

Run tsc --noEmit against .nuxt/tsconfig.json

analyze_bundle_deps

Flag missing or misplaced dependencies

search_code

Search the codebase with line numbers and context

check_ssr_safety

Flag SSR hazards: browser globals at setup/module scope, non-deterministic values in templates and computed, shared composable state

get_nuxt_docs

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://project/overview

Nuxt version, layers, directories, counts

nuxt://project/routes

Route map with files, params, middleware, layouts, children

nuxt://project/config

Resolved nuxt.config via the project's @nuxt/kit, with a source-level fallback

nuxt://project/modules

Modules with status, source, and options

nuxt://project/layers

Layer hierarchy with override order (project > layers/* > earlier extends > later extends)

nuxt://project/auto-imports

Auto-imported symbols with source paths and signatures

nuxt://project/types

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:

  1. They default to dryRun: true and return the planned file or diff without touching disk.

  2. A real write needs dryRun: false and a server started with writes enabled.

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

.cursor/mcp.json in the project, or ~/.cursor/mcp.json

Claude Code

.mcp.json in the project, or Claude Code settings

Claude Desktop (macOS)

~/Library/Application Support/Claude/claude_desktop_config.json (strict JSON, no comments)

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 --help

The 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 build
  • Use Conventional Commits (feat:, fix:, chore:).

  • Add tests under tests/ for new tools and resources.

  • Keep @nuxt/kit optional; every integration needs a fallback. Resolved config loads Kit from the target project's node_modules first (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

MIT

Available Tools

34 tools
add_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

    A3.6/5.0

    Scored across 34 tools

    Disambiguation3/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
    • A
      license
      A
      quality
      D
      maintenance
      Provides 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.
      8
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables 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