Skip to content

Recipes ​

Eight tasks that come up in real work, and the tool calls that answer them. Every request and every answer below was captured from a real session against the demo projects of this repository (playground/ui-library, playground/monorepo); long answers are abridged with ….

You do not write these calls by hand — you ask the assistant a question in plain language and it chooses the tools. The calls are shown so you can see what happens under the hood and what to expect back.

1. Is there a ready-made component for this? ​

You ask: "Do we have a button in the design system? What props does it take?"

json
{ "name": "search", "arguments": { "query": "button" } }
text
## Index matches (1)
- **UiButton** · component · `src/components/ui-button/ui/UiButton.vue` (stable)
  Базовая кнопка дизайн-системы: варианты, размеры, состояние загрузки.
  match: exact name, category

Then the exact API:

json
{ "name": "get_entity_details", "arguments": { "name": "UiButton" } }
text
## UiButton · component · ui-library
file: `src/components/ui-button/ui/UiButton.vue` · uri: `component://UiButton` · api: vue-component-meta · status: stable
…
### Props
- `variant` — `Variant` [default: `"primary"`] — Визуальный вариант оформления
- `size` — `Size` [default: `"m"`] — Размер кнопки
- `loading` — `boolean` [default: `false`] — Переводит кнопку в состояние «загрузка» и блокирует клики
- `disabled` — `boolean` [default: `false`] — Кнопка недоступна для взаимодействия
- `type` — `"button" | "submit" | "reset"` [default: `"button"`] — Тип нативной кнопки в форме
### Events
- `click` — `(event: MouseEvent): void`
### Slots
- `default` — Основное содержимое кнопки (текст)
- `icon` — Иконка перед текстом
…

api: vue-component-meta means the types were resolved, not guessed. If a component has no public API the answer says so plainly instead of inventing props:

text
No public API detected (the component has no props, events or slots, or it could not be parsed).

A typo does not end the search — suggestions are ranked by similarity:

text
[tools.entityNotFound] "UiButon" was not found in the index (12 entities).

Did you mean:
- UiButton · component · ui-library
- UiBadge · component · ui-library

Refine the request with the `search` tool.

2. What breaks if I change this? ​

You ask: "I want to rename the variant prop of UiButton. What will break?"

json
{ "name": "get_dependencies", "arguments": { "name": "UiButton" } }
text
# Dependencies of UiButton

## Uses (1)
- **cn** · util · `src/libs/cn.ts`
  Склеивает CSS-классы, пропуская ложные значения и раскрывая условные объекты.

## Used by (0)
- not used anywhere

## Documentation (4)
- UiButton · `doc://component/UiButton`
- Начало работы · `doc://workspace/ui-library/docs/getting-started`
- Темы и оформление · `doc://workspace/ui-library/docs/theming`
- ui-library — демо-проект `vue-codebase-mcp` · `doc://project/README`

Used by (0) is normal for a design-system leaf: the demo library is not consumed by an app. In a real application this is the list of screens to check. Add get_usage_examples for concrete call sites with line numbers, and raise depth to 2–3 for transitive links. The documentation section matters too — four documents mention UiButton, and a renamed prop makes their examples wrong.

In the monorepo demo the same question about WidgetCounter shows real coupling:

text
## Index matches (2)
- **WidgetCounter** · component · `src/components/WidgetCounter.vue`
  Счётчик кликов: использует стор виджета и компоненты `@acme/ui-kit`.
  match: name: "counter"
- **widget** · store · `src/stores/widget.ts`
  Состояние виджета: счётчик и его подпись. Стор в setup-форме — состояние и геттеры объявлены через `ref` / `computed`.
  match: api: "counter"

3. Documentation and examples without reading whole pages ​

You ask: "How do I install and use this library? Show an example."

Full-text search over markdown:

json
{ "name": "search_docs", "arguments": { "query": "установка" } }
text
## Documentation for "установка" (1)

- **Начало работы** · workspace · `doc://workspace/ui-library/docs/getting-started`
  Библиотека `ui-library` распространяется как ES-модуль. Импортируйте отдельные компоненты из публичного API:
  file: `docs/getting-started.md`

Then only the section you need, instead of the whole page:

json
{ "name": "get_documentation", "arguments": { "entity": "UiButton", "section": "Примеры" } }
text
# UiButton · Примеры

```vue
<script setup lang="ts">
import { UiButton } from "ui-library";

function save(): void {
  console.log("saved");
}
</script>

<template>
  <UiButton variant="primary" size="m" @click="save">Сохранить</UiButton>
  <UiButton variant="ghost" :loading="true">Загрузка…</UiButton>
</template>
```

search_docs matches tokens of the document text, not entity names: in this demo, asking for "button" finds nothing because the pages are written in Russian. Search documents with words from the documents, and use search for names. On a miss the answer lists the documents that do exist, which is usually enough to reformulate.

4. Asking in Russian ​

You ask: «Найди компонент кнопки» — without switching the interface language.

json
{ "name": "search", "arguments": { "query": "кнопка" } }
text
## Index matches (1)
- **UiButton** · component · `src/components/ui-button/ui/UiButton.vue` (stable)
  Базовая кнопка дизайн-системы: варианты, размеры, состояние загрузки.
  match: synonym (name): "button", name: "button"

The built-in Russian↔English dictionary works with no configuration at all, and the reason line shows exactly what fired: the query «кнопка» was mapped to button by the dictionary, and that alias matched the component name. In the monorepo demo the same is done by a user-configured search.synonyms map.

