piloop.toml, and list it
in the roles that need it. piloop gives the servers to each harness in that harness’s own format.
Define a server
A server is either streamable HTTP (url) or stdio (command):
A role gets no servers unless its
mcp key lists them. The configuration reference
has every key.
Keys stay out of the file
A server names the environment variables that hold its keys. It never holds a key. Sopiloop.toml is safe to
commit.
piloop copies each named variable from the daemon’s environment into the agent’s environment. The harness then puts
the value into the header or into the server’s environment. A variable that the daemon does not have makes the launch
fail, with an error that names the variable. See Secrets for how to give the daemon its keys.
piloop doctor lists the missing variables by name.
What each harness gets
Each built-in harness puts the role’s servers at the{mcp} element of its command. The agents see only these
servers, never the servers in your own harness configuration:
- Claude Code:
--strict-mcp-configand an inline--mcp-config. - Codex: every server of your Codex configuration is turned off, and the role’s servers are added. A piloop server with the same name as one of yours makes the launch fail.
- pi: through pi-mcp-adapter in exclusive mode. pi takes servers only in its headless command, so a role that has
servers and pi in its rotation needs
runtime = "subprocess".
{mcp} element and it sets
mcp to one of the renderers: claude, codex or pi.
The X search server
piloop includes a small stdio server,scripts/xai_search_mcp.py, with one tool, x_search. It searches recent posts
on X through xAI’s API, and uses only the Python standard library.
--max-usd. --max-tool-calls limits
the searches of one call. The project’s [spend] limit does not see this cost, so set --max-usd.
Use the script from a clone of the piloop repo. It is not part of the installed CLI.