Skip to content

MCP Server

grimorio includes an MCP (Model Context Protocol) server that exposes your design system to AI assistants. The server itself does not use AI -- it provides structured access to your specs, tokens, validation, and action tools.

Starting the server

bash
grimorio mcp:serve

The server communicates over stdio, following the MCP protocol.

Tools (16)

Read tools

ToolDescription
list_componentsLists all component specs in the project
get_componentReturns the full spec for a named component
get_component_sourceReturns the source code of a component
get_tokensReturns design tokens, with optional filtering by prefix and $type. Includes $type, $description, and $deprecated in the response
validate_usageValidates component usage against its spec. Returns actionable suggestion per issue
find_componentSearches for components matching a query
get_component_guidelinesReturns guidelines as a markdown checklist

Action tools

ToolDescription
init_projectInitialize grimorio in a project (config, specs dir, tokens)
add_componentAdd a component spec from a preset or skeleton
infer_specInfer a component spec from source code via static analysis
validate_componentValidate a component file against its spec (reads file from disk)
validate_tokensValidate tokens schema + cross-reference with specs
export_tokensExport tokens to CSS, SCSS, JS, or Tailwind format
update_specCreate or update a component spec (validates before writing)
import_from_figmaImport a component spec from a Figma file URL
validate_figmaValidate a Figma component against an existing spec

Prompts / Skills (4)

Pre-built workflows that AI clients can follow using grimorio tools:

PromptDescription
enrich-specEnrich a spec with accessibility, tokens, and guidelines
generate-componentGenerate component code from a spec
review-systemReview overall design system health
audit-accessibilityAudit a component's accessibility against WAI-ARIA best practices

Prompts contain domain knowledge (what makes a good spec, a11y patterns, token mapping). The AI client reads the prompt and uses grimorio tools to execute the workflow.

Resources (2)

ResourceDescription
design-system-overviewOverview of the design system -- components, tokens, structure
implementation-guideSystem prompt for AI agents implementing components

Client configuration

The MCP server works with any MCP-compatible client. The configuration is the same for all -- use npx to run grimorio from your project's local dependency:

Claude Desktop / Claude Code / Cursor / Windsurf

json
{
  "mcpServers": {
    "grimorio": {
      "command": "npx",
      "args": ["grimorio", "mcp:serve"]
    }
  }
}

INFO

The MCP server reads your grimorio.config.ts to find specs and tokens. Make sure the config is set up before starting the server. Run npx grimorio init if you haven't already.

Use cases

The MCP server enables AI assistants to:

  • Enrich specs -- add accessibility, guidelines, and token mapping via the enrich-spec prompt
  • Generate components -- create code from specs via the generate-component prompt
  • Review system health -- audit the overall design system via the review-system prompt
  • Audit accessibility -- check a component against WAI-ARIA via the audit-accessibility prompt
  • Look up specs and tokens -- query component specs and design tokens inline
  • Validate code -- check that implementations match their specs

Since the server exposes deterministic data and tools, it acts as a bridge between your design system and AI clients without introducing AI-specific logic.