Opik — Claude Code MCP server: what it does, how to install
Connects an AI assistant to Opik workspaces so you can inspect traces, experiments, datasets and prompts, score results, and save prompt versions from chat.
claude mcp add --transport http opik-mcp https://www.comet.com/opik/api/v1/mcpWhat Opik does
Opik connects Claude Code and other MCP clients to an Opik workspace. An assistant can inspect traces, experiments, datasets and prompts, assign a score to a trace with a reason, and save prompt versions. That keeps Opik checks close to the coding conversation.
For Opik Cloud, the server uses HTTP at https://www.comet.com/opik/api/v1/mcp and signs in through the browser with OAuth, so no API key is handled. Self-hosted and open-source Opik run locally as uvx opik-mcp over stdio; configuration uses OPIK_API_KEY, OPIK_WORKSPACE, OPIK_URL, and COMET_URL_OVERRIDE. Local setup requires uv, so the server will not start without it. Start a new client session after configuration.
What it helps with
- find failed traces in an Opik project
- inspect experiments and datasets from a workspace
- score a trace with a value and explanation
- save a new prompt version
- connect Opik Cloud or a local server to an MCP client
Example prompts for the agent
- Find the traces that failed today in the Opik project
demo. - Give trace
7f2e…a0.9helpfulness score and record the reason “great recovery”. - Save this prompt as a new version in Opik and list its available versions.
How to install Opik
1Platform CLI: remote server
claude mcp add --transport http opik-mcp https://www.comet.com/opik/api/v1/mcp2Platform CLI
claude mcp add --env OPIK_API_KEY=<OPIK_API_KEY> --env OPIK_WORKSPACE=<OPIK_WORKSPACE> --env OPIK_URL=<OPIK_URL> --env COMET_URL_OVERRIDE=<COMET_URL_OVERRIDE> --transport stdio opik -- uvx opik-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from opik-mcp <command>
1Platform CLI: remote server
codex mcp add opik --url https://www.comet.com/opik/api/v1/mcp2Platform CLI
codex mcp add opik --env OPIK_API_KEY=<OPIK_API_KEY> --env OPIK_WORKSPACE=<OPIK_WORKSPACE> --env OPIK_URL=<OPIK_URL> --env COMET_URL_OVERRIDE=<COMET_URL_OVERRIDE> -- uvx opik-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from opik-mcp <command>
Config file
{
"mcpServers": {
"opik": {
"url": "https://www.comet.com/opik/api/v1/mcp"
}
}
}{
"mcpServers": {
"opik": {
"command": "uvx",
"args": [
"opik-mcp"
],
"env": {
"OPIK_API_KEY": "<OPIK_API_KEY>",
"OPIK_WORKSPACE": "<OPIK_WORKSPACE>",
"OPIK_URL": "<OPIK_URL>",
"COMET_URL_OVERRIDE": "<COMET_URL_OVERRIDE>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from opik-mcp <command>
Config file
{
"servers": {
"opik": {
"type": "http",
"url": "https://www.comet.com/opik/api/v1/mcp"
}
}
}{
"servers": {
"opik": {
"type": "stdio",
"command": "uvx",
"args": [
"opik-mcp"
],
"env": {
"OPIK_API_KEY": "<OPIK_API_KEY>",
"OPIK_WORKSPACE": "<OPIK_WORKSPACE>",
"OPIK_URL": "<OPIK_URL>",
"COMET_URL_OVERRIDE": "<COMET_URL_OVERRIDE>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from opik-mcp <command>
1Platform CLI: remote server
gemini mcp add -t http opik https://www.comet.com/opik/api/v1/mcp2Platform CLI
gemini mcp add -e OPIK_API_KEY=<OPIK_API_KEY> -e OPIK_WORKSPACE=<OPIK_WORKSPACE> -e OPIK_URL=<OPIK_URL> -e COMET_URL_OVERRIDE=<COMET_URL_OVERRIDE> opik uvx opik-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from opik-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Opik
How do I install Opik in Claude Code?
For the Opik Cloud hosted server, run claude mcp add --transport http opik-mcp https://www.comet.com/opik/api/v1/mcp. Then start a new session and complete the browser sign-in.
What does Opik do?
The MCP server lets an assistant access Opik traces, experiments, datasets and prompts. It can read those records, write trace scores, and save prompt versions from chat.
How does Opik Cloud differ from the local server?
Opik Cloud uses the hosted HTTP endpoint and browser OAuth without an API key. Self-hosted or open-source Opik runs through uvx opik-mcp over stdio and reads its configuration from environment variables.