# Introduction to the MCP Reference

Connect a coding agent to your Confident AI project over the Model Context Protocol.

## What is the Confident AI MCP server?

The **Confident AI MCP server** is the official [Model Context Protocol](https://modelcontextprotocol.io/) server for Confident AI. It exposes your project as a set of tools a coding agent can call, so the agent works with your evaluation data from inside the editor instead of through the dashboard. It allows you to:

- Pull and version prompts and evaluation datasets
- Run cloud evaluations and read back test runs, metrics, and metric collections
- Browse production traces, threads, and spans, and evaluate any of them
- Manage human annotations, annotation queues, dashboards, and alerts
- Run red-teaming risk assessments and check projects against governance policy

Everything the server exposes is also available in the web UI and over the [Confident API](/docs/reference/api) — think AWS console versus AWS CLI. Same resources, different interface.

> Don't confuse this with [connecting your own MCP
> servers](/docs/llm-evaluation/mcp-servers), which makes your application's
> tools known to Confident AI so it can evaluate how your agent uses them. This
> page is the opposite direction: connecting an agent to Confident AI.

## Prerequisites

- A **Confident AI** account. If you don't have one, [sign up here](https://app.confident-ai.com/signup).
- An MCP client that supports remote servers and OAuth — Cursor, Claude Code, Claude Desktop, Windsurf, or anything else that speaks the Model Context Protocol

No API key is needed. Authentication is OAuth, and the server acts as you, across every project your account can reach.

## Server URLs

Confident AI hosts the MCP server for you. Pick the URL for your region:

| Region       | MCP server URL                        |
| ------------ | ------------------------------------- |
| US (default) | `https://mcp.confident-ai.com/mcp`    |
| EU           | `https://eu.mcp.confident-ai.com/mcp` |
| Self-hosted  | Your deployment's own `/mcp` URL      |

The examples below use the US URL. Swap in the EU URL if that's your region, or your own URL if you're [self-hosting](/docs/self-hosting).

#### Add the server to your client

The first time your client reaches the server it opens a browser window where you sign in to Confident AI and approve the connection. Your client stores the resulting token and refreshes it on its own, so you won't have to authenticate again.

#### Cursor

Add the following to your `.cursor/mcp.json` file:

```json
{
  "mcpServers": {
    "Confident AI MCP": {
      "url": "https://mcp.confident-ai.com/mcp"
    }
  }
}
```

Then open **Cursor Settings → MCP** and hit **Authenticate** on the server to finish signing in through your browser.

#### Claude Code

Run the following in your terminal:

```bash
claude mcp add --transport http confident-ai https://mcp.confident-ai.com/mcp
```

Then run `/mcp` inside Claude Code and pick the server to authenticate in your browser.

#### Claude Desktop

Claude Desktop connects through its UI rather than a config file:

1. Open **Settings → Connectors**.
2. Click **Add custom connector**.
3. Give it a name (for example, `Confident AI`) and paste `https://mcp.confident-ai.com/mcp` as the URL.
4. Click **Connect**, then finish signing in through the browser window that opens.

#### Windsurf

Add the following to your Windsurf MCP configuration:

```json
{
  "mcpServers": {
    "Confident AI MCP": {
      "serverUrl": "https://mcp.confident-ai.com/mcp"
    }
  }
}
```

Then refresh the MCP panel and complete the browser sign-in.

> Using a client that only speaks stdio, or one that can't run the OAuth
> handshake itself? Bridge it with
> [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) — run it as the
> command with the server URL as its only argument, and it handles the browser
> sign-in on the client's behalf.

#### Pick a project

Every tool takes a required `project_id` — except `list_projects`, which is how your agent discovers the ids available to it, and the organization-wide governance tools.

In practice you never type an id yourself. Ask your agent to work in a project by name, and it will call `list_projects` first, match the name, and reuse that id for the rest of the session:

```text
List my Confident AI projects, then pull the latest traces from the production one.
```

`list_projects` returns each project's `id`, `name`, `description`, organization, and governance policy — enough for your agent to tell them apart, or to ask you which one you meant when the name is ambiguous.

## Tools

The server groups its tools into areas, one per area of the platform — prompts, datasets, traces, dashboards, governance, and the rest. Each tool's description is written for the model that reads it, so an agent can usually pick the right one from the task alone.

#### [Available tools](/docs/reference/mcp/tools)

Every tool the server exposes, grouped by area, with what each one is for.

## Self-hosted deployments

If you run Confident AI inside your own cloud account, the MCP server ships with your deployment and talks to your instance rather than the hosted endpoint — your traces, prompts, and evaluation data never leave your infrastructure. Point your client at your deployment's `/mcp` URL in place of the hosted one; everything else on this page is unchanged.

Sign-in follows the same path. The MCP server advertises your own deployment's backend as its authorization server, so the OAuth flow runs entirely against your instance.

See [self-hosting](/docs/self-hosting) for how a self-hosted deployment is architected, and [security and compliance](/docs/self-hosting/security-and-compliance) for the full security model.

## FAQs

#### How is the MCP server different from the Confident API?

The MCP server is a tool interface over the same platform — same objects, same behaviour. Reach for the MCP server when an agent is doing the work from your editor, and for the [API](/docs/reference/api) or the [SDK](/docs/reference/sdk) when you are writing code that runs on its own.

#### Do I need an API key?

No. The MCP server authenticates with OAuth and acts as your user, so it reaches every project your account can. API keys are for the API and the SDKs, where there is no browser to sign in with.

#### Why does a tool say it needs a different plan?

Some areas are gated — risk assessments require the Enterprise plan, and classifiers, evaluation rules, and ingestion tasks require Starter or above. The tool returns the plan requirement rather than failing silently, so your agent can tell you what is missing.
