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:
{
"$schema": "./node_modules/vue-codebase-mcp/schemas/vue-codebase-mcp.schema.json"
}Minimal
{
"projectRoot": "./",
"components": { "locations": ["src/components/**/*.vue"], "namePrefixes": ["Ui"] },
"docs": { "project": ["README.md"], "workspace": ["docs/**/*.md", "src/**/docs/*.md"] }
}UI library with a modular layout
{
"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
{
"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.
| What | Where it looks |
|---|---|
| Configuration | .vue-codebase-mcp.json or .vue-mcp.json, searched upwards from the project root |
| Components | src/**/*.vue |
| Composables | src/composables/**/*.ts, src/composable/**/*.ts, src/hooks/**/*.ts, src/**/use*.ts, src/**/use*.js |
| Pinia stores | src/stores/**/*.ts, src/store/**/*.ts |
| Utilities | src/utils/**/*.ts, src/lib/**/*.ts, src/libs/**/*.ts |
| Router | src/router/index.ts, src/router.ts, src/router/index.js, app/router.ts |
| Documentation | README.md, docs/**/*.md — on both the project and the workspace level |
| tsconfig | the 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.
| Key | Default | Purpose |
|---|---|---|
language | en | Interface 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.ignoreInternal | true | Skip files under _-prefixed directories |
components.autoLinkDocs | true | Link 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.maxResults | 50 | Cap on the number of search results |
search.fuzzyThreshold | 0.4 | Minimum similarity for fuzzy name matches |
search.useDefaultSynonyms | true | false switches the built-in ru↔en dictionary off |
search.synonyms / synonymsFile | — | Extend the built-in ru↔en dictionary |
resources.exposeSourceCode | true | Serve file:// resources and source in the view interface |
resources.exposeInternal | false | Include _internal entities in resources |
resources.allowedFileExtensions | .vue, .ts, .tsx, .js, .jsx, .mts, .mjs, .md, .mdx, .json, .css, .scss, .html, .yaml, .yml | Which files file:// may serve |
tools.getSource.maxLines | 1500 | Cap for get_source responses |
tools.getSource.defaultSection | "all" | Which SFC section get_source returns by default |
tools.getUsageExamples.defaultLimit | 3 | Usages returned when limit is omitted |
tools.getUsageExamples.contextLines | 10 | Lines of context around each usage |
tools.getDocumentation.maxChars | 24000 | Cap for get_documentation responses |
tools.getKnowledgeGraph.maxDepth | 3 | Default depth of the relation graph |
cache.dir | .vue-codebase-mcp.cache | Where the index snapshot lives |
cache.snapshotFile | <cache.dir>/index.json | Snapshot file name |
cache.enabled | true | Read and write the snapshot |
cache.watch | true | Start 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.type | stdio | stdio or http |
transport.host | 127.0.0.1 | HTTP bind address |
transport.httpPort | 3333 | HTTP port (surfaced as transport.port in the resolved config) |
transport.httpPath | /mcp | HTTP 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:
npx vue-codebase-mcp config --root /path/to/projectIn 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
| Variable | Server | Purpose |
|---|---|---|
VUE_CODEBASE_MCP_CONFIG | both | Path to the configuration file |
VUE_CODEBASE_MCP_ROOT | both | Root of the target project |
VUE_CODEBASE_MCP_LANG | both | Interface language (ru/en) |
VUE_CODEBASE_VIEW_MCP_LANG | view | Interface language, higher priority than above |
MCP_TRANSPORT | indexer | http switches the transport on; any other value leaves stdio |
MCP_PORT / MCP_AUTH_TOKEN | indexer | HTTP transport port and bearer token |
MCP_ALLOWED_HOSTS | indexer | Comma-separated extra allowed values of the Host header (for example an ingress domain) |
MCP_LOG_LEVEL | both | error, 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.