MCP Server
SonoJS ships an MCP stdio server inside @sonojs/ui. Agents can list, search, and inspect registry items, then get the exact add command — no silent file writes.
Init
Auto-detects MCP clients in the project and home directory, then upserts a merge-safe sonojs server entry. If nothing is detected, writes Cursor .cursor/mcp.json by default.
Terminal
Flags
What gets written
Launch command in every client config:
mcp.json (Cursor / Claude)
- Cursor — project
.cursor/mcp.json - VS Code / Copilot — project
.vscode/mcp.json - Claude Desktop — user
claude_desktop_config.json - Claude Code — project
.mcp.json - Codex —
~/.codex/config.toml - Windsurf — Windsurf MCP config under
~/.codeium/windsurf/
Only the sonojs key is upserted; other servers are left alone. Re-running is idempotent (~ already configured).
Tools
list_components— registry index (name, title, type)search_components— filter by queryget_component— summary, deps, file listget_add_command— exactnpx @sonojs/ui@latest add …plus Also-needs style npm hint
Registry URL follows SONOJS_REGISTRY / --registry (default https://sonojs.com/r).
Verify
- Run
mcp initin your app root. - Reload MCP in the client (see tips below).
- Ask the agent to list or search SonoJS components, or call
get_add_commandforbutton.
Reload tips
- Cursor — Settings → MCP, or restart Cursor
- VS Code — reload the window
- Claude Desktop — fully quit and reopen
- Codex / Windsurf / Claude Code — restart the client