@domphy/mcp
v0.19.7
Published
Domphy MCP server - exposes patches, packages, rules, and the doctor to MCP-capable AI agents
Maintainers
Readme
@domphy/mcp
domphy.com · Docs · npm
A Model Context Protocol server that gives MCP-capable AI agents (Cursor, VS Code, and any MCP-compatible client) first-class access to Domphy — so they can look up the real API and validate their own output instead of guessing.
Tools
| Tool | Does |
| --- | --- |
| domphy_list_patches | every @domphy/ui patch with host tag + signature |
| domphy_get_patch | one patch's full contract (host tag, signature, props, example, doc, source) |
| domphy_list_packages | all @domphy/* packages with versions + descriptions |
| domphy_rules | the Domphy code-generation rules (llms.txt) to follow |
| domphy_tones | the valid tone names + theme color names for themeColor()/dataTone |
| domphy_diagnose | run @domphy/doctor on a JSON element tree and return issues to fix |
| domphy_validate | run the doctor's aggregate validate() — returns { ok, issues, summary } with severity counts |
| domphy_fix | apply the doctor's lossless autofix — returns { tree, applied, report } (only provably-safe fixes applied) |
| domphy_list_app_blocks | list the current app's OWN reusable Domphy blocks from its app-manifest.json |
| domphy_get_app_block | get one app block's full source + signature + jsdoc, by name |
Patch/package/rules/tones data is fetched live from domphy.com (always current with the latest release); domphy_diagnose/domphy_validate/domphy_fix run locally, and the app-block tools read the local app-manifest.json.
Every tool is advertised with MCP ToolAnnotations — readOnlyHint: true, destructiveHint: false, idempotentHint: true, and openWorldHint set per tool (true for the five that fetch from domphy.com, false for the five that only touch local input). Nothing here writes, so clients that honour the hints can auto-approve the calls.
Programmatic tools (@domphy/mcp/tools)
The same implementations the MCP server calls are exported for in-process use (tests, scripts, other hosts):
import {
loadManifest,
diagnoseTree,
validateTree,
fixTree,
listAppBlocks,
getAppBlock,
readBlockSource,
} from "@domphy/mcp/tools"Use
Cursor
Add to .cursor/mcp.json:
{ "mcpServers": { "domphy": { "command": "npx", "args": ["-y", "@domphy/mcp"] } } }Once connected, the agent can call domphy_get_patch/domphy_rules before writing code and domphy_diagnose after — the self-correction loop that lets it write correct Domphy despite thin training data.
Set DOMPHY_ORIGIN to point at a different docs origin (e.g. a preview deploy).
