# Opik MCP server

> Logs Claude Code sessions to Opik as traces and adds skills for instrumenting and evaluating AI applications.

- Repository: https://github.com/comet-ml/opik-claude-code-plugin
- Page: https://hostedmcp.org/servers/comet-ml/opik-claude-code-plugin
- Official: yes
- Transport: —
- Stars: 25
- License: Apache-2.0

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `OPIK_CC_PARENT_TRACE_ID` | no | no |  |
| `OPIK_CC_PROJECT` | no | no |  |
| `OPIK_CC_ROOT_SPAN_ID` | no | no |  |
| `OPIK_CC_TRUNCATE_FIELDS` | no | no |  |
| `OPIK_CC_WORKSPACE` | no | no |  |

## FAQ

### How do I install the Opik plugin for Claude Code?

Add the marketplace and install the plugin from within Claude Code, then restart any running sessions.

### How does Opik trace Claude Code sessions?

Each conversation turn becomes an Opik trace, and tool calls, thoughts, and responses become spans, with subagents nested under their parent Task span.

### How do I configure the Opik connection?

Install the Opik CLI and run opik configure, which writes your API URL, key, and workspace to ~/.opik.config.

### Can I send Claude Code traces to a different project or workspace?

Yes, set OPIK_CC_PROJECT and OPIK_CC_WORKSPACE, or the cc_project_name and cc_workspace keys in ~/.opik.config.

### How do I add Opik tracing to my own agent code?

Run /opik:instrument, which detects frameworks like OpenAI, LangChain, and CrewAI and adds the correct Opik integration.
