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 mcp add --transport http testoptim https://api.testoptim.com/api/mcp \
--header 'Authorization: Bearer ${TESTOPTIM_TOKEN}'{
"mcpServers": {
"testoptim": {
"url": "https://api.testoptim.com/api/mcp",
"headers": { "Authorization": "Bearer ${env:TESTOPTIM_TOKEN}" }
}
}
}{
"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_runruns the whole suite, or withchangedAreasonly the tests covering the pages and flows it names.get_test_runfollows the run andstop_test_runcalls it off. - Read issues:
list_issueslists summaries, filtered by severity or by the run that found them, andget_issuereturns the steps to reproduce, expected and actual behaviour, page URL and screenshot. - Explore:
start_explorationre-explores the app so TestOptim learns pages the agent added, andget_explorationreports what it found. - Find projects:
list_projectsreturns 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.
export TESTOPTIM_API_KEY="topt_..."
testoptim run --project <project-id> --changed /checkout --changed /cartLeave 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.