> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.comet.com/docs/opik/llms.txt.

# Opik's MCP server

Your coding assistant already writes the code. Connect it to Opik and it can also
see what that code does when it runs: read the traces, find the ones that failed,
score them, and fix the code against real data instead of your description of it.

> **Note**
>
> A coding agent installing this for a user: run `uvx opik-mcp@latest --help` first
> and follow its steps.

## Install in 30 seconds

Set up Cursor or VS Code on Opik Cloud in one click, or copy a prompt for any
other coding agent:

[![](/docs/opik/_fern-files/opik.docs.buildwithfern.com/68c88e317a03fefb7d8ed68b9fe86ef33c0a002765fa6bfc84cdc43d7bb9f4fe/img/mcp/cursor.svg)Cursor](cursor:////anysphere.cursor-deeplink/mcp/install?name=opik-mcp\&config=eyJ1cmwiOiJodHRwczovL3d3dy5jb21ldC5jb20vb3Bpay9hcGkvdjEvbWNwIn0= "Open Cursor and add the Opik MCP server (Cursor Pro or higher; MCP is not available on the Hobby plan)")

[![](/docs/opik/_fern-files/opik.docs.buildwithfern.com/4c4dd46cc5892a947901fbcdc96ee4caf4c9eb341779b2b0589d8a2bbff436ba/img/mcp/vscode.svg)VS Code](https://insiders.vscode.dev/redirect/mcp/install?name=opik-mcp\&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fwww.comet.com%2Fopik%2Fapi%2Fv1%2Fmcp%22%7D "Open VS Code and add the Opik MCP server")

[Install prompt](# "Copies an installation prompt. Paste it into any coding agent.")

> **Note**
>
> The Cursor and VS Code buttons connect to Opik Cloud. On a dedicated or
> self-hosted Comet deployment, such as `https://<company>.comet-hosted.com`, run
> `uvx opik mcp configure --local-server` or copy the config from
> [Self-hosted and dedicated deployments](/docs/opik/mcp-server/advanced-setup#self-hosted-and-dedicated-deployments).

Or run one command: it connects your assistant to your traces and teaches it how
to create them in the first place. It needs [`uv`](https://docs.astral.sh/uv/) and
no Opik SDK:

#### Run the setup command

```bash wordWrap
uvx opik mcp configure
```

#### Install uv, if you don't have it

**`macOS / Linux`**

```bash title="macOS / Linux" wordWrap
curl -LsSf https://astral.sh/uv/install.sh | sh
```

**`Windows`**

```powershell title="Windows" wordWrap
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

It detects your AI client (Claude Code, Cursor, VS Code Copilot, Codex,
opencode), picks the right server for your Opik deployment, configures it,
installs the Opik skill pack, and checks that what it just wrote works.

#### Try with your agent

Assistants read their configuration at startup, so **start a new session**
before trying anything. On Opik Cloud, complete the browser sign-in when your
client prompts for it, then ask your assistant to confirm the connection:

**`Check it worked`**

```text title="Check it worked" wordWrap
List my Opik projects.
```

Writing the config yourself, or the CLI didn't detect your client?
[Advanced setup](/docs/opik/mcp-server/advanced-setup) has the exact block for each one.

## What you can do with it

#### Instrument this project

It adds tracing in the right places for your framework, runs the app, and
reads the trace back to prove it arrived.

#### Why did this trace fail?

It reads the whole span tree, the errors and the feedback scores directly,
instead of you pasting screenshots into chat.

#### What's breaking in production?

It queries your failing, slowest and most expensive traces over any time
window, and tells you what they have in common.

#### Analyze your experiments

It finds the regressions and low performing cases, debugs the specific traces
behind them, and turns that into conclusions and action items.

[Use cases](/docs/opik/mcp-server/use-cases) has the prompts to paste for each of these.

## Go deeper

#### [Use cases](/docs/opik/mcp-server/use-cases)

Prompts to paste, grouped by what you're trying to get done.

#### [MCP tools reference](/docs/opik/mcp-server/tools)

Every tool the server exposes, what it can read and write, and what it can't.

#### [Advanced setup](/docs/opik/mcp-server/advanced-setup)

Per-client config by hand, hosted vs. local server, workspaces, CI.

#### [FAQ and troubleshooting](/docs/opik/mcp-server/faq)

It isn't connecting, or it's showing data you don't expect.