Skip to content

Configuration ​

Behaviour is configured through .vue-codebase-mcp.json in the project root. Without it, the server finds components, composables, stores and documentation on its own by conventional locations — configuration is optional, not required.

Both servers read the same file: the view server has no schema of its own.

JSON Schema ​

A schema for editor completion ships with the indexer package:

json
{
  "$schema": "./node_modules/vue-codebase-mcp/schemas/vue-codebase-mcp.schema.json"
}

Minimal ​

json
{
  "projectRoot": "./",
  "components": { "locations": ["src/components/**/*.vue"], "namePrefixes": ["Ui"] },
  "docs": { "project": ["README.md"], "workspace": ["docs/**/*.md", "src/**/docs/*.md"] }
}

UI library with a modular layout ​

json
{
  "projectRoot": "./",
  "language": "en",
  "tsconfig": "tsconfig.src.json",
  "components": {
    "locations": ["src/components/**/ui/*.vue"],
    "namePrefixes": ["UiR", "Ui"],
    "ignoreInternal": true,
    "docMapping": [
      {
        "pattern": "src/components/**/ui/*.vue",
        "docs": ["src/components/**/docs/*.md"]
      }
    ]
  },
  "composables": { "locations": ["src/**/composables/**/*.ts"] },
  "utils": { "locations": ["src/libs/**/*.ts"] },
  "docs": {
    "project": ["README.md"],
    "workspace": ["docs/pages/**/*.md", "src/**/docs/*.md"],
    "collections": [{ "name": "Contributing", "path": "docs/pages/contribution/**/*.md", "tags": ["contributing"] }]
  },
  "tools": { "getSource": { "maxLines": 1200 }, "getUsageExamples": { "defaultLimit": 3 } }
}

Without docMapping, documentation is found automatically by the seven rules of docLinker — see About the Project.

Monorepo ​

json
{
  "language": "ru",
  "workspaces": [
    {
      "name": "ui-kit",
      "root": "./packages/ui-kit",
      "components": { "locations": ["src/**/*.vue"], "namePrefixes": ["Ui"] },
      "docs": { "workspace": ["README.md", "docs/**/*.md"] }
    },
    {
      "name": "quickpick-widget",
      "root": "./apps/quickpick",
      "components": { "locations": ["src/**/*.vue"] },
      "docs": { "componentDocs": { "CameraView": "docs/camera.md" } }
    }
  ],
  "docs": { "project": ["README.md", "docs/ARCHITECTURE.md"] },
  "search": { "synonyms": { "камера": ["camera"], "корзина": ["cart"] } }
}

In a monorepo the view server serves one workspace at a time: pass "project": "ui-kit" to preview_* tools. The index (and therefore the API table and the graph) covers every workspace; the live registry contains only the served one's components.

Without a configuration file ​

Configuration is optional: with no .vue-codebase-mcp.json the server detects entities by conventional locations. playground/mini-widget in this repository has no configuration file at all and still indexes 17 components, 2 composables, 2 stores, 6 routes, 5 utilities and 4 documents.

WhatWhere it looks
Configuration.vue-codebase-mcp.json or .vue-mcp.json, searched upwards from the project root
Componentssrc/**/*.vue
Composablessrc/composables/**/*.ts, src/composable/**/*.ts, src/hooks/**/*.ts, src/**/use*.ts, src/**/use*.js
Pinia storessrc/stores/**/*.ts, src/store/**/*.ts
Utilitiessrc/utils/**/*.ts, src/lib/**/*.ts, src/libs/**/*.ts
Routersrc/router/index.ts, src/router.ts, src/router/index.js, app/router.ts
DocumentationREADME.md, docs/**/*.md — on both the project and the workspace level
tsconfigthe first that exists: tsconfig.app.json, tsconfig.json, tsconfig.src.json

Always excluded, whatever the configuration says: node_modules, dist, build, .nuxt, .output, coverage, storybook-static, tests and stories (*.test.ts, *.spec.ts, __tests__/, __mocks__/, *.stories.vue, *.stories.ts, *.story.vue) and *.d.ts.

