MCP Server
Let AI agents review DryUI Svelte components, fetch composed-output source, and diagnose DryUI theme CSS via the Model Context Protocol.
What is it?
@dryui/mcp is a standalone MCP server that exposes three tools to any compatible AI agent:
Validate Svelte component source against the DryUI spec. Returns structured JSON issues (compound component usage, prop/part mismatches, accessibility/style suggestions).
Retrieve copyable Svelte source for a composed output from the DryUI catalog.
Diagnose DryUI theme CSS for missing tokens, value errors, and contrast/visibility issues. Returns a JSON theme report.
Current scope
MCP now covers validation plus composed-output source retrieval. Keep setup and component scaffolding in the CLI, and use the docs pages when you want the same workflows in a browsable UI.
Installation
Install the MCP server package in your project.
bun add @dryui/mcpAgent setup
Standardize on one of these primary setups. Each uses the same @dryui/mcp package, but the config file path varies by
client.
Use the bundled DryUI skill for conventions and add the MCP server when you want review and diagnose tools in the same session.
DryUI skill
From a clone of the dryui repo, link the bundled skill into Codex's skills directory (`$CODEX_HOME/skills`).
mkdir -p "$CODEX_HOME/skills"
ln -sfn "$(pwd)/skills/dryui" "$CODEX_HOME/skills/dryui"MCP config
Append the MCP server block to your Codex config file (project-scoped or global at ~/.codex/config.toml).
[mcp_servers.dryui]
command = "npx"
args = ["-y", "@dryui/mcp"]Codex setup
Restart Codex after linking the skill so it picks up the updated agent setup.
Other MCP clients
The docs site standardizes the main setup flow around Codex, Claude Code, and Cursor. Windsurf, VS Code/Copilot, Zed, and other
MCP clients can still connect to @dryui/mcp with their client-specific config formats.
Review tool
The review tool validates Svelte component source code against the DryUI spec and returns a
JSON report of issues (and a summary).
Input
// Provide the Svelte source code as code
// Optional: filename, and projectCss with --dry-* overrides
{
code: "<Svelte source>",
filename?: "src/components/Button.svelte",
projectCss?: ":root{--dry-color-...: ...}"
}What it checks
- Bare compound components (<Card> instead of <Card.Root>)
- Unknown components / invalid props / invalid parts
- Missing accessible labels / accessible wrappers
- Missing theme CSS import warnings (when applicable)Why review?
Review is ideal when an agent needs “is this DryUI-correct?” feedback before generating new code.
Diagnose tool
The diagnose tool checks DryUI theme CSS for missing tokens, value errors, and contrast/visibility issues.
Input
// Provide either raw CSS as css or a file path as path
{
css?: "<css with --dry-* overrides>",
path?: "src/themes/custom.css"
}What it checks
- Missing required --dry-color-* semantic tokens
- Wrong value types (e.g. length where a color is expected)
- Low contrast / transparency / visibility problems
- Unresolvable var() references and dark/light inconsistenciesSource browsing
When you need copyable source rather than validation, use the get tool or the equivalent docs/CLI surfaces. Keep setup and component scaffolding in the docs site and CLI.
Getting Started covers theme bootstrap, local linking, and SvelteKit form validation patterns.
Components is the detailed API surface with props, structure notes, CSS hooks, and examples.
get returns raw composed-output source, while the Blocks, Templates, and Starter kit pages expose the same source in a browsable UI.
LLM docs
Pair the MCP server with static LLM endpoints when an agent needs broad DryUI context before it starts calling tools.
Detailed component imports, props, styling hooks, and example snippets.
/llms-components.txtRetrieval before tooling
Use the static LLM docs to prime an agent with library-wide knowledge, then let MCP handle validation and diagnosis.
Example prompts
These are prompts you can give to an AI agent that has the dryui MCP server connected.
The agent will call the review / diagnose tools automatically.
"Review this Svelte file for DryUI spec compliance and accessibility issues."
The agent uses the review tool and returns issues with line numbers.
"I customized my theme CSS. Diagnose it for missing tokens and contrast problems."
The agent uses the diagnose tool and returns a theme diagnosis report.
"Review my component and also check whether my project theme CSS could make it invisible."
The agent uses review and (when provided) auto-diagnoses projectCss alongside the component.
Works with any MCP client
Any agent that supports the Model Context Protocol can connect to @dryui/mcp —
Claude Desktop, Claude Code, Cursor, and others.