Skip to main content
By the end of this page an agent can call the tools of an MCP server you registered, only in the turns you allow, and you know how to check what it did. Ravi is the MCP client. Runtimes no longer load MCP servers from their own configuration files: a server is usable only when it is registered in Ravi, attached to the agent, and allowed for the turn by the same permission check every other tool passes. The daemon holds the connections; you need it running.

Register a server

An HTTP server:
A URL that carries a token (a bridge URL, a key in the query) is a secret. The command line refuses it: put it in a file and give it on stdin, so it stays out of your shell history:
Run it first without --execute, with the same redirection: the dry run reads and checks what stdin holds, and its plan shows the address with the token hidden (urlDisplay) and what was read (fromStdin), never a value. A value that cannot be used fails there (exit 2). Nothing is stored before --execute. A server that needs a login takes --auth oauth or --auth bearer. An OAuth server then signs in through the browser:
A bearer server reads its token from stdin, from a file:
Its dry run checks the token too and shows only that one was received (tokenReceived). ravi mcp login and ravi mcp import run only in your terminal on the host: a session turn, or the process of a cron job, a trigger or a job, is refused (CLI_ONLY_COMMAND). For an OAuth login Ravi opens the sign-in page in your browser. The sign-in address carries the server’s secret address, so Ravi prints it only on a terminal, never in --json output, a log or an error. Do not paste it into a chat or a ticket. Without a terminal, --paste is refused (INVALID_OPTION) before anything is sent. ravi mcp logout docs forgets the login and asks the server to revoke it; a new login revokes the login it replaces. The result says whether the server confirmed the revocation (revocation on logout, previousGrant on login: revoked, not_confirmed or not_offered); when it did not, the logout still happens. A login holds the scopes you allowed. When a tool needs one more (a server’s write scope, for example), only that call is refused: the answer names the missing scope, and the server’s other tools keep working. Log in again and allow it. A local (stdio) server runs as a child of the daemon, with only PATH, the environment keys you declare and a marker Ravi sets (RAVI_AUTOMATION_PRINCIPAL). The marker makes a ravi command the server runs an automation, never you at your terminal: every command that needs a permission is refused (PERMISSION_DENIED). The root commands outside the permission system (such as ravi doctor, ravi update, ravi login, ravi tui and ravi stream) do not read the marker, and an app’s own command (ravi <app> <operation>) is checked by that app’s permission. A key you declare with the same name does not replace it. Values come from stdin, never the command line. It needs the superadmin scope:
values.env holds one KEY=value line per declared key. The values go to the credentials store; the plan names the keys only. Every write that adds authority is a dry run first: run it without --execute to see the plan (exit 3), then again with it.

Bring over the servers your runtimes used to load

Before this, Claude Code and Codex loaded MCP servers from their own files (.mcp.json, ~/.claude.json, plugin manifests, Codex config.toml). They no longer do: an agent sees only the servers registered in Ravi and attached to it. ravi mcp import reads those files (it never changes them) and shows what it would register, for which agents:
Each imported server starts operator-only and is attached only to the agents whose runtime loaded it. Full URLs and environment values go to the credentials store. Two entries that end up with the same name need --as <old>=<new>; --skip <name> leaves one out. The import changes no grant. An agent sees an imported server’s tools only with use:tool:mcp__<name>__* (or a grant per tool) under the name the server is registered with. Agents on the default profile already hold it. For every other agent the plan and the result (grant.agentsWithout) give the exact ravi agents permissions ... --execute command that adds it, built from that agent’s current explicit list; nothing runs it for you. A chat-only agent gets a note instead, since it takes no tools at all. On Codex, a server that stays in config.toml after the import is turned off at each launch when its key is a plain name (letters, digits, - and _), so it may stay there. A key that contains a dot or needs quotes, such as [mcp_servers."my.server"], cannot be turned off that way: every Codex session on the host refuses to start until you delete that entry from ~/.codex/config.toml (or from the trusted project’s .codex/config.toml) by hand, even after ravi mcp import registered it. The session fails with:
ravi doctor reports servers a runtime’s own files still declare that no registered server covers, and the daemon writes the same list to its log once at start, one warning per file (names and paths only). It also warns about each such Codex entry by file and key, and says it must be removed, even once the import registered the server. For Codex it reads the files Codex loads for each agent’s directory: /etc/codex/config.toml, /etc/codex/managed_config.toml, $CODEX_HOME/config.toml and the .codex/config.toml of each trusted project folder from the repository root down to the agent’s directory; an untrusted project’s file is not reported, since Codex does not load it. ravi doctor also warns when Claude Code’s enterprise MCP configuration exists (/Library/Application Support/ClaudeCode/managed-mcp.json on macOS, C:\Program Files\ClaudeCode\managed-mcp.json on Windows, /etc/claude-code/managed-mcp.json on Linux): with it present, Claude Code refuses to start Ravi’s Claude sessions.

