Skip to content

Claude Code, Cursor and Copilot

Verify what your coding agent built

Short answer

To verify what your coding agent built, connect Claude Code, Cursor or GitHub Copilot to TestOptim's MCP server, or have it run testoptim run --changed. The agent re-runs your AI-generated test cases on the pages it changed in a real browser, reads the issues TestOptim found and fixes them from the IDE.

Why verify what a coding agent built

A coding agent such as Claude Code, Cursor or GitHub Copilot can change a checkout page in minutes, and its own unit tests pass. What it rarely does is open the app in a browser and use it the way a customer would. Broken buttons, a form that no longer submits or a page that only fails after login slip through.

TestOptim already holds AI-generated test cases for your app's pages and flows. Give the agent access to them and it can re-test the pages it just changed, read the issues TestOptim found and fix them before you review the change.

Connect your coding agent over MCP

TestOptim runs an MCP server at https://api.testoptim.com/api/mcp. Create an API key under Settings > API keys, export it as TESTOPTIM_TOKEN and add the server to your agent. The key decides which projects and tools the agent sees.

Claude Code
claude mcp add --transport http testoptim https://api.testoptim.com/api/mcp \
  --header 'Authorization: Bearer ${TESTOPTIM_TOKEN}'
Cursor (.cursor/mcp.json)
{
  "mcpServers": {
    "testoptim": {
      "url": "https://api.testoptim.com/api/mcp",
      "headers": { "Authorization": "Bearer ${env:TESTOPTIM_TOKEN}" }
    }
  }
}
GitHub Copilot in VS Code (.vscode/mcp.json)
{
  "inputs": [
    { "type": "promptString", "id": "testoptim-token", "description": "TestOptim API key", "password": true }
  ],
  "servers": {
    "testoptim": {
      "type": "http",
      "url": "https://api.testoptim.com/api/mcp",
      "headers": { "Authorization": "Bearer ${input:testoptim-token}" }
    }
  }
}

Then ask, for example: “I changed /checkout. Re-test it with TestOptim and fix any critical or high issues.”

What the agent can do with TestOptim

  • Run tests: start_test_run runs the whole suite, or with changedAreas only the tests covering the pages and flows it names. get_test_run follows the run and stop_test_run calls it off.
  • Read issues: list_issues lists summaries, filtered by severity or by the run that found them, and get_issue returns the steps to reproduce, expected and actual behaviour, page URL and screenshot.
  • Explore: start_exploration re-explores the app so TestOptim learns pages the agent added, and get_exploration reports what it found.
  • Find projects: list_projects returns the project IDs the key can reach.

Each tool appears only when the key has the matching permission. Exploring needs the Explore the app permission (knowledge:explore), which is off by default because each exploration uses your plan's page allowance.

Run from the terminal or CI with testoptim run

Agents without MCP, and CI jobs, can use the TestOptim CLI. testoptim run starts a run, waits for it, prints the issues it found and exits non-zero when one is high or critical, so the agent or the build sees the failure.

Terminal or CI
export TESTOPTIM_API_KEY="topt_..."
testoptim run --project <project-id> --changed /checkout --changed /cart

Leave out --changed to run the full suite. --fail-on sets the severity that fails the command, and a run that times out or is interrupted is stopped so it does not keep using test executions.

What to know before you start

The agent runs the test cases your project already has. A page TestOptim has never seen has no tests yet: the agent can start an exploration, and the new test cases are generated and approved in the TestOptim app before they run. Running only the changed areas keeps the run, and the test executions it uses, small.

TestOptim tests a URL its browsers can open. For an app on localhost or your private network, run the CLI tunnel beside the agent.

Frequently asked questions

Does TestOptim have an MCP server?

Yes. It runs at https://api.testoptim.com/api/mcp over streamable HTTP and authenticates with a TestOptim API key sent as a bearer token.

Which coding agents work with TestOptim?

Any agent that supports remote MCP servers over HTTP, including Claude Code, Cursor and GitHub Copilot in VS Code. Agents without MCP can run the testoptim CLI.

Can the agent test only the pages it changed?

Yes. Pass the pages or flows to start_test_run as changedAreas, or to the CLI as --changed /checkout. Only the test cases covering them run.

What does testoptim run --changed do?

It starts a run of the tests covering each page or flow you name, waits for it, prints the issues it found and exits non-zero if one is at or above --fail-on (high by default).

Which API key permissions does a coding agent need?

Read projects, Start test runs, Read test runs and Read issues are enough to run tests and read issues. Add Explore the app (knowledge:explore) if the agent should start explorations.

Can the agent read the issues TestOptim found?

Yes. list_issues returns summaries, and with testRunId only the issues one run found. get_issue returns the description, steps to reproduce, expected and actual behaviour, page URL and screenshot.

What happens when the agent adds a new page?

The page has no test cases yet. The agent can start an exploration so TestOptim learns it; test cases for what it finds are generated and approved in the TestOptim app before they run.

Do agent runs use my plan's test executions?

Yes. Runs started over MCP or the CLI count like runs started in the app and are attributed to the person who created the API key. Explorations use the page allowance.

Can I limit what the agent can touch?

Yes. Limit the API key to one project and tick only the permissions it needs. The agent never sees tools the key cannot use, and you can revoke the key at any time.

Can TestOptim test the app on my localhost?

Yes, through the testoptim tunnel command, which lets TestOptim's browsers reach localhost or private apps over an outbound-only connection.

GET STARTED FREE

Point TestOptim AI at your app

3-day free trial · No SDK, no test code · Cancel anytime