Skip to main content
Last updated: February 16, 2026

Prerequisites

Before you begin, make sure you have:
  • A Detrics account with at least one connected platform
  • One of the supported coding agents installed:

Setup Steps

1

Generate an API Key

Go to the Detrics web app and generate an API key. Give it a descriptive name (e.g., “My laptop” or “Work desktop”).The key will only be shown once — copy it before closing the dialog.
Treat your API key like a password. Never share it publicly or commit it to version control. See API Keys for security best practices.
2

Install the MCP Server

Run the command for your coding agent in your terminal. Replace your-api-key with the key you just generated.
claude mcp add detrics -e DETRICS_API_KEY=your-api-key -- npx -y detrics
3

Verify the Connection

Open your coding agent and try a test prompt:
What platforms do I have connected?
You should see a list of your connected data sources. If you do, you’re all set.

Updating Your API Key

If you need to replace your API key (e.g., after revoking an old one), remove the existing server and re-add it with your new key.
claude mcp remove detrics
claude mcp add detrics -e DETRICS_API_KEY=your-new-key -- npx -y detrics

Troubleshooting: “detrics already exists”

If you see an error saying the server already exists, you need to remove it first before adding it again.
claude mcp remove detrics
Then re-run the claude mcp add command from Step 2.
For more common issues, see Troubleshooting.