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
npx @sonojs/ui@latest mcp init
Flags
npx @sonojs/ui@latest mcp init --dry-run
npx @sonojs/ui@latest mcp init --client cursor
npx @sonojs/ui@latest mcp init --all

What gets written

Launch command in every client config:

mcp.json (Cursor / Claude)
{
  "mcpServers": {
    "sonojs": {
      "command": "npx",
      "args": ["-y", "@sonojs/ui@latest", "mcp"]
    }
  }
}
  • 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 query
  • get_component — summary, deps, file list
  • get_add_command — exact npx @sonojs/ui@latest add … plus Also-needs style npm hint

Registry URL follows SONOJS_REGISTRY / --registry (default https://sonojs.com/r).

Verify

  1. Run mcp init in your app root.
  2. Reload MCP in the client (see tips below).
  3. Ask the agent to list or search SonoJS components, or call get_add_command for button.

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