Design-system prefixes are the one thing that cannot be guessed: components.namePrefixes defaults to an empty list. Without it, ranked search still finds UiButton by the button token of its kebab name, but exact name resolution (get_entity_details, component://button) needs the prefix declared.

Keys and defaults ​

Defaults are what a project gets with no configuration; every key is optional.

KeyDefaultPurpose
languageenInterface language, the lowest-priority source — see Language
components.locations["src/**/*.vue"]Where components are looked for
components.namePrefixes[]Design-system prefixes (Ui, UiR…) stripped during name resolution
components.ignoreInternaltrueSkip files under _-prefixed directories
components.autoLinkDocstrueLink documents to entities automatically (the seven docLinker rules)
components.docMapping—Explicit pattern → docs globs with {name} / {dir} placeholders
docs.project / docs.workspace["README.md", "docs/**/*.md"]Project-level and workspace-level documentation
docs.componentDocs—Explicit component → document map (highest linking priority)
search.maxResults50Cap on the number of search results
search.fuzzyThreshold0.4Minimum similarity for fuzzy name matches
search.useDefaultSynonymstruefalse switches the built-in ru↔en dictionary off
search.synonyms / synonymsFile—Extend the built-in ru↔en dictionary
resources.exposeSourceCodetrueServe file:// resources and source in the view interface
resources.exposeInternalfalseInclude _internal entities in resources
resources.allowedFileExtensions.vue, .ts, .tsx, .js, .jsx, .mts, .mjs, .md, .mdx, .json, .css, .scss, .html, .yaml, .ymlWhich files file:// may serve
tools.getSource.maxLines1500Cap for get_source responses
tools.getSource.defaultSection"all"Which SFC section get_source returns by default
tools.getUsageExamples.defaultLimit3Usages returned when limit is omitted
tools.getUsageExamples.contextLines10Lines of context around each usage
tools.getDocumentation.maxChars24000Cap for get_documentation responses
tools.getKnowledgeGraph.maxDepth3Default depth of the relation graph
cache.dir.vue-codebase-mcp.cacheWhere the index snapshot lives
cache.snapshotFile<cache.dir>/index.jsonSnapshot file name
cache.enabledtrueRead and write the snapshot
cache.watchtrueStart a file watcher with serve. An edited file is re-read on the fly by the syntactic parser and marked stale; a rebuild with index --mode full brings the exact types back. The watcher follows directories — the static prefixes of the locations patterns — and selects events with those same patterns
transport.typestdiostdio or http
transport.host127.0.0.1HTTP bind address
transport.httpPort3333HTTP port (surfaced as transport.port in the resolved config)
transport.httpPath/mcpHTTP endpoint path (surfaced as transport.path)
transport.authToken—Bearer token; empty means no authentication

The resolved configuration of any project can be printed instead of guessed:

bash
npx vue-codebase-mcp config --root /path/to/project

In that output authToken is masked (*** or null) and the loaded synonym dictionary is replaced by a count, so the dump is safe to paste into an issue.

Where relative paths resolve ​

The base directory is the directory of the configuration file when --config is given, and the discovered project root otherwise. Every relative path in the configuration — components.locations, docs.*, cache.dir, search.synonymsFile, workspaces[].root — is resolved against it, not against the current working directory. That is why passing --config /tmp/some.json also moves the snapshot to /tmp/.vue-codebase-mcp.cache: keep the configuration file inside the project.

HTTP transport ​

transport.type: "http" (or --transport http, or MCP_TRANSPORT=http) exposes the indexer at http://host:port/path. Running it on a host — index preparation, systemd, Docker, a reverse proxy with TLS and the security settings — is described on a separate page: Deployment.

Environment variables ​

VariableServerPurpose
VUE_CODEBASE_MCP_CONFIGbothPath to the configuration file
VUE_CODEBASE_MCP_ROOTbothRoot of the target project
VUE_CODEBASE_MCP_LANGbothInterface language (ru/en)
VUE_CODEBASE_VIEW_MCP_LANGviewInterface language, higher priority than above
MCP_TRANSPORTindexerhttp switches the transport on; any other value leaves stdio
MCP_PORT / MCP_AUTH_TOKENindexerHTTP transport port and bearer token
MCP_ALLOWED_HOSTSindexerComma-separated extra allowed values of the Host header (for example an ingress domain)
MCP_LOG_LEVELbotherror, warn, info (default), debug

Precedence is CLI flags → configuration file → environment → defaults, so transport.httpPort beats MCP_PORT. String values in the configuration support ${ENV_VAR} substitution — handy for "authToken": "${MCP_AUTH_TOKEN}".

All logs go to stderr: stdout is occupied by the MCP protocol. When something goes wrong, set MCP_LOG_LEVEL=debug and read it — the failure taxonomy, exit codes and the [code] message format are described in Introduction → Errors, exit codes and logs and Introduction → Troubleshooting.

MIT Licensed