Attach it to an agent

An attachment starts with audience operator: the agent may use the server only in your own turns (your terminal, your own messages in a chat linked to your Console account, direct or group, your heartbeat and routines). When you ask in a group, the answer goes to that group. On an agent with the default profile, attaching gives it every tool of the server at once, writes included: its floor holds use:tool:* (see Grant the tools). To let it serve other people’s turns too:
A server holds one credential, yours. With audience any, everyone who may drive the agent acts with your login on that server. A server that holds a login or a secret URL and still speaks the older protocol revision stays operator-only, whatever the audience says.
ravi mcp detach, ravi mcp set --audience operator, ravi mcp disable and ravi mcp remove reduce authority, so they apply at once. remove also deletes the stored address and values (and the login) at once; Ravi cannot show them again, so keep a copy of a bridge URL elsewhere if you may need it.

Grant the tools

Each tool is named mcp__<server>__<tool>, and each call needs use:tool:mcp__<server>__<tool> in the turn, like any other tool. use:tool:mcp__docs__* grants every tool of docs. A bootstrap or full-access agent already holds use:tool:*, so it needs no grant: it may call every tool of every server attached to it, and run the commands below (ravi mcp tools, call, calls list|cancel and skills read), which are in the bootstrap floor. To choose servers and tools, give the agent explicit-only, which has no floor: list the runtime’s own way in with the tools.
Each line lets the agent list and call the github tools and follow or cancel its background calls, and no other ravi command or tool. On Codex any use:tool: grant also takes an explicit-only agent out of its read-only sandbox, so Codex’s own file edits and web search are on again (see Permissions). On Claude Code, following a background call and reading a pinned remote skill go through the shell, so add use:tool:Bash,execute:executable:ravi,read:mcp.calls:list,mutate:mcp.calls:cancel,read:mcp.skills:read if it needs them. Elsewhere, add read:mcp.skills:read for pinned skills (on Pi with use:tool:mcp_skills_read). See Permissions.

How each runtime reaches the tools

Claude Code loads MCP tools on demand through its ToolSearch tool. An agent on Claude whose ceiling lacks use:tool:ToolSearch may never find them; agents on the default profile hold it. ravi mcp show and ravi mcp attach read each agent’s ceiling and warn about every agent on Claude without it (an explicit-only agent that was not given it, or a chat-only one); grant it with ravi agents permissions <agent> ... --capabilities 'use:tool:ToolSearch,...'.
The agent’s side, as taught by the mcp skill:
ravi mcp call waits 45 seconds by default (--wait, at most 110). Pi’s mcp_call tool waits at most 55 seconds. A call that takes longer continues in the background (below). ravi mcp tools and ravi mcp call run in the daemon, the dry run of a call too: without a running daemon they fail with MCP_DAEMON_REQUIRED (exit 1). The process of a shell trigger is refused (MCP_NO_TURN, exit 3): it is not a turn Ravi can identify, and it never acts with your terminal’s credential. The process of a job or of a local (stdio) MCP server is refused before that, like every ravi command it runs that needs a permission (PERMISSION_DENIED, exit 1). A shell cron job’s process carries its own short key, which holds only Bases, Pages and ravi self whoami, so the daemon refuses it the MCP commands (PERMISSION_DENIED, exit 1). One ravi mcp tools answer lists at most 100 tools and 96 KB of tool entries, with servers taking turns. When more matched, the answer counts what was left out per server and a note says how to see it: list one server (ravi mcp tools <server>) or narrow with --query. In chat, a call to one of these tools shows as MCP <server>: <tool>, with the names of its arguments and never their values. On Codex and Grok that holds for a shell line that is exactly one ravi mcp call of one server and tool, with plain arguments; any other shell line shows as a shell command. Such a line without --execute shows (dry run) after the tool, and --agent and --wait are named, without their values. If a server’s name is also the name of one of Ravi’s own built-in servers in a Claude session, the built-in one wins: the registered server is left out of that turn with a warning in the logs and a runtime.mcp_name_overlap event in the session trace.

