Skip to content

Connect an agent

Your org has one TestMachine address, shown under TestMachine MCP server on People & agents in the dashboard. Choose Copy to copy it. Your agent uses it as one MCP server named testmachine:

https://agents.testmachine.ai/o/<org>/mcp

<org> is your org’s name, as in your dashboard address, https://agents.testmachine.ai/o/<org>/admin. The address carries the tools of every server your org has attached, named <server>__<tool>, such as github__create_issue, and TestMachine’s own tools. A server an admin attaches later shows up there too, the next time your agent reloads its tools.

Run the onboarding command to move Claude Code, Codex, Cursor, Claude Desktop and Hermes Agent for you, or add the address to your agent yourself.

You need Node.js. Run:

Terminal window
npx @testmachine_app/cli migrate <org>

It finds the MCP servers set up in Claude Code, Codex, Cursor, Claude Desktop and Hermes Agent on your computer, backs up their config files, and opens a TestMachine page in your browser. The backups and the page stay on your computer; your config files are never sent to TestMachine. Leave the command running while you use the page, and press Ctrl+C when you’re done.

For Hermes Agent, the command reads its default profile, ~/.hermes/config.yaml. Servers in other Hermes profiles stay where they are.

  1. Sign in. Choose Sign in and sign in to TestMachine as you do for the dashboard. The page then shows one card per agent, with that agent’s MCP servers and what your org has attached.
  2. Move an agent. Choose Move Claude Code to TestMachine, or the same for another agent. This adds only the testmachine entry. Every server already in the agent stays there.
  3. Pick the servers to send through TestMachine. Tick Remove from agent beside each one. A ticked server is removed from the agent, so its calls go through testmachine instead and your agent doesn’t have two copies of its tools. Servers you don’t tick stay as they are.
  4. Apply. Nothing changes in your config files until you choose Apply.
  5. Sign each agent in to testmachine. For Claude Code, Codex and Hermes Agent, choose Sign in on its card, such as Sign in Codex, then allow TestMachine in your browser. Cursor and Claude Desktop sign in from the agent itself: in Cursor, open Settings › MCP and choose Connect next to testmachine; quit and reopen Claude Desktop, and sign in when it asks.

Each server on a card says what it needs:

The page says What to do
Attached to your org Tick Remove from agent.
Needs your account at the server Choose Connect and sign in at the server. Then tick it.
Not attached to your org An admin chooses Attach, which opens the server in the dashboard’s catalog. Anyone else chooses Ask an admin, which puts it on every admin’s Issues page. The page shows the server as attached as soon as it is, without running the command again.
Local (stdio), or not in the catalog Nothing. It stays in the agent as it is, and doesn’t go through TestMachine.
Old TestMachine address It was set up by an earlier version of TestMachine. Choose Remove; its tools come through testmachine.

A server set up in a project’s file, such as a repository’s .mcp.json, is marked as such. If the file is in git, removing the server removes it for everyone who pulls the repository.

Run the command again at any time to change your mind. On the page, Switch back returns one server to its agent, Remove TestMachine takes testmachine out of an agent and switches back its servers, Undo reverses one change under What changed, and Restore every config reverses them all. Each puts the entry back exactly as it was; anything else you changed in those files stays.

You can also switch back without the page:

Terminal window
npx @testmachine_app/cli restore <org> <server>
npx @testmachine_app/cli restore <org>

The first switches back one server by its name in your agent, such as github; the second switches back everything.

Your agents may already follow rules: in a CLAUDE.md or AGENTS.md, in Claude Code’s permission settings (.claude/settings.json) or in Cursor’s rules (.cursor/rules), in your home folder or in the folder you work in. To bring them into TestMachine, copy them into New policy, then From a skill, under Policies, or send them to an admin.

Add the address to your agent as an MCP server named testmachine. The first time, your agent opens a browser window. Sign in to TestMachine as you do for the dashboard, and allow the agent.

For Claude Code:

Terminal window
claude mcp add --transport http testmachine https://agents.testmachine.ai/o/<org>/mcp
claude mcp login testmachine

Connect an agent on People & agents in the dashboard gives the address to copy and, for the agent you pick, the exact command or configuration, such as Codex, Cursor, VS Code, Gemini CLI, Amp, Hermes Agent, ChatGPT or Claude. For any other agent, add a remote MCP server with the address. Choose streamable HTTP and OAuth if your agent asks.

If you used a server directly before, remove it from your agent once its tools come through TestMachine, so your agent doesn’t have two copies.

