Authentication
The MCP server needs one credential: a TestRelic MCP personal access token (values start with tr_mcp_). Integration settings for Jira, Amplitude, Grafana Loki, and GitHub are loaded from your organization in the TestRelic cloud after the MCP authenticates—you do not put those secrets in MCP config.
1. Create a token
- Sign in to the TestRelic web app (same place you use for dashboards), e.g. app.testrelic.ai.
- Open Settings → MCP tokens (or your admin-provided equivalent).
- Create a token and copy the
tr_mcp_…value once; store it in a password manager.
2. Store the token
Option A — CLI (writes a file)
npx -y @testrelic/mcp@3.0.0 login
Paste the token when prompted. This stores the token for the MCP process to read on startup.
Option B — Environment variable
Set TESTRELIC_MCP_TOKEN to your tr_mcp_… value in your shell profile, CI secrets, or your MCP client’s env block in mcp.json. Do not commit token values to git.
3. Cloud API base URL
If your SDK already uses a custom API endpoint, point the MCP at the same API base (including /api/v1 if that is part of your URL):
- Environment variable:
TESTRELIC_CLOUD_URL - Or flag:
--cloud-urlon the CLI (see package docs)
If unsure, use the same hostname your reporter uses for uploads (see Configuration and Appium configuration).
4. Default repository (optional)
If your tools omit a project id, set a default:
TESTRELIC_DEFAULT_REPO_ID, or--default-repo-idon the CLI
5. Enable cloud mode in the client
Remove --mock-mode from your MCP server args when you want live TestRelic data. Keep mock mode until a token is configured if you want zero outbound calls.