mcp

v0.2.0-beta.10
@keystoneui/mcp Checked 2 days ago Published 1 day ago

MCP server and CLI for Keystone UI — lets AI agents and shell users discover, search, view, and install components, blocks, and named examples.

MCP server and CLI for Keystone UI — lets AI agents and shell users discover, search, view, and install components, blocks, and named examples from the Keystone UI registry. Supported clients: claude, cursor, vscode, opencode, codex. The init command writes the appropriate config file for the chosen client and points it at npx @keystoneui/mcp@latest. The server runs with the settings of the project it starts in. Before using it in a project you have not reviewed, read Projects you do not trust.

Summary extracted from the README.

@keystoneui/mcp

MCP server and CLI for Keystone UI — lets AI agents and shell users discover, search, view, and install components, blocks, and named examples from the Keystone UI registry.

The single binary runs in two modes:

  • No args → Model Context Protocol stdio server (for Claude Code, Cursor, VS Code Copilot, OpenCode, Codex)
  • With a verb → CLI for shells, CI, and non-MCP environments

Quick start

As an MCP server

npx -y @keystoneui/mcp@latest init --client claude

Supported clients: claude, cursor, vscode, opencode, codex. The init command writes the appropriate config file for the chosen client and points it at npx @keystoneui/mcp@latest.

The server runs with the settings of the project it starts in. Before using it in a project you have not reviewed, read Projects you do not trust.

Once configured, ask your agent things like:

  • "List Keystone UI components."
  • "How do I add a Keystone UI Table with pagination?"
  • "Build a sign-in page using Keystone UI."

As a CLI

# Discover
npx @keystoneui/mcp search "table pagination"
npx @keystoneui/mcp list --type example
npx @keystoneui/mcp blocks signin

# Inspect
npx @keystoneui/mcp view button
npx @keystoneui/mcp docs button             # /llms.mdx/docs/components/button
npx @keystoneui/mcp examples table          # all demo files for the table component

# Install (delegates to shadcn CLI)
npx shadcn@latest add https://keystoneui.io/r/table-with-pagination.json

# Verify
npx @keystoneui/mcp audit

# Theme (a code from https://keystoneui.io/theme-builder)
npx @keystoneui/mcp theme k1_slate_0.55_0.2_262.5_large_inter

Verbs

Verb Purpose
init [--client <name>] Configure MCP client
search <query> [--type T] [--limit N] Fuzzy search components, blocks, kits, named examples
list [--type T] [--limit N] [--offset N] List items (T = ui | block | example | kit | hook | style | theme | item)
view <name> [<name>...] Show the source of components, blocks, kits or package flavours
examples <name> All demo files for a component or block
docs <name> [--type component|block] Fetch the LLM-resolved MDX page (/llms.mdx/docs/{components|blocks}/<name>); a kit or package flavour resolves to the section that documents it
audit [--theme [css]] [--strict] Print the post-install checklist, or measure every text/surface token pair in your theme against WCAG AA
blocks [<filter>] List or filter full-page blocks; an exact block name views it. Kits are listed with list --type kit
theme <code> [--only theme,font] Decode a theme-builder code and print its shadcn add command

Run keystoneui help for the full list. Without any verb the binary launches the MCP stdio server.

MCP tools

When run without arguments the server exposes nine tools to MCP clients:

  • get_docs — full docs page for a component, block, kit, or package flavour, including its API Reference
  • get_project_context — install mode, aliases, theme CSS file, icon library, RSC
  • list_components — list components, blocks, kits, or examples with pagination
  • search_components — fuzzy search across components, blocks, kits, and examples
  • view_component — full source for one or more components, blocks, kits, or package flavours
  • get_add_command — generate the shadcn CLI command for installing components; flavour: "package" picks a block's or kit's package flavour for an app on @keystoneui/react
  • get_examples — fetch live demo files for a component or block
  • get_theme_info — semantic color tokens, radius scale, dark-mode setup
  • audit_checklist — post-install verification checklist

Configuration

The server reads the registry URL in this order:

  1. KEYSTONEUI_REGISTRY_URL env var
  2. registries["@keystoneui"].url from a local components.json
  3. Default: https://keystoneui.io/r

License

MIT