When a server asks a question

A server may ask the person for a confirmation or a few fields before it changes something. Ravi asks only the person of the turn, privately (on Slack an ephemeral card that opens a private form, elsewhere their own direct chat), and only when that person holds the credential: you, for a server with your login. A turn with no person (a cron job, a trigger, a heartbeat, another agent) declines without asking anyone. Fields that look like secrets (passwords, tokens, codes, card numbers) are always declined, and Ravi never opens a link a server sends. In every question, Ravi’s first line names the server and the tool, the lines the server wrote start with > (a long text is cut at 12 lines) and field names sit in quotation marks, so a server cannot write lines that pass for Ravi’s own. The line that says how to answer is Ravi’s and always comes last. A write confirmation (one yes or no) is one question: Sim sends it, Não changes nothing. A form with more fields is asked field by field, then reviewed. The questions of one confirmation share 4 minutes, never more than the call waits; an unanswered question is cancelled and nothing changes. When Ravi answered for the person (nobody could be asked, nobody answered in time), the agent’s result starts with a line marked [Ravi note, not from the MCP server] that says so. Only Ravi writes that marker: if a server’s own text imitates it, the agent sees [text from the MCP server] in its place. If a confirmed change reached the server after its confirmation expired, the note says nothing changed and the tool must be called again only if the person still wants it. On WhatsApp, Telegram and Discord you answer by replying to (quoting) the question. That reply is only the answer: it is saved to the conversation without starting a turn, like a !! message, so a “Sim” never becomes a new request to the agent. In a Claude session, while a question asked by the agent’s own tool call is open, a new message to that session waits for it instead of cutting the turn; an explicit stop still stops it. Such a question closes with its turn: if the turn ends or is stopped first, an answer given afterwards is not sent and the server is told the question was cancelled. A call that goes to the background (below) takes its open question with it: the question stays open after the turn, and your answer still reaches the server.

Long calls run in the background

When a server answers with a task, or a call takes longer than the turn waits, the call leaves the turn: the agent gets a call id and the result arrives later in the same session as a new message. The agent must not call the tool again for the same request. A turn Ravi holds below the agent’s own permissions does not leave background calls: a contact limited to the chat’s grants, a thread or relay that comes from such a turn, or a person with no grant in the chat. The result of a background call arrives as a new turn with everything the agent may do, and those turns may not set that up. There the call ends when the wait ends: ravi mcp call and Pi’s mcp_call answer MCP_CALL_TIMEOUT, and a Claude turn reads that the call did not finish within its wait. The outcome on the server is unknown and the call is not sent again. A tool the server runs only in the background is refused by the server.
Your own turns and your terminal see and cancel every call. Any other turn sees and cancels only the calls of its own session on servers and tools it may use (the same check as making the call), and the turn that delivers a call sees that call. A cancel asks the server to stop the call; the server decides whether its work stops, and its answer may say what keeps running and which tool stops it. Work a server commits at once (a publish, for example) is rarely stopped by a cancel. A cancel is confirmed by one more read of the task: if the server had already finished, you get its result with a note.

Remote skills

A server that offers skills can lend them to an agent. Pinning reviews a manifest and its digest; the agent then reads the skill on demand, never a copy stored at pin time.
On Claude Code, the agent reads a pinned skill with ravi mcp skills read in its shell, so it needs the shell tool. skills list is yours only: it shows the organization’s skill catalog through your login, so any other turn is refused (OPERATOR_TURN_REQUIRED) before anything is sent. It pages with --limit and --offset (50 by default; total counts every skill). An id may end in /SKILL.md; it names the same skill. If your login lacks the server’s skills scope, the server lists nothing. The listing then says so (scopeMissing: true) and tells you to run ravi mcp login docs --execute and allow it. --external loads the skill on other people’s turns too. On a server whose audience is still operator, those turns cannot read it (MCP_AUDIENCE): the pin is made, but the plan and the result warn you and name ravi mcp set docs --audience any --agent main --execute. Every skills list, and the daemon on its own every 15 minutes, checks the pins against what the server lists:
  • a skill listed with another manifest: the pin turns stale (manifest_changed) and stops loading until you pin it again;
  • a skill missing from a listing that still holds other skills (it was unpublished), or that a read no longer finds (also while the server has its skills turned off): the pin turns stale (gone) and its stub stops loading;
  • a gone skill listed again with exactly the manifest you approved: the pin is active again by itself. Any other manifest needs a new pin.
