dsds-mcp

v0.7.0
dsds-mcp Checked 2 days ago Published 29 days ago

MCP server for the Design System Documentation Spec (DSDS)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

dsds_context_brief

Get a structured briefing of everything you need to know before starting work. Use useCase="build" before implementing UI with the design system. Use useCase="author" before documenting a design system in DSDS format. Use useCase="ask" before answering a question about how to use the design system. Call this first — before any other tool.

ParameterTypeDescription
useCase *string"build" — implementing UI with the design system. "author" — writing DSDS documentation. "ask" — answering a question about using the design system.
taskstringOptional. What specifically are you building or documenting? Adds a task header to the brief.

dsds_spec_entity_schema

Get the full field definitions for a DSDS entity kind. Use this before authoring or scaffolding to understand what fields are available. Covers the bundled spec version, one kind at a time; dsds_get_skill({id:"dsds-specs"}) has the fuller picture. A namespaced custom kind (e.g. "sanity.guide") falls back to the generic entry shape.

ParameterTypeDescription
kind *stringThe entity kind to describe: a well-known kind (component, token, theme, system, entry) or a namespaced custom kind (e.g. "sanity.guide").

dsds_build_component

THE REQUIRED WAY to compose any design-system component in code. Before writing JSX for a documented component (e.g. "button", "card") — a new instance, configuring props, or adjusting one — call this and use its output instead of hand-writing JSX or guessing props. Two calls: step:"start" with an "identifier" returns the full list of props and each prop's allowed values; step:"finalize" with that identifier and an "answers" map { propId: value } returns ready-to-use JSX in "result.code", guaranteed valid (result.lintSafe = true — do not lint it). The start response explains the exact fi…

ParameterTypeDescription
step *stringStart with "start". Then "answer" for each question, then "finalize".
answerobjectOn step "answer" (optional stepwise mode): your decision for the CURRENT question. Shape: { use: boolean, value?: <chosen option | free value> }. Set use:false to skip an optional prop. For enum/flag…
answersobjectOn step "finalize" (preferred): a map of { propId: value } for every prop you want to set, taken from the "questions" list returned by "start". Omit props you don't need. Use a boolean for flag props…
dataobjectThe "data" object returned by the previous step. Omit on "start", and omit on a one-shot "finalize" (pass identifier + answers instead). Only needed for the optional stepwise "answer" mode.
identifierstringOn step "start": the existing component to implement, e.g. "button" or "Button". Case-insensitive.

dsds_validate

Validate a DSDS document with the spec's own reference validator, bundled with its schema. Accepts YAML or JSON: a base document (`schemaVersion` and `entries`) or a standalone entry (`id` and `kind`). Returns errors, warnings and documentation suggestions, each tagged with its rule id, or confirms the document is valid. Use this at any point while authoring.

ParameterTypeDescription
document *stringThe DSDS document as a JSON or YAML string.
filePathstringOptional: the absolute path this document was read from. Turns on DSDS-11 (relative `sourceFiles`, `source`, `rel: file` and `rel: source` paths exist on disk) and lets refs resolve across the files i…

dsds_style_check

