rakumux-mcp is a Model Context Protocol server (stdio) that
lets coding agents see and drive Rakumux sessions and their folders. It talks to the
local HTTP API, which it starts on demand, and the API talks to the
Rakumux server.
rakumux-mcp next to rakumux. Use its absolute path where you can
(command -v rakumux-mcp).
Add it to your agent
- Claude Code
- Codex
- OpenCode
Tools
A session’s folder is the directory it was started in.- A
sessionargument takes an id or a name. Names are unique only within a folder, so an ambiguous name is an error listing the candidates. - A
folderargument is an absolute path (~/allowed) or the name of a known folder. - Without
folder, an agent inside a Rakumux session sees its own folder; outside a session every folder is listed.
Untrusted output
Terminal text and anything a session wrote about itself are data, not instructions. The server returns them sanitized (escape sequences, control and invisible characters removed), capped, and inside a block marked untrusted with a random nonce, so the text can’t close its own block:Identity
WhenRAKUMUX_SESSION_ID and RAKUMUX_SESSION_TOKEN are both set (Rakumux sets them in every
session), the server acts as that session: confined to its own folder, as described in
What agents may do. Without them it acts as you.
Whether the variables reach the MCP server depends on the agent:
- Claude Code is expected to pass its environment to the servers it starts.
- Codex forwards only the variables listed in
env_vars. - OpenCode 1.x starts MCP servers inside each TUI, so they get the variables.
- OpenCode 2.x runs MCP servers in a background service shared by every conversation, so they don’t. The Rakumux plugin binds each conversation it shows to its Rakumux session, and the server acts as the session that bound the conversation. Without the plugin, calls act as you.
How it finds the API
The server reads~/.rakumux/api.json and uses the API there if it’s running; otherwise it starts
rakumux-api --detach. The API starts the Rakumux server on the first request if none runs. Logs
are in ~/.rakumux/logs/api.log and ~/.rakumux/logs/ptyd.log.