@moonarc/mcp
v0.1.0
Published
MCP server and CI CLI for Moonarc: search the catalogue by intent and byte budget, read a component's craft notes and source, get the install command; with a Pro key, audit motion in your codebase, measure per-route JS of your build, and compose sections.
Maintainers
Readme
@moonarc/mcp
MCP server for Moonarc. Local, stdio, no account.
claude mcp add moonarc -- npx -y @moonarc/mcpCursor, VS Code and Codex take the same command in their own config files: moonarc.dev/mcp has each one.
Tools: search_motion(intent, max_js_bytes?, tier?, limit?), get_component(name),
get_install_command(names, method?), get_usage(). The catalogue is bundled
at publish time. MOONARC_CATALOG_URL reads a catalogue of the same shape from
a URL instead, a mirror or a test's; when that URL fails, takes over 5 s or
answers another shape, the bundled copy answers.
Pro
With a Pro key in MOONARC_KEY, three more tools appear: audit_motion(paths, format?),
measure_budget(dist, ceiling?, base?, format?) and compose_section(intent).
The server asks Polar whether the key is valid and keeps a definite answer for
the life of the process. Without a key and without MOONARC_CATALOG_URL, it
makes no network request.
The client starts the server, and most clients pass it only a few of your environment variables, so put the key in the client's config:
- Claude Code:
claude mcp add --env MOONARC_KEY=<your key> --transport stdio moonarc -- npx -y @moonarc/mcp(keep an option between--envand the name, or the CLI reads the name as another variable) - Cursor, in
.cursor/mcp.json:"env": { "MOONARC_KEY": "${env:MOONARC_KEY}" }besidecommand - VS Code, in
.vscode/mcp.json: an input{ "type": "promptString", "id": "moonarc-key", "password": true }and"env": { "MOONARC_KEY": "${input:moonarc-key}" } - Codex, in
~/.codex/config.toml:env_vars = ["MOONARC_KEY"]under[mcp_servers.moonarc]
get_usage tells you which plan the server validated.
The same package runs the audit and the byte meter as commands, for CI:
npx -y @moonarc/mcp audit src
npx -y @moonarc/mcp measure dist --ceiling 30000audit exits 1 when it finds an error. measure reads the folder astro build
wrote (a server build's dist/client is found by itself), takes --ceiling in
raw bytes per page and --base when the site sets one, and exits 1 when a page
is over the ceiling. Both exit 2 on a usage mistake, a refused key or a folder
that is not a build.
