# Test your agent over MCP

Test your agent against simulators the way it talks to the real products: over MCP. You need a simulator you run yourself (see [Run a simulator](https://console.era.eon.io/docs/run-a-simulator.md)). To connect a coding agent to a company the console built instead, see [Connect Claude Code, Codex, or Cursor to your company](https://console.era.eon.io/docs/connect-claude-code-codex-or-cursor-to-your-company.md).

Every simulator serves an MCP server at `<base>/mcp` over streamable HTTP. That's one endpoint per product for any framework that uses MCP, such as the Claude Agent SDK, the OpenAI Agents SDK, LangGraph, Mastra, the Vercel AI SDK and the MCP Inspector.

```
// @modelcontextprotocol/sdk
const transport = new StreamableHTTPClientTransport(new URL(`${BASE}/mcp`), {
  requestInit: { headers: { Authorization: "Bearer xoxb-test-token", "X-Sim-Tenant": tenant } },
});
const client = new Client({ name: "suite", version: "1.0.0" });
await client.connect(transport);
await client.callTool({ name: "slack_search_channels", arguments: { query: "general" } });
```

The MCP server describes the credentials it expects at `/_meta`, under `mcp.credential`. For nearly every simulator, that's an OAuth bearer token, whatever the REST API reads, because the MCP authorization spec requires it. In `fixture` and `strict` modes, a client that isn't signed in is refused when it connects, not on each tool call. In `open` mode, any credentials are accepted.

## Assert on the answers

Assert on what your agent did and answered, not on "the tool returned 200":

- **Correct answers.** Ask the agent a question that the frozen company has a known answer for, and assert that its answer matches.
- **Tool choice.** Assert *which* tools it called, and that it stopped.
- **No writes.** Run read-only and assert no tool call was refused. An agent that tried to change the customer's CRM fails the test, not the code review.
- **Failures.** Turn on `fail_next` or `throttle`, and assert that the agent retried and still answered.
- **Several products.** Load the same company into three simulators, and assert an answer that needs all three.
