CLI
mu is a registry-driven command-line interface for the Mu platform. It’s a thin HTTP client that talks to any Mu instance’s /mcp endpoint — every MCP tool is automatically available as a subcommand, so adding a new tool on the server side adds a new CLI command for free.
The CLI and the server share the same binary. Running mu --serve starts the server exactly as before; running mu with anything else is treated as a CLI invocation and never touches server state.
Install
The same mu binary runs the server and the CLI.
git clone https://github.com/micro/mu
cd mu && go install
Or grab a prebuilt binary from the releases page.
Quick start
mu # show help
mu help # live list of all available tools
mu news list # latest headlines
mu news search "ai safety" # search news
mu chat "hello, what's up?" # chat with the AI
mu agent "summarise today's markets" # run the full agent
mu web search "claude code"
mu markets list --category stocks
mu weather forecast --lat 51.5 --lon -0.12
mu apps search "pomodoro"
mu wallet balance # your credits (requires a token)
A tool is named service_method over the wire and typed as two words: the
service, then what to do with it. The underscore form still works — mu news
list and mu news_list are the same call — so nothing written before this
stops working.
Everything after the tool name is flags that map directly to the tool’s parameters.
Authentication
Most tools work without auth (news, markets, weather, blog reads, etc.). Anything that creates content, spends credits, or reads personal data needs a token.
Option 1 — browser login
mu login
Opens /token in your browser. Sign in to Mu, create a Personal Access Token, paste it back into the terminal. The token is saved to ~/.config/mu/config.json with mode 0600.
Option 2 — paste directly
Works in SSH sessions, containers, or anywhere without a browser.
mu config set token <TOKEN>
Option 3 — environment variable
For CI, scripts, or ad-hoc use:
export MU_TOKEN=<TOKEN>
mu wallet balance
Logout
mu logout
Clears the stored token. Env vars and --token flag overrides are unaffected.
Pointing at a different instance
By default the CLI talks to https://micro.mu. To point at your own self-hosted instance:
# Persistent
mu config set url https://mu.example.com
# Per-invocation
mu --url https://mu.example.com news list
# Environment
export MU_URL=https://mu.example.com
Passing arguments
Flags map one-to-one with the tool’s parameters. Both forms are accepted:
mu news search --query "bitcoin"
mu news search --query=bitcoin
For a small set of well-known tools, a single positional argument is treated as the most obvious required parameter, so you can skip the flag name:
mu chat "hello" # same as --prompt "hello"
mu news search "bitcoin" # same as --query "bitcoin"
mu web search "claude code" # same as --query "claude code"
mu apps build "a pomodoro timer" # same as --prompt "..."
mu apps read hello-world # same as --slug hello-world
mu help <tool> prints the parameters a tool actually takes, which is the
authority — the list above is only the shortcuts.
Types
The CLI infers parameter types from the value:
| Value | JSON type sent |
|---|---|
true, false |
boolean |
42, -7 |
integer |
3.14, -0.12 |
float |
| anything else | string |
If you need to send a string that looks numeric, use --id=123. Bare flags (no value) are treated as booleans set to true:
mu apps create --name "Timer" --slug timer --html "..." --public
Output
Most tools return model-ready text — headlines, prices, a forecast — written
to be read by a model or a person, not parsed. The db_*, files_* and
apps_read tools return JSON, and that is where the JSON formatting below
applies.
Automatic format
- Terminal (default) — pretty-printed, lightly coloured
- Pipe — compact, one object per line, so JSON results play nicely with
jq
mu news list # headlines as text
mu db list --collection notes # JSON
mu db list --collection notes | jq '.[0].data.title'
Forcing a format
mu --pretty news list | less # force pretty even when piped
mu --raw news # force raw even in a terminal
mu --table db_list --collection notes # render a list as a text table
--table renders list-shaped results as aligned columns, skipping long content fields (html, body, content) to keep the layout readable.
Global flags
These can appear before or after the tool name:
| Flag | Purpose |
|---|---|
--url URL |
Mu instance URL (env: MU_URL, default: https://micro.mu) |
--token TOKEN |
Session or PAT token (env: MU_TOKEN) |
--pretty |
Force pretty-printed output |
--raw |
Force raw/compact JSON output |
--table |
Render list results as a text table |
-v, --verbose |
Verbose logging |
Built-in commands
These aren’t MCP tools — they’re CLI-local commands:
| Command | What it does |
|---|---|
mu help |
Fetch the live tool list grouped by app |
mu help <tool> |
Show parameters and an example for a specific tool |
mu login |
Browser-based login (opens /token, pastes the PAT back) |
mu logout |
Clear the stored token |
mu config get |
Show the saved URL and whether a token is set |
mu config get <key> |
Print a single config value (url or token) |
mu config set <k> <v> |
Save a config value |
mu config path |
Print the path to the config file |
mu version |
Show the CLI version |
Common recipes
Today, in one place
mu news list; mu markets list --category stocks; mu weather forecast --lat 51.5 --lon -0.12
Weather for a postcode
mu places search "EC1A 1BB" # get lat/lon
mu weather forecast --lat 51.52 --lon -0.10
Build an app from a prompt
mu apps build --prompt "an expense tracker"
# → returns slug + URL you can open in a browser
Run the agent
mu agent "find me three interesting AI papers from the last week and summarise them"
Search, then read a result
mu web search "open source self-hosted email"
mu web fetch https://example.com/the-one-you-want # the page as clean text
How it works
The CLI is a self-contained package (internal/cli) that talks to an instance over HTTP and never touches server state. Every invocation:
- Loads
~/.config/mu/config.json, applies environment overrides, then flag overrides. - Parses the positional arguments as a tool name +
--flag valuepairs. - Builds a JSON arguments map with inferred types.
- Sends a
tools/callJSON-RPC request to<url>/mcp. - Formats the response and writes it to stdout.
The same path every MCP client uses. No duplicate code, no drift between CLI and MCP tools — when a new tool is added to the server, it’s immediately available on the command line.
Server deployment
The CLI doesn’t affect the server in any way. The binary still launches the server when you pass --serve:
mu --serve --address :8080
The dispatch logic looks for --serve in the arguments; anything else falls through to the CLI handler, which talks to /mcp over HTTP and returns an exit code. Existing server deployments continue to work unchanged.


