Connect Roma to any agent
Any agent that can make web requests connects to Roma. Most need one sentence.
Copy this and send it to your agent. It guides you through the setup.
From now on I want to use Roma whenever we work on tasks. Set Roma up for me by following the instructions at https://roma.app/agents.md and guide me through the steps.
What you need
Nothing for talking to Roma. To take work from Roma, your agent needs a door: a key, a webhook or a mail address. The guide shows each one.
What it can do
- Talks to Roma: adds and updates your tasks from its chat.
- Takes work from Roma: you delegate a task in Roma, it works on it and answers inside it.
A script that runs the agent once per task
One script, run on the person's own computer, reads the record's deliveries with the key and runs the agent once per task. The agent works the task over the Roma MCP server and returns it when done. The script, trimmed to its shape:
// your-agent.mjs: runs the agent once per task Roma delegates to it.
import { execFileSync } from "node:child_process";
const { ROMA_API_KEY, ROMA_TRIGGER_ID, ROMA_API_BASE } = process.env;
const state = { cursor: null, started: {} };
async function poll() {
const url = new URL(`${ROMA_API_BASE}/api/v1/triggers/${ROMA_TRIGGER_ID}/deliveries`);
url.searchParams.set("wait", "25");
if (state.cursor) url.searchParams.set("after", state.cursor);
const response = await fetch(url, { headers: { Authorization: `Bearer ${ROMA_API_KEY}` } });
if (response.status === 401) throw new Error("The key was refused. Make a new one on the agent's page.");
for (const delivery of (await response.json()).deliveries ?? []) {
handle(delivery);
// Always, also when nothing ran (Roma's test, agent.ping): a delivery the cursor never passes comes back.
state.cursor = delivery.id;
}
}
function handle(delivery) {
const item = delivery.data?.item;
if (!item?.id || delivery.data?.reassigned || state.started[item.id]) return;
// The agent runs with the task's link. It reads the item with get_item, does the work,
// writes the result into the body with update_items and returns it with handoff: "returned".
execFileSync("your-agent", ["--task", item.webUrl], { stdio: "inherit" });
state.started[item.id] = true;
}
for (;;) await poll().catch((error) => console.error(error.message));
Three steps run it:
- The key is made on the agent's page in Roma, under With a key. The page shows the poll address with the trigger's id.
- The key, the trigger's id and the server's address go in the env file beside the script: ROMA_API_KEY, ROMA_TRIGGER_ID, ROMA_API_BASE.
node your-agent.mjsruns and keeps running. A task delegated to the agent in Roma starts one run of the agent.
The run line is the person's own: any program that takes the task's link works.
More ways to connect
By hand, in the agent's settings:
Any client that supports remote MCP servers over Streamable HTTP with OAuth works. Add the server with the address https://api.roma.app/mcp and no headers; the client discovers the sign-in from the server's first 401 answer. If a client offers to enter a client id and secret by hand, leave them empty: the server registers clients dynamically.
An agent with no place to add a server, one that lives in your messages or on a cloud computer of its own, connects all the same, from the message on the any-agent page: the sign-in is four web requests, nothing installed, listed as Option 3 on the overview. Authentication has the flow in full.
Every coding agent on the computer at once, with add-mcp (it finds Claude Code, Codex, Cursor, VS Code, Gemini CLI, Windsurf and more, and writes Roma into each one's config; each agent runs its own sign-in the first time it connects):
npx add-mcp https://api.roma.app/mcp -n roma
An agent with no browser, a scheduled job or a self-hosted one, connects with an API key instead: Authentication has the steps.
How to use it
Once connected, talk to your agent the way you already do. Roma is there whenever a task comes up:
- "What's on my plate today?"
- "Add "call the dentist" and "send the invoice", both for Friday."
- "Save the plan we just made as a note."
If something goes wrong
If the sign-in window does not open at all, a pop-up blocker, an ad blocker or Safari is stopping it. Tell the app it did not open and ask for the sign-in link as plain text, then open it in a tab of your own. What can go wrong has the rest.
Something not working, or a question on how to use it? Send this to your agent.
Something with Roma is not working, or I have a question about it. Read https://roma.app/agents.md and help me, one step at a time.
Go deeper
The guide your agent reads is public. The common part: https://roma.app/agents.md. The page for your agent: https://roma.app/agents/other-agents.md.
The developer docs have the rest. Every tool with what it takes and returns. Guides for saving research, filling a list and running a worker loop. The standing orders for a scheduled your agent that sweeps your mail, calendar and meeting notes into Roma. Triggers that wake it the moment something changes. The REST API. Developers.