MCP quickstart

Connect to production TestRelic MCP via the hosted URL or stdio with the published npm package, wire mcp.json, set your MCP token, and verify with tr_health.

Pick how you reach the server in production: hosted MCP at mcp.testrelic.ai (streamable HTTP, no local binary), npx with the published @testrelic/mcp package (stdio, any MCP client), or the Cursor marketplace plugin if you use Cursor. Optional sandbox paths (mock mode or a local git clone) are for evaluation and development only.

Purpose

Install or connect the TestRelic MCP server so your MCP host can use it (hosted URL or stdio), set a production MCP personal access token, then verify with tr_health.

Concept: stdio wiring

MCP host
mcp.json entry
IDE agent
command & args, then stdio JSON-RPC (bidirectional)
Child process
TestRelic MCP binary

Install path vs typical setup depth

Comparing how many discrete steps teams often budget before tr_health succeeds — illustrative counts for planning, not a guarantee. Assumes production (hosted URL or npx with a token), not local sandbox builds.

Cursor — marketplace

  1. Open Cursor and search Settings → Plugins for testrelic-mcp.
  2. Click Install. Cursor wires up the MCP server automatically from the bundled config; see the plugin's mcp.json in testrelic-mcp-server for the exact wiring shipped to the marketplace.
  3. Open the agent and ask something like "list my TestRelic projects" (or call tr_health).

The plugin connects to the hosted TestRelic MCP server over HTTP. The hosted server answers only requests that carry your MCP personal access token: create a tr_mcp_* token at platform.testrelic.ai/settings/mcp-tokens and send it as an Authorization: Bearer header (see the Hosted tab below), or use the npx tab with TESTRELIC_MCP_TOKEN. See Authentication for details.

Manual mcp.json

Add a server entry to your client's MCP configuration. Prefer hosted or npx + token for production.

Streamable HTTP MCP served at https://mcp.testrelic.ai/mcp. Every request must carry your MCP personal access token as a bearer header; without it the server answers 401 UNAUTHORIZED. The server acts as the owner of the token you send.

mcp.json fragment
{
  "mcpServers": {
    "testrelic": {
      "type": "http",
      "url": "https://mcp.testrelic.ai/mcp",
      "headers": { "Authorization": "Bearer <your tr_mcp_ token>" }
    }
  }
}

The hosted server registers the core, coverage, creation, healing, impact, triage, signals and devtools capabilities. For ai, marketplace, apps, artifacts or memory, use the stdio tab and add them to --caps. If the server is flooded it answers 429 with RATE_LIMITED; retry after a moment.

Restart the MCP host app after saving. Run tr_health in the agent to confirm the server responds.

Mock mode vs production cloud

ModeUse when
--mock-modeSandboxes only: learning the tool surface, demos, or CI smoke of the MCP binary. Calls go to the local mock API (npm run mock in the source repo), not to TestRelic production APIs.
Production (token set, no mock flag)Real repos, runs, journeys, and integrations resolved from your org in the TestRelic cloud.

Mock mode is off by default. To connect real data:

  1. Create a personal access token (tr_mcp_*) at platform.testrelic.ai/settings/mcp-tokens.
  2. Run npx @testrelic/mcp login (or set TESTRELIC_MCP_TOKEN=tr_mcp_… in your client's env).
  3. Make sure --mock-mode is not in your MCP server args.

See Authentication for creating and storing tr_mcp_… tokens.

Troubleshooting

SymptomWhat to try
MCP host does not see the serverRestart the host after editing mcp.json; confirm you used the hosted URL, npx args, or contributor local paths consistently.
tr_health failsRun from the agent after the server binary is reachable; check stderr from the MCP process in host logs.

Optional: local mock API (contributors)

For development in testrelic-mcp-server, you can run a local mock HTTP API (npm run mock) and point the MCP at it with --mock-mode. Production users rely on the hosted endpoint or stdio against the real cloud instead.

Next steps

→ Authentication · Capabilities · Tools reference

Was this page helpful?

On this page