CLI and MCP
The midna command does from a shell what the app does with clicks. It’s mostly for agents, but it works for you too. Inside a midna terminal it’s always on PATH.
midna help # every verbmidna <verb> --help # one verb, including which steps are human onlymidna capabilities # what you can do, and what only the human canAdd --json to any verb for machine-readable output. Exit codes: 0 ok, 1 refused or failed (the message says what to do next), 2 bad arguments, 3 daemon unreachable.
Every connection to midnad gets a role. The Midna app is the human. Everything else, including midna typed in any terminal, is an agent. So midna rules remove … from a shell doesn’t remove the rule; it asks you in the app. A process can’t prove it’s you, so anything only you may do goes through the GUI. midna info shows the role you got.
Common commands
Section titled “Common commands”# Look aroundmidna info # version, role, current terminalmidna list # terminals and their statusmidna get <id> # one terminal: status, reason, cwd, agent infomidna needs # what's waiting on the humanmidna needs wait <n_id> # block until the human answers one itemmidna explain <id|topic> # why something is the way it ismidna events --follow # stream everything that happens
# Terminalsmidna open --name tests --monitor 'cargo test --watch'midna open --agent claude --prompt "Fix the flaky test in api"midna send <id> 'ls -la' # type text and press Entermidna key <id> ctrl-cmidna read <id> --lines 100midna restart <id> --idle # restart once the agent is idlemidna close <id>midna close <id> --force --no-wait # don't wait for approval: prints the needs-you id, exits 4midna queue add --after <id> "now run the integration tests"
# Getting the human's attentionmidna attention "Need the staging API key to continue"midna notify send "CI is green" --detail "api#412"
# Rules, triggers, settingsmidna check tool 'Bash(rm -rf build)'midna rules add deny command 'git push --force*'midna rules request-removal r_9f8e7d --reason "blocks the release script"midna triggers add … # see Triggersmidna settings set theme nordThe API underneath
Section titled “The API underneath”Every verb calls one method in midna’s catalog, served as JSON-RPC over a Unix socket. You can list and call methods directly:
midna schema --list # one line per methodmidna schema rule.add # one method's description and JSON Schemamidna schema # the whole OpenRPC documentmidna call session.scroll '{"id":"ab12cd34","to":"top"}'midna skill prints the guide agents get.
MCP server
Section titled “MCP server”midna mcp is a stdio MCP server with the same abilities as the CLI. Both go to the same daemon with the same checks.
Agents midna starts get it automatically, for that agent only (--mcp-config for Claude Code, -c mcp_servers.midna… for Codex). Turn that off with agents.mcp. For any other client:
{ "mcpServers": { "midna": { "type": "stdio", "command": "midna", "args": ["mcp"] } }}Every catalog method is a tool, with _ instead of . (session_open, rule_add, settings_set), plus capabilities, explain and guide. Human-only tools say so in their description; calling one raises a Needs you request instead.
When midna refuses a call, the tool result is an error the model can read, with the next step:
rule.remove is human only; use rule.request_removal to ask the human