Skip to content

Resources ​

Besides tools, the indexer registers MCP resources — addressable documents that an MCP client can list and read directly, without calling a tool. Clients use them to subscribe to data or to put it into the context ahead of time.

URI schemes ​

URIReturns
component://<Name>The component as JSON: props, events, slots, exposed, relations, docIds
composable://<name>The composable as JSON: signature, parameters, return type
store://<id>The Pinia store as JSON: state, getters, actions
route://<name>The route as JSON: path, name, meta
util://<name>The utility function as JSON
doc://component/<Name>A component-level markdown page
doc://workspace/<project>/<slug>A workspace-level markdown page (a package README.md, workspace docs/)
doc://collection/<name>/<slug>A markdown page from a docs.collections group
doc://project/<slug>A project-level markdown page (root README.md, docs/**)
file://<path>A source file — only when resources.exposeSourceCode is enabled
index://overviewThe index summary as JSON: version, language, mode, stats, projects, warnings

Route resources are addressed by the route name, not by its path: route://tasks, while the entity itself carries path: "/tasks/:id".

A real resources/list ​

On playground/ui-library the indexer reports 35 resources in seven schemes and 7 templates:

text
index://      1        component://  7        composable://  2
util://       3        doc://       10        file://       12

Templates (resources/templates/list) are what a client uses to build URIs itself — note {+var} (RFC 6570) wherever a slash may appear, because a plain {var} does not match paths:

json
[
  { "name": "component-entities", "uriTemplate": "component://{name}", "mimeType": "application/json" },
  { "name": "composable-entities", "uriTemplate": "composable://{name}", "mimeType": "application/json" },
  { "name": "store-entities", "uriTemplate": "store://{name}", "mimeType": "application/json" },
  { "name": "route-entities", "uriTemplate": "route://{+name}", "mimeType": "application/json" },
  { "name": "util-entities", "uriTemplate": "util://{name}", "mimeType": "application/json" },
  { "name": "documentation", "uriTemplate": "doc://{+rest}", "mimeType": "text/markdown" },
  { "name": "source-files", "uriTemplate": "file://{+path}", "mimeType": "text/plain" }
]

(Abridged: the real answer also carries title and description for each template.) A single list entry looks like this — descriptions are truncated to 120 characters on purpose:

json
{
  "uri": "index://overview",
  "name": "index-overview",
  "title": "Index overview",
  "description": "Сводка по индексу: состав, режим построения, предупреждения конфигурации",
  "mimeType": "application/json"
}

A real resources/read ​

An entity comes back as JSON, with absoluteFile removed:

json
{
  "id": "component:ui-library:uibutton",
  "kind": "component",
  "name": "UiButton",
  "project": "ui-library",
  "file": "src/components/ui-button/ui/UiButton.vue",
  "description": "Базовая кнопка дизайн-системы: варианты, размеры, состояние загрузки.",
  "status": "stable",
  "apiSource": "vue-component-meta",
  "docIds": ["doc:component:ui-library:uibutton"],
  "imports": ["util:ui-library:cn"],
  "usedBy": [],
  "lines": 66,
  "props": [
    { "name": "variant", "type": "Variant", "required": false, "default": "\"primary\"" }
  ]
}

(Abridged — the real payload contains every prop, event and slot.) A document is rendered, not dumped: the server prepends frontmatter and then emits the intro and each section:

markdown
---
title: UiButton
level: component
file: src/components/ui-button/docs/ui-button.md
---
# UiButton

Базовая кнопка дизайн-системы. Поддерживает варианты оформления, размеры,
состояние загрузки и слот для иконки.
…

file:// returns the raw source as text/plain.

Three behaviours worth knowing ​

  • Names are resolved, not matched literally. component://UiButton, component://ui-button and component://button all address the same entity — the same resolution the tools use, including stripping the design-system prefix. When a name is ambiguous, the answer is a JSON array with every candidate.

  • Almost nothing leaks out of the machine. Entity and document payloads carry relative paths only (absoluteFile is removed), so they can be pasted into an issue or a chat as is. The exception is index://overview, which reports the host's absolute rootDir and tsconfig per project — useful for debugging, worth knowing before you publish a server.

  • “Not found” is an answer, not a failure. A missing entity or document comes back as a localized text/plain body, not as an MCP error, so the client can show it verbatim. Note that resource answers carry no diagnostic codes — unlike tool answers, there is no [tools.*] prefix to match on:

    text
    component://UiNoSuchComponent  →  Entity "UiNoSuchComponent" (component) was not found in the index
    file://../README.md            →  Path "../README.md" escapes the project boundaries

Document levels ​

Every markdown document gets a level, which determines its URI and its linking priority — component → workspace → collection → project. A file is registered once, so a component page found early is never downgraded by a broader glob later.

How documents are found and linked to entities (the seven rules of docLinker, docMapping, frontmatter related:) is explained in About the Project.

A doc:// resource is rendered, not dumped: the server prepends frontmatter (title, level, collection, tags, file) and then emits the intro and every section of the document.

Source exposure ​

file:// resources are enabled by default (resources.exposeSourceCode: true). Turn them off, or narrow the set of extensions, in the configuration:

json
{
  "resources": {
    "exposeSourceCode": false,
    "allowedFileExtensions": [".vue", ".ts", ".js", ".md"]
  }
}

Even with exposure enabled, the indexer never serves .env*, .npmrc, .git/, node_modules/, .ssh/, .aws/, private keys, or files with secret/credentials in the name, and reads cannot escape the project roots (via .. or symlinks). An extension outside allowedFileExtensions is refused with its own message.

The view server honours the same setting: with exposeSourceCode: false its interface shows “source is not exposed by the server configuration” instead of code.

Note on list size ​

resources/list is complete, not paginated — on a large project it can reach ~120 KB. Descriptions are truncated to 120 characters. Pagination is on the roadmap.

MIT Licensed