Check a DSDS document against the authoring style guide (STYLE_GUIDE.md), which governs the ORDER things appear in. Field order (every object's fields, and combos by subject) has one right answer, so this runs the spec's own formatter, dsds-format, and returns the reordered document: it moves lines and keeps comments. Reading order is three advisory rules that report rather than fix, since an author can have a reason to break them: DSDS-18 (sections), DSDS-19 (guideline items by level) and DSDS-21 (entries by kind), each with a JSON pointer. Ordering never affects validity, so this is separate…

ParameterTypeDescription
document *stringThe DSDS document as a YAML string (a base document, or a standalone entry file).
suggestbooleanInclude the reordered document when its field order is off (default true). Set false to only say whether it needs reordering.

dsds_list_entities

List every entity across your loaded DSDS files with its identifier, status and a one-line summary. This is the whole catalogue and it does not change during a session — call it ONCE, keep the result, and look entities up directly from then on. Pass summaries:false for a bare identifier index. Use dsds_search_entities to filter, or dsds_get_entity for full detail.

ParameterTypeDescription
limitintegerMaximum entities to list per kind. Omit for all of them.
nextCommandsbooleanAppend the follow-up call that reads each result in full. Default false. Measured: with this on, the agent treated the listing as a worklist and made 13% more dsds_get_agent_context calls, adding ~30k…
summariesbooleanInclude a one-line summary per entity. Default TRUE. The summary is what lets you decide which entities you need without opening each one; measured: dropping it saved ~12k characters here and cost ~30…

dsds_get_entity

Get the full documentation for a specific entity by its identifier or name. Returns all metadata and documentBlocks. Use dsds_get_document_block if you only need one section.

ParameterTypeDescription
identifier *stringThe entity identifier (e.g. "button") or name (e.g. "Button"). Case-insensitive.

dsds_search_entities

Search and filter entities across your DSDS files. All parameters are optional — omit any to skip that filter.

ParameterTypeDescription
kindstringFilter by entity kind: component, token, theme, system, entry, or a namespaced custom kind (e.g. "sanity.guide", "sanity.chunk") — check dsds_list_entities for the kinds actually loaded.
limitintegerMaximum results to return. Omit for all matches.
nextCommandsbooleanAppend the follow-up call that reads each result in full. Default false. Measured: with this on, the agent treated the listing as a worklist and made 13% more dsds_get_agent_context calls, adding ~30k…
querystringCase-insensitive text search across identifier, name, summary, kind, and tags. Multi-word queries match entities containing every word, in any field and any order ("primary button", "confirmation dial…
statusstringFilter by lifecycle status, e.g. "stable", "beta", "deprecated". Any status word a document uses is accepted; dsds_list_entities shows the ones in use.
summariesbooleanInclude a one-line summary per result. Default false. Summaries are the single largest part of a result row, so leave this off when you are resolving a name and turn it on when you are deciding betwee…
tagsarrayFilter to entities that have ALL of the given tags.

dsds_get_document_block

Get a specific document block from an entity (e.g. just the "api" block from "button") without retrieving the full entity. Useful for targeted lookups when building with the design system.

ParameterTypeDescription
blockType *stringThe document block type to retrieve (e.g. "api", "accessibility", "anatomy", "variants").
identifier *stringThe entity identifier or name.

dsds_get_agent_context

Get the agent-facing context for an entity — its agent-only document blocks (agentDocumentBlocks), the props table, and the hard constraints from its guidelines. This is the most LLM-optimized content in a DSDS document. Use it to understand the rules and edge cases for an entity before building with it. Returns a compact view by default (agent rules + props); pass verbose:true only if you need the full human documentation (use-case prose, sections, code examples). Pass every component you are about to use in one call: `identifier` takes a list, and each entity is returned in its own section…

ParameterTypeDescription
identifier *arrayEntity identifiers or names, e.g. ["button", "card", "text"]. A single string is accepted too.
verbosebooleanDefault false. When false, returns only the agent-optimized blocks and the props table (much smaller). Set true to also include the full documentation blocks (sections, use-case prose, examples).

dsds_get_chunk

Get a chunk by identifier, rendered for agent use. Returns the code block (ready to copy), guidelines, use cases, and its relationships (uses / alternative-to edges). Use this instead of dsds_get_entity when working with chunk entities.

ParameterTypeDescription
identifier *stringChunk identifier (case-insensitive, kebab-case).

dsds_get_tokens

Look up design tokens and their values: the pixel size of a spacing step, a radius, a type style, a color. Values come from the DTCG token files the documentation references, so they are the values the package ships. Pass `names` for specific tokens (`space-3`, `--radius-2`), `group` for a whole scale (`space`, `radius`, `typography`, `heading`, `blue`), or `query` to search. Call with no arguments to list the groups.

ParameterTypeDescription
groupstringA token file (`space`, `radius`, `container`, `shadow`, `typography`, `color`, `font-weight`, `font-family`) or a name prefix (`heading`, `body`, `blue`).
namesarrayToken names, with or without the CSS `--` prefix: ["space-3", "--radius-2"].
querystringCase-insensitive text matched at word starts in token names and descriptions.

dsds_lint

Lint code against the design system's own ESLint rules. Returns findings only, never a rewritten file: each finding that needs a change from you, and for fixable ones the exact lines to edit (or, where the host applies fixes itself, a note to leave them alone). Re-emit only the files you change. Pass `path` (or `files: [{path}]`) for code already written to disk — preferred, since you never re-send contents. Pass `code` for a source string not yet on a disk. Nothing is ever written, created, or modified (the `apply` flag, for harness use, is the sole exception). A missing path returns an err…

ParameterTypeDescription
applybooleanHarness/automation only: write auto-fixed code back to disk (lint as a non-skippable gate). Agents make the listed line edits instead.
cacheKeystringSingle-file mode: cache key from a previous call. Pass instead of `code`.
codestringSingle-file mode: source code to lint, when the file is not on disk.
filenamestringSingle-file mode: filename for parser inference (e.g. 'Component.tsx').
filesarrayLint several files in one call. Each entry carries either `path` (on disk) or `code` (a string).
pathstringSingle-file mode: path to a file on disk, relative to the lint project root.

dsds_check_exports

Check whether specific components or exports actually exist in a configured package. Use this before importing a component — catches cases where docs describe a component that the package has not yet shipped. Icons are checked too: pass an icon name (`CogIcon`) to get the subpath to import it from, or a subpath import specifier (`@sanity/icons/Cog`) to confirm it exists. Read-only: returns which names exist; does NOT modify packages, install anything, or write files. Requires PACKAGE_EXPORT_PATHS to be configured.

ParameterTypeDescription
components *arrayComponent, export or icon names, or subpath import specifiers, e.g. ["Box", "TextInput", "CogIcon", "@sanity/icons/Cog"].

dsds_find_icon

Find the icon for a purpose — "resolve", "reply", "settings", "show more" — from the design system's icon guidelines. Returns the best matches for each purpose with the subpath to import from, what each icon is for, and when not to use it. Use it before guessing an icon name. Read-only. Reads the docs' icon asset entry (`kind: dsds.asset`, `assetType: icon`) when one is loaded, else an icon guidelines TSV (ICON_GUIDELINES_PATH).

ParameterTypeDescription
purposes *arrayWhat each icon is for, in plain words, e.g. ["resolve", "reply", "settings", "show more"]. A single string is accepted too.

dsds_explain_error

Explain a raw TypeScript/build error and return an actionable fix hint, not just the error text. Matches common, generic mistakes: an invalid/nonexistent prop, a missing required prop, a boolean prop given a string, a number given where a CSS string is expected, an implicit-any parameter, and editing scaffold/config files that should be left alone. Call this reactively right after a build or typecheck fails — paste the full error output — or proactively before writing code, to check whether a pattern you are about to use is a known gotcha. Read-only: never modifies files, never requires DS…

ParameterTypeDescription
error *stringRaw error text — TypeScript compiler output, console errors, or both concatenated. Paste as much as you have; matching does not require a specific format or a single error.

dsds_list_skills

List the DSDS authoring skills bundled with this server, for the bundled spec version — name and description only. Call dsds_get_skill with an id from this list to read the full skill. These are the actual skills from the design-system-documentation-schema repo, vendored at the same release as the schema, not generated from this server's own knowledge.

dsds_get_skill

Get the full content of a DSDS authoring skill by id (see dsds_list_skills for the available ids), for the bundled spec version. Returns the skill verbatim — the same content the design-system-documentation-schema repo's own agents use, not a summary or a paraphrase.

ParameterTypeDescription
id *stringSkill id, e.g. "dsds-add", "dsds-update", "dsds-validate", "dsds-specs".

dsds_feedback

Submit feedback on how well the DSDS MCP worked during this session. Call this at the end of any session where you used DSDS tools. Your input directly improves the documentation and tooling.

ParameterTypeDescription
rating *integerOverall usefulness: 1 (not helpful) to 5 (very helpful).
commentstringAny other observations.
confusingarrayWhat was unclear, missing, or incorrect.
helpfularrayWhat worked well — specific tools, content, or guidance that was useful.