Connect an AI assistant with MCP
The Model Context Protocol (MCP) lets an assistant use TestPerch tools from your own editor or chat. It can look up test definitions and executions, then inspect errors, logs, and steps for a particular attempt.
Connect your assistant
Section titled “Connect your assistant”-
In your assistant, add a remote HTTP MCP server named
testperch. For the hosted service, use the following URL. You can also copy it from Project settings → MCP.https://testperch.com/mcp -
Choose OAuth and follow the browser sign-in. Use your TestPerch account, choose the workspace that contains your project, and review the requested access. Keep the reporter key in CI. It is an ingestion credential and cannot authorize an MCP connection.
-
Enable the connection in your assistant and ask “Use TestPerch to list the projects in my workspace.” Confirm that it returns a project you recognize. The grant covers the selected workspace, so include the project name in subsequent questions.
For example, VS Code can store the following entry in .vscode/mcp.json. If the file already has a servers object, add testperch to it. VS Code MCP configuration
{ "servers": { "testperch": { "type": "http", "url": "https://testperch.com/mcp" } }}Investigate a failure
Section titled “Investigate a failure”Give the assistant a project and a run ID from Runs. For example, ask “In the Checkout project, list the unexpected failures in run <run ID>. For the first failure, show the failing step and the error from that attempt.” A run that passed after a retry can still have earlier failed attempts. Ask for those explicitly when investigating flakiness.
Reading results uses test-results:read. Tools that quarantine, lift quarantine, archive, or restore a test require additional tests:write consent and a workspace owner or admin. You can review or revoke the assistant’s grant in Account settings → Connected apps.