> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rubrichq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rubrichq.io/_mcp/server.

# RubricHQ MCP Server

The RubricHQ MCP server connects your AI assistant to your RubricHQ workspace through the [Model Context Protocol](https://modelcontextprotocol.io). Once it's connected, you can ask your assistant to do anything you'd do in the dashboard, in plain words:

* "Create five scenarios that try to get my support agent to skip identity checks."
* "Run the smoke suite against Acme Support and tell me why it failed."
* "Which production calls failed yesterday, and what went wrong?"
* "Ask Co-Pilot which agent has the worst latency this week."

The assistant picks the right RubricHQ tools, runs them, and explains the results: transcripts, metric verdicts, pass rates and Co-Pilot answers.

> **Note**
>
> The server is published on npm as [`@rubrichq/mcp-server`](https://www.npmjs.com/package/@rubrichq/mcp-server). It runs on your computer and talks to `api.rubrichq.io` with your API key. You need [Node.js](https://nodejs.org) 20 or later.

## Set up

### Create an API key

In [RubricHQ](https://app.rubrichq.io), open the workspace you want to use, then go to **Settings → API Keys → Create key**. Copy the key; it's shown only once.

An API key belongs to one workspace, so **the key you choose decides which workspace your assistant works in.** See [Workspaces](#workspaces).

### Add the server to your assistant

#### Claude Code

```bash
claude mcp add rubrichq --scope user \
  -e RUBRICHQ_API_KEY=your_api_key \
  -- npx -y @rubrichq/mcp-server
```

Check it with `claude mcp list`, or type `/mcp` inside Claude Code.

#### Claude Desktop

Open **Settings → Developer → Edit Config** and add RubricHQ to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "rubrichq": {
      "command": "npx",
      "args": ["-y", "@rubrichq/mcp-server"],
      "env": { "RUBRICHQ_API_KEY": "your_api_key" }
    }
  }
}
```

Quit Claude Desktop completely and open it again.

#### Cursor

Add this to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):

```json
{
  "mcpServers": {
    "rubrichq": {
      "command": "npx",
      "args": ["-y", "@rubrichq/mcp-server"],
      "env": { "RUBRICHQ_API_KEY": "your_api_key" }
    }
  }
}
```

RubricHQ then appears under **Cursor Settings → MCP**.

#### Codex

```bash
codex mcp add rubrichq --env RUBRICHQ_API_KEY=your_api_key -- npx -y @rubrichq/mcp-server
```

#### VS Code

Add this to `.vscode/mcp.json`. VS Code asks for the key the first time and stores it securely:

```json
{
  "inputs": [
    { "type": "promptString", "id": "rubrichq-key", "description": "RubricHQ API key", "password": true }
  ],
  "servers": {
    "rubrichq": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@rubrichq/mcp-server"],
      "env": { "RUBRICHQ_API_KEY": "${input:rubrichq-key}" }
    }
  }
}
```

#### Other clients

Any MCP client that can start a local (stdio) server works. Use:

* **Command:** `npx`
* **Arguments:** `-y @rubrichq/mcp-server`
* **Environment:** `RUBRICHQ_API_KEY=your_api_key`

See [Setup and configuration](/documentation/mcp/setup) for Windsurf, Gemini CLI and config file locations.

### Check that it works

Ask your assistant:

```text
List my RubricHQ agents and their scenarios. Don't create or run anything.
```

You should get your workspace's agents back. If not, see [Troubleshooting](/documentation/mcp/troubleshooting).

## What you can do

#### [Build and edit tests](/documentation/mcp/tools#agents)

Create and update agents, scenarios and custom metrics.

#### [Run simulations](/documentation/mcp/tools#simulations)

Run one scenario or a whole suite, wait for the verdict, and read every transcript and metric result.

#### [Monitor production](/documentation/mcp/tools#observability)

Send real calls for scoring, list failing calls and re-score them after you change a metric.

#### [Ask Co-Pilot](/documentation/mcp/tools#co-pilot)

Ask anything about your calls and test runs and get answers with tables, charts and quoted evidence.

## Example prompts

#### Write a test suite from an agent's prompt

```text
Read the prompt of my "Acme Support" agent and create 5 scenarios that test its
edge cases: an angry caller, a caller who won't give their date of birth, and a
request the agent isn't allowed to handle. Attach them to the agent and tag them
"edge-cases". Don't run them yet.
```

#### Run a suite and explain the failures

```text
Run every scenario tagged "smoke" against Acme Support twice. Tell me how many
calls that is before starting. When it finishes, explain each failure using the
transcript and the metric explanations, and suggest a prompt fix.
```

Many clients also offer this as a ready-made prompt: **Test an agent** (`test_agent`).

#### Review production calls

```text
Look at Acme Support's production calls from the last 3 days. Group the failing
ones by root cause, quote the lines that show each problem, and rank them by how
often they happen.
```

Also available as the ready-made prompt **Review production calls** (`review_production_calls`).

#### Create a metric and try it on past calls

```text
Create a pass/fail metric "Verifies identity before sharing account details".
Turn it on for Acme Support and re-score its last 5 runs with it.
```

#### Ask Co-Pilot

```text
Ask Co-Pilot why calls failed this week, then show me the calls behind the
biggest reason.
```

## Workspaces

Every tool works in the workspace your API key was created in. Nothing else can be reached by default.

* **To use another workspace**, ask for it by ID ("list agents in workspace 44"). This works only if the person who created the key is a member of that workspace; otherwise RubricHQ answers "not found".
* **Co-Pilot always answers for the key's own workspace.**
* **Working in several workspaces regularly?** Add the server once per workspace under different names, each with a key from that workspace, for example `rubrichq-acme` and `rubrichq-globex`.

## Credits and safety

* Tools that place calls or run AI evaluation **spend credits**: running scenarios and suites, re-scoring, sending production calls and asking Co-Pilot. Your assistant sees this in each tool's description and should tell you before it starts something large.
* If your workspace runs out of credits, nothing is started and nothing is charged. Your assistant tells you to add credits under **Settings → Billing**. See [Troubleshooting](/documentation/mcp/troubleshooting#out-of-credits).
* Deleting or archiving is marked as destructive, so clients that support it ask you to confirm first.
* Want the assistant to look but never change anything? Turn on [read-only mode](/documentation/mcp/setup#read-only-mode).

#### [Setup and configuration](/documentation/mcp/setup)

Every client, options, updating.

#### [Tools reference](/documentation/mcp/tools)

All 39 tools.

#### [Troubleshooting](/documentation/mcp/troubleshooting)

Errors, credits and connection problems.