Some servers sign in as you. Your agent sees their tools whether or not you’ve connected your account, plus one more, such as notion__connect_account, which returns a link to connect. Until you connect, the server’s tools are blocked with that same link. After you sign in, your agent retries the call; there’s no need to reload its tools.

When an admin, or a policy that applies to you, asks agents to declare something, such as why they send an email, the tool lists it as an extra argument with a description of what to write. Your agent fills it in like any other argument; TestMachine records it and doesn’t pass it on to the server. The address also lists open_session and close_session, and every tool takes a session argument, which a policy can make required. When TestMachine has switched on required sessions for your org, an admin decides on the Administration page whether every server call needs a session; it’s required unless they turn it off. A call without one is then blocked before any policy reads it, even in Shadow mode, and your agent is told to open a session and retry. TestMachine’s own tools never need one. Your agent opens a session with the purpose of its work and gets back four words, such as amber-otter-maple-quill, then passes them on each call for that work, on any server. The same reply also carries a longer signed handle, which works in their place. A session closes when the agent closes it or after an hour without a call. Words that name no open session of the agent’s, because they are mistyped or the session has closed, count as no session. Where a session is required, a call without one is blocked even while the policy is in Shadow mode, and the agent is told why and to open a session and retry.

The same address lists TestMachine’s own tools under their plain names, such as policy_list, draft_clause_add and verdict_list, one for each thing you can do in the dashboard. Everyone can read policies, servers and the audit trail with them, see who they are signed in as with person_me, and ask an admin to attach a catalog server with server_request. Changes that need an admin, such as editing a draft, work only from an admin’s agent; some, such as signing off a policy, return a link instead, which an admin confirms in the dashboard. On the free plan, where no policy judges calls, the tools that change policies or review calls aren’t listed, and neither are the ones that run Explore, red teaming or outcome policies. When TestMachine has switched on Explore for your org, verdict_query answers questions about your calls in SQL, such as how many were blocked by each clause this week. It takes one read-only Postgres SELECT, and its description lists the tables and columns it can read. At the top of Calls in the dashboard you can ask the same questions in words, and a model TestMachine runs answers them with the same tool. The model sees everyone’s calls for an admin and only your own otherwise. Your policies judge its queries like any agent’s. On a paid plan, the address also lists outcome_policy_start and outcome_policy_submit: your agent starts one of your org’s outcome policies, does the work with its tools, and hands in what it produced. A judge reads the hand-in against the policy’s rules, looking through the calls your agent made under the policy so far and verifying facts again with read-only tools of the servers it used, and either gives the next step or tells your agent what to fix. Judging can take a few minutes. The address also lists submit_feedback: when a tool fails, is missing, is hard to call right or is blocked when it shouldn’t be, whether it’s TestMachine’s or a server’s, your agent can tell the TestMachine team what it tried, what happened and the fix it proposes. TestMachine records it with your org’s calls, and the TestMachine team reads every one. TestMachine takes 20 a day from each org; past that, feedback is only recorded with your calls.

If your agent’s calls are blocked as an unnamed agent

Section titled “If your agent’s calls are blocked as an unnamed agent”

TestMachine names these agents the moment they sign in, so their calls go straight to your policies: Claude Code, Claude, ChatGPT, Codex, Cursor, VS Code, GitHub Copilot CLI, GitHub Copilot, Gemini CLI, Qwen Code, Amp, OpenCode, Kilo Code, Factory Droid, Zed, Goose, Cline, Augment, Crush, Mistral Vibe, Le Chat, Grok, Google Antigravity, Windsurf, Devin, Warp, Perplexity, Copilot Studio, Amazon Q CLI, Docker MCP Gateway, MCP Inspector, Lovable, Notion agents, Linear agents, MCPJam, ToolHive, Hermes Agent, Conductor, LM Studio. Agents lists them under Recognized on sight. Any other agent needs a name before its calls go through. Ask an admin: the agent appears on Home, with a Name it button.

If your org’s plan includes a set number of agents and they’re all in use, allowing a new agent shows that instead, and the agent’s calls are blocked until an admin changes the plan or disables an agent nobody uses.

When TestMachine blocks a call, the agent is told why and what to do instead. See Why a call was blocked.

When a server refuses your connected account, or can’t be reached, TestMachine leaves its tools out and lists the rest. Fix the cause on the server’s side, such as a missing permission or an API that isn’t turned on, then reload TestMachine’s tools in your agent.