DocsAgents and API
Coding agents: write and run tests from your terminal
Your coding agent can write FlowQA tests for the product it is working on, run them on a cloud browser, read the results and the screenshots, and fix what it got wrong, without you leaving the terminal. It works through the TestFinch MCP server, the same connector any MCP client uses. Every test it writes is an ordinary test: it shows in Tests at once, you can run, edit, rename or delete it, and it says who wrote it and through which agent.
Set it up#
- In TestFinch, open Agents and create a token. The page makes a read and write token for every project or for one.
- Add the server to your agent with the token.
- Start a new session and ask the agent to read the
flowqa_guidetool.
The server URL is https://api.testfinch.com/mcp.
Claude Code, in your repository:
claude mcp add --transport http testfinch https://api.testfinch.com/mcp --header "Authorization: Bearer <token>"
Every test the agent writes shows as written by you, through that agent.
Codex:
codex mcp add testfinch -- npx -y mcp-remote https://api.testfinch.com/mcp --header "Authorization: Bearer <token>"
Cursor, in .cursor/mcp.json:
{ "mcpServers": { "testfinch": { "url": "https://api.testfinch.com/mcp", "headers": { "Authorization": "Bearer <token>" } } } }
Any other MCP client: give it the server URL and the token as a bearer header, or bridge over stdio with mcp-remote.
Claude.ai and Claude Desktop connect with "Add custom connector" and sign in instead of using a token.
The guide the agent reads is also published here: the FlowQA authoring guide for agents.
The CLI or the connector#
Your agent can also use the TestFinch CLI when it has a terminal in your repository. Use the CLI to:
- run tests against the app on your computer (
testfinch test http://localhost:3000), with the results and the screenshots of failing steps written to files the agent can open; - run tests in CI, where the exit code is the verdict;
- read a bug with its evidence (
testfinch bug <ref>), then mark it fixed with a note and the commit (testfinch resolve <ref>) while it fixes it.
Use the connector to write and edit tests, and when the agent has no terminal. The connector has the authoring tools and their guide, and the CLI does not. Both work on the same projects, tests, runs and bugs, so an agent can use one and then the other.
Run testfinch guide to print what an agent should read before it uses the CLI.
It is also published here: the TestFinch CLI guide for agents.
Sign in once with testfinch login, and never paste a token into the conversation.
What the agent can do#
- Learn:
flowqa_guide(the authoring guide and the test schema) andflowqa_get_project(environments, modules, openings, variable names). - Read:
flowqa_list_tests,flowqa_get_test,flowqa_tests_for_snagandflowqa_site_notes. - Read results:
flowqa_get_run,flowqa_get_artifactfor a step's screenshot, andflowqa_list_runs. - Write:
flowqa_save_testscreates or updates up to 50 tests in one call,flowqa_delete_testsremoves them, andflowqa_request_recordinghands you a recording to make in FlowQA Desktop. - Organise:
flowqa_organizeadds, renames and removes modules, sets suites, moves tests and orders them. - Run:
flowqa_run_testsby test, module, suite or everything, andflowqa_github_hookfor GitHub hooks. - Verify:
flowqa_save_testswithverify: trueruns the saved tests once on a TestFinch cloud browser in the same call and answers with the verdict: passed or failed, the failing step and its error, the failing screenshot's path and a link to the run.flowqa_wait_for_runwaits up to 55 seconds on any run or run group and answers with the same verdict, saying the run's place while it is queued.flowqa_run_teststakes an idempotency key, so a retried call starts nothing twice, and can wait for its verdict too. - Explore:
flowqa_explorestarts the AI agent on an environment,flowqa_get_explorationfollows it and lists the tests it published, andflowqa_cancel_explorationstops it when you ask. Once the site is mapped, the agent goes through the proposed journeys with you, or gives you the link to review them in the app. When you ask it to,flowqa_review_planapproves the plan with the journeys you keep, and generation starts. A journey the plan skipped, such as one that would pay or delete while destructive actions are off, cannot be kept, as in the app. - Repairs:
flowqa_list_repairsshows what the repair engine proposed for failing tests, with the failing step and its screenshots, andflowqa_review_repairapproves or rejects a proposal. - Questions:
flowqa_list_questions,flowqa_get_question_screenshotandflowqa_answer_question. The agent answers what it knows from the code and hands the rest to you with a link that opens the question in the app, or in FlowQA Desktop for an exploration running on your machine, where you can take over the browser.
A read-only token sees the Learn, Read and Read results tools, plus flowqa_get_exploration, flowqa_list_repairs, flowqa_list_questions and flowqa_get_question_screenshot, and none of the others.
Reporters have no Tests half and see no FlowQA tools.
Your project role applies to everything the agent does.
An answer the agent gives shows in the exploration as Answered by Claude Code for <your name>, and the site note it leaves says the same.
Quality without a gate#
There is no approval step: a saved test is published. Instead, every save is checked. A test that does not parse, names a module or environment the project does not have, or uses an opening that is not reusable is refused, and nothing in that batch is saved. Everything else comes back with findings: no assertion, a weak or CSS-only locator, a typed password, a name another test already has, a test longer than 40 steps, steps that repeat an opening, a variable nobody defined, or a test that runs only on production. The agent is told to resolve findings before it calls a test done, and you see the same findings under Needs attention on the test. You have the last word: ask the agent to keep something a finding names, and it records why in the test's rationale.
Limits#
Saves, reads, organising and answering questions are free. Runs and explorations an agent starts are billed as if you started them, under the same allowances, and a plan that has none left refuses the agent with the same reason it gives you. A verify run is an ordinary cloud run: each saved test on each browser and device counts as one cloud test run; the save itself always lands, even when the plan refuses the run. Approving a repair through the agent charges credits exactly as approving it in the workbench does. Approving an exploration's plan through the agent bills each kept test exactly as approving it in the workbench does, and the reply says up to how many credits that is. When those tests will be charged and the workspace has no credits left for one, the approval is refused, in the workbench too, and the plan stays in review until credits are added. A save takes at most 50 tests, and one person can save at most 500 tests an hour in a project.