TestRelic MCP server: Model Context Protocol for AI-assisted test engineering
Coding assistants are only as good as the context they see. Pasting stack traces into chat scales poorly; re-fetching structured run history from your org is better. The TestRelic MCP server implements the Model Context Protocol so compatible hosts—Cursor, Claude Desktop, VS Code MCP clients, and others—can call tools that read your TestRelic cloud projects, runs, coverage signals, and related data. The MCP overview positions MCP alongside the SDK reporters: reporters write run data from CI and laptops; MCP reads and acts on that data inside the IDE loop.
Architecture at a glance
The overview’s sequence diagram summarizes the trust boundary: your MCP host exchanges JSON-RPC with the MCP server over stdio (or streamable HTTP for hosted mode); the server then calls TestRelic cloud APIs with your credential. Integration backends (Jira, Amplitude, Grafana Loki, GitHub, TestMu AI, BrowserStack) are not duplicated inside MCP config—they are resolved from your organization in the cloud after the server authenticates, as stated in the overview and Authentication pages.
Production connection paths
The MCP quickstart is the step-by-step source for:
| Mode | When teams choose it |
|---|---|
Hosted MCP (https://mcp.testrelic.ai/mcp) | Streamable HTTP MCP without a local binary; align with your client’s credential mechanism for remote servers. |
npx + @testrelic/mcp | stdio for any MCP host; pin a version (e.g. 3.0.0) for reproducible installs as shown in the quickstart. |
| Cursor marketplace plugin | Fastest path for Cursor users; plugin bundles mcp.json wiring—see the quickstart for the GitHub reference repo. |
Sandbox vs production: mock mode and local clones are documented as evaluation-only. For live org data, remove --mock-mode and supply a real token (quickstart + authentication).
Authentication: one token, clear storage rules
MCP authentication documents the full lifecycle:
- Create an MCP personal access token in the web app (
tr_mcp_…prefix). - Store it either with
npx -y @testrelic/mcp@3.0.0 login(writes the default file) or viaTESTRELIC_MCP_TOKEN/ your client’smcp.jsonenvblock—never commit secrets. - Align API base using
TESTRELIC_CLOUD_URLor--cloud-urlif your reporters already use a non-default endpoint; match the same API base the SDK uses (Configuration, Appium configuration). - Optionally set
TESTRELIC_DEFAULT_REPO_IDor--default-repo-idwhen tools omit a project identifier. - Disable mock mode when you are ready for outbound cloud calls.
That page reiterates: Jira, Amplitude, Loki, GitHub, TestMu AI, and BrowserStack credentials flow from cloud org settings, not from extra MCP secrets.
Capability bundles (--caps) for lean tool schemas
The Capabilities reference defines optional tool groups beyond always-on core:
| Capability | Documented focus |
|---|---|
core | Projects, recent runs, config, health, integration status |
coverage | User journeys, test map, coverage gaps, reports, cached payloads |
creation | Plan → generate tests, templates, dry-run helpers |
healing | Patch proposals, locator suggestions, replay plans |
impact | Diff analysis, risk scoring, MUST/SHOULD/OPTIONAL test selection |
triage | Run diagnosis, flaky audit, RCA, Jira create/dedupe, failure search |
signals | User impact, production logs (Loki), affected sessions |
devtools | Trends, alerts, semantic code search, repo indexing |
Suggested bundles on that page cover day-to-day authoring, on-call / failures, and repo-wide exploration. Passing only the caps you need keeps the MCP tool schema smaller—important for models with finite context windows.
Operational verification and next workflows
After wiring credentials, the quickstart recommends tr_health to confirm the server reaches TestRelic successfully. From there, Tools reference enumerates callable tools for your enabled caps, and Testing workflow explains how teams chain MCP-assisted steps with their existing TestRelic data habits.
How MCP complements Ask AI and the web UI
MCP is IDE- and agent-centric tool access. Ask AI (/ai/ask-ai) is a full-page product experience in the cloud with its own plan rules. Many organizations use both: humans triage in the UI while agents refactor tests with MCP-fed run context. Compare goals before standardizing on one surface.
Related documentation
- TestRelic MCP overview
- MCP quickstart
- Authentication
- Capabilities
- Tools reference
- Testing workflow
- Ask AI (product UI contrast)
- Playwright Configuration (cloud URL alignment)
FAQ: What is the fastest way to prove MCP connectivity?
Run tr_health after configuring your token, per MCP quickstart.
FAQ: Do I paste Jira or Loki secrets into mcp.json?
No. Authentication states integrations are loaded from your TestRelic organization after the MCP token validates.
FAQ: How do I limit which tools appear to my assistant?
Use --caps or TESTRELIC_MCP_CAPS with a comma-separated list from Capabilities.
FAQ: Where do hosted and stdio configs differ?
Compare the mcp.json fragments in MCP quickstart—hosted uses the https://mcp.testrelic.ai/mcp URL; stdio uses command/args with npx and optional env for TESTRELIC_MCP_TOKEN.