An empty listing changes no pin: the server answers it for no skills, for skills turned off and for a login without the skills scope, and Ravi cannot tell them apart. Pins of skills the server no longer lists appear apart in skills list (unlistedPins), and ravi mcp show lists every pin with its state and reason. ravi mcp skills unpin <id> --agent main removes a pin at once. Each read, allowed or refused, is recorded in the session trace (mcp.skill: server, skill, file, size, cache or server, outcome and reason, never the content), and so is each pin Ravi marks stale or restores by itself.

File uploads

A server that takes files can receive files from the agent’s workspace. Uploads are off per attachment:
The agent then passes a file path where the tool takes a file. Before anything is sent:
  • the attachment must have uploads on, the server must be a modern HTTP server that takes files, and the agent must run on this host;
  • the turn must be allowed to read the file (use:tool:Read); the real path, after links are followed, must be in the agent’s workspace or a temp directory (unless the turn may run any program), must not be a runtime’s configuration or Ravi’s state directory, and must be a regular file with one name;
  • each file is at most 25 MB (even when the server takes larger ones), at most 100 MB and 10 files per call.
The temp directories are the system’s (/tmp, /private/tmp and the one the OS names), which every agent and program on the host shares. With uploads on, a turn that may read files can send any regular file there, another agent’s included, as well as its workspace. A refused file sends nothing (MCP_FILE_REFUSED). Files go only to an https storage address the server names, with nothing of the server’s login, never through a redirect. The storage host must be a host name, never an IP address, that resolves only to public addresses and presents a publicly trusted certificate: a server whose storage sits on a private network or uses a private certificate authority cannot take files from Ravi. After the upload, Ravi finishes the call once. If that last step fails in a way that leaves its outcome unknown, Ravi does not send it again: check on the server before you retry.

Check what happened

show reports the display URL (never a token), status and protocol era, the extensions the server declared, its tools and the tools it dropped (with the reason), the login (not_needed; logged_in, with when the access token expires and whether it is renewed on use; needs_login; or unknown when the credentials store cannot be read; never a token), the attachments, open background calls, the last rate-limit answer, every pinned remote skill with its state and stale reason, the tools an attachment with uploads sees, and warnings. The daemon keeps each server’s tool list and checks it again on its own. It looks for lists due a check every 15 minutes: when the server says how long its list stays fresh (the newer protocol revision sends this), the list is checked at the first look after that time; otherwise once a day. A change to an attachment within that time reuses the list without asking the server. Changing the server’s address, command, protocol or login always lists the tools again. Every call is recorded in the session trace (mcp.call) with server, tool, duration, outcome and byte counts, and how the server’s questions were answered (elicitation: accepted, declined, cancelled or none, with a reason code), never arguments, results, answers or addresses. A server’s tool list changing publishes ravi.mcp.catalog.changed (see NATS events). To use a server with only the newer protocol revision (a server that does not speak it then fails every call instead of falling back to the older one):

Limits to know

  • A question a background call asks after its turn has ended is declined.
  • A call still waiting in the daemon’s memory is lost if the daemon restarts. It is delivered as “outcome unknown” and never sent again.
  • A cancel is confirmed by one more read of the task; a task that already finished delivers its result.
  • A result fetched in your own turn stays in that session’s context, which other people in a shared session can then see.
  • File uploads never work for agents that run on another host, for local (stdio) servers, or for servers on the older protocol revision.
  • An agent on Claude needs use:tool:ToolSearch to find MCP tools.
  • One credential per server, yours. It is kept in Ravi’s state directory, where an agent with file or shell tools on that host can read it, as it can the Console login.
  • A tool’s description is written by the server and reaches the model as it is: attach only servers you trust.
  • When a server answers HTTP 429, Ravi waits the time it names (Retry-After, or 60 seconds when it names none) before it sends that server anything else: calls in that time answer “try again in N s” without being sent, and a refused call is never sent again.
  • There is no switch that turns the MCP client off as a whole. Stop a server with ravi mcp disable <name>, take it from one agent with ravi mcp detach <name> <agent>, or go back to the release before the last update with ravi update --rollback (it shows the plan; add --execute to do it).

Error codes

Commands print {success:false, op, error:{code, message}} with --json. Exit 1 is a failure, 2 a usage error, 3 a policy refusal or a dry run.