Word forms are matched by a common prefix of at least four characters, so «кнопкой» finds «кнопка» but «около» does not find «окно». Extend the dictionary with search.synonyms or search.synonymsFile, switch it off with search.useDefaultSynonyms: false: Language.

Note what --lang does not translate: entity descriptions come from your JSDoc comments, document titles come from your markdown. The server translates its own text only.

5. Show it to me in a browser ​

You ask: "Open UiButton so I can click it."

json
{ "name": "preview_component", "arguments": { "component": "UiButton", "port": 5299, "open": true } }
text
Component **UiButton** (ui-library)
Source: src/components/ui-button/ui/UiButton.vue (66 lines)
API resolved by: vue-component-meta
…
Props (5 props)
- `variant`: Variant = "primary"
- `size`: Size = "m"
…
Preview for **ui-library** was already running — reusing it (7 renderable)
URL: http://localhost:5299/__vue-view__/
Stand URL: http://localhost:5299/__vue-view__/#/component/UiButton

Stand URL is the deep link to the interactive stand: live render, prop controls, editable slots and an emitted-event log. For a whole project use preview_project with mode — gallery, api (a dense sortable table with CSV export) or graph (dependencies). Details and the four routes: View server.

From a terminal, the same thing is one command:

bash
npx vue-codebase-view-mcp preview --root playground/ui-library --port 5299 --component UiButton --open

6. Monorepo: pick the right workspace ​

You ask: "What stores does the widget app have?"

json
{ "name": "list_entities", "arguments": { "project": "widget", "kind": "store" } }
text
# Project entities (1)

## store (1)
- **widget** · store · `src/stores/widget.ts`
  Состояние виджета: счётчик и его подпись. Стор в setup-форме — состояние и геттеры объявлены через `ref` / `computed`.

Routes of the same workspace:

json
{ "name": "list_entities", "arguments": { "project": "widget", "kind": "route" } }
text
# Project entities (2)

## route (2)
- **home** · route · `src/router/index.ts`
- **settings** · route · `src/router/index.ts`

Without project the tools search all workspaces, and get_project_overview always shows all of them — it takes no parameters at all (extra arguments are ignored silently, while a wrong enum value is a validation error):

text
## Projects
- **ui-kit** — 4 components, 1 composable, 0 stores, 0 routes, 1 util
- **widget** — 2 components, 0 composables, 1 store, 2 routes, 0 utils

A typo in the workspace name is reported with the list of real names:

text
[tools.unknownProject] Project "ui-kitt" is not described in the configuration. Available: ui-kit, widget.

The view server serves one workspace at a time — pass project to preview_project, and remember that "renderable" counts that workspace only, while the index line counts everything.

7. Reading a big file without burning the context ​

You ask: "Show me the template of that component" — not the whole 400-line SFC.

json
{ "name": "get_source", "arguments": { "name": "UiButton", "section": "template" } }
text
# UiButton · src/components/ui-button/ui/UiButton.vue

```vue
<template>
<button :class="classes" :disabled="isBlocked" :type="type" @click="onClick">
    <span v-if="loading" class="ui-button__spinner" aria-hidden="true" />
    <span v-else-if="$slots.icon" class="ui-button__icon"><slot name="icon" /></span>
    <span class="ui-button__label"><slot /></span>
  </button>
</template>
```

If a limit is smaller than the file and no section was requested, the server narrows the answer to the script section and says so:

json
{ "name": "get_source", "arguments": { "name": "UiButton", "startLine": 55, "maxLines": 12 } }
text
# UiButton.vue — <script> only

The file has 66 lines, the limit is 12. Request the section you need explicitly: `section: "template"` or `section: "style"`.
…

For machine processing ask for JSON instead of markdown — get_entity_details and get_knowledge_graph both accept format: "json":

json
{ "name": "get_entity_details", "arguments": { "name": "UiButton", "format": "json" } }
json
{
  "id": "component:ui-library:uibutton",
  "kind": "component",
  "name": "UiButton",
  "project": "ui-library",
  "file": "src/components/ui-button/ui/UiButton.vue",
  "apiSource": "vue-component-meta",
  "props": [
    { "name": "variant", "type": "Variant", "required": false, "default": "\"primary\"" }
  ],
  "imports": ["util:ui-library:cn"],
  "usedBy": [],
  "lines": 66
}

(Abridged; the real answer contains every prop, event, slot and relation.) Answers are capped by MAX_TOOL_CHARS = 24000 and by tools.* limits in the configuration.

8. Is my index up to date? ​

You ask: "Am I looking at the current code?"

json
{ "name": "get_project_overview", "arguments": {} }
text
Index: mode full, built 2026-11-20T17:12:45.270Z in 468 ms (snapshot from 2026-11-20T17:12:45.270Z)
…
## API sources
- vue-component-meta: 7
- typescript: 5

Two things to check: mode (light means types are unresolved — run index --mode full) and the snapshot timestamp against your last edits. Rebuild explicitly:

bash
npx vue-codebase-mcp index --root playground/ui-library --mode full
text
Index built (full) in 500 ms
  components:  7
  composables: 2
  stores:      0
  routes:      0
  utils:       3
  documents:   10
  snapshot:    <repo>/playground/ui-library/.vue-codebase-mcp.cache/index.json

What the stale marker means

An entity edited after the snapshot was built is re-read on the fly by the file watcher and marked stale: the data is fresh, but the snapshot's type resolution is out of date and apiSource temporarily becomes sfc-lite. A rebuild brings the exact types back — run index --mode full or restart the server. See Quick Start → Keep the index fresh.

Next ​

MIT Licensed