---
canonical_url: "https://docs.composio.dev/toolkits/opik_mcp"
markdown_url: "https://docs.composio.dev/toolkits/opik_mcp.md"
product: "platform"
version: null
last_updated: null
---

# Opik MCP

Read, list, create and update Opik LLM observability data (traces, spans, threads, datasets, experiments, prompts, scores and annotation queues) and load Opik agent skills through Comet's hosted Opik MCP server.

- **Category:** model context protocol
- **Auth:** DCR_OAUTH
- **Composio-managed OAuth available?** No
- **Tools:** 6
- **Triggers:** 0
- **Slug:** `OPIK_MCP`
- **Version:** 00000000_00

## Tools

### List

**Slug:** `OPIK_MCP_LIST`

List Opik entities with optional filters and pagination.

Output is a pipe-delimited table with id, name, and a few entity-specific
columns, plus a pagination footer when more pages exist. When filters
apply, the first line echoes what was applied. Use read() to get full
details on any specific item.

Project-scoped types require their parent:
- trace: project_id or project_name
- span: project_id or project_name (searches spans across the project)
- thread: project_id or project_name
- agent_insights_issue: project_id or project_name (Diagnostics issues,
  open ones by default; columns: severity, status, total_occurrences,
  latest_count, last_seen)
- score_name: project_id or project_name (the project's feedback score
  names — trace, span and thread scores together, paged, no id)
- online_rule: project_id or project_name (the automation rules scoring
  this project's traces)
- annotation_queue: project_id or project_name; takes `name`, `filters`, `sort`
- project_metric: project_id or project_name, plus metric_type — one
  metric over time. Rows are time buckets, so page/size/sort are refused.
- dataset_item: dataset_id, or experiment_ids to compare runs case by case.
  Filter the dataset's own cases on data.<key>, full_data, tags, source,
  trace_id (no sort); read('dataset_item', id) is one case whole
- prompt_version: prompt_id

Workspace-wide types (project, experiment, prompt, dataset) accept
an optional `name` substring filter. trace, span, thread, experiment and
dataset_item accept an OQL `filters` string; all but dataset_item also
take a `sort`, and trace, span, thread take a `since`/`until` window and
free-text `search`.


#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | Optional substring filter on entity name. Supported for project, experiment, prompt, dataset; ignored for sub-collections. |
| `page` | integer | No | Page number (1-indexed). |
| `size` | integer | No | Items per page. Capped at 100. |
| `sort` | string | No | Sort for trace, span, thread, experiment: '<field> [asc&#124;desc]', desc by default. E.g. 'duration desc', 'total_estimated_cost', 'feedback_scores.accuracy asc', 'usage.total_tokens'. One field only. |
| `since` | string | No | Start of the time window for trace, span, thread, project_metric, agent_insights_issue: a relative span ('30m', '1h', '24h', '7d') or an ISO-8601 instant with timezone. Trace/span/thread windows are by record creation time (for an exact start_time bound use filters); Diagnostics issues aggregate per report day, so their window is the UTC days it spans and defaults to all-time, matching the Diagnostics page. |
| `until` | string | No | End of the time window, same forms as since. |
| `fields` | string | No | Return only these columns, uncut: any name from the page's 'fields:' line ('data.question', 'feedback_scores.helpfulness', 'usage.total_tokens'). Each row keeps the id that opens the next level. An unknown name is refused with the valid ones. Omit for the table's own columns. |
| `search` | string | No | Free text for trace, span, thread: matches anywhere in id, name, input, output, metadata, tags, thread_id (spans: model, provider too). Expensive on large projects; narrow with since first. |
| `series` | string | No | project_metric only, with breakdown: which series to group — a percentile (p50/p90/p99), a score name, or a usage key. |
| `status` | string | No | agent_insights_issue only: which Diagnostics issues to list. Defaults to 'open' (what is broken now); 'resolved' and 'closed' show issues already dealt with. Ignored for other entity types. |
| `filters` | string | No | OQL filter for trace, span, thread, experiment, dataset_item, project_metric: <field>[.<key>] <op> <value> [AND ...]; ops = != > >= < <= contains not_contains starts_with ends_with is_empty is_not_empty in not_in; strings quoted, numbers bare (duration in ms). E.g. 'error_info is_not_empty AND duration > 5000', 'feedback_scores.accuracy < 0.5 AND start_time >= "2026-09-08T00:00:00Z"'. trace/span/thread default to source = "sdk"; a metric is filtered by the fields of the entity it is about. Reference: schema("list.trace"). |
| `interval` | string ("daily" | "hourly" | "total" | "weekly") | No | project_metric only: bucket width. Omitted, it follows the window the way the Metrics tab does: hourly up to 3 days, daily up to 30, weekly beyond. |
| `breakdown` | string | No | project_metric only: group each bucket by this field, or 'metadata.<key>'. Not valid for every metric — schema('list.project_metric') says which. |
| `prompt_id` | string | No | Required when listing prompt_versions. UUID of the prompt. |
| `dataset_id` | string | No | Required when listing dataset_items, unless experiment_ids is given. UUID of the dataset. |
| `project_id` | string | No | Parent project UUID for project-scoped lists (trace, span, thread, agent_insights_issue). Pass this OR project_name. |
| `entity_type` | string ("agent_insights_issue" | "annotation_queue" | "dataset" | "dataset_item" | "experiment" | "online_rule" | "project" | "project_metric" | "prompt" | "prompt_version" | "score_name" | "span" | "thread" | "trace") | Yes | One of: agent_insights_issue, annotation_queue, dataset, dataset_item, experiment, online_rule, project, project_metric, prompt, prompt_version, score_name, span, thread, trace. |
| `metric_type` | string ("guardrails_failed_count" | "span_average_duration" | "span_cost" | "span_count" | "span_duration" | "span_error_rate" | "span_feedback_scores" | "span_token_usage" | "thread_average_duration" | "thread_cost" | "thread_count" | "thread_duration" | "thread_feedback_scores" | "trace_average_duration" | "trace_cost" | "trace_count" | "trace_duration" | "trace_error_rate" | "trace_feedback_scores" | "trace_token_usage") | No | project_metric only: which metric to chart. Reference: schema('list.project_metric'). |
| `project_name` | string | No | Parent project name — alternative to project_id for project-scoped lists; no UUID lookup needed. |
| `experiment_ids` | string | No | dataset_item: compare these experiments case by case — which cases regressed, not two averages. First id is the baseline; up to 10. Resolves the dataset itself; sort and search apply to the runs, and so do filters (without it they apply to the cases). |

### Read

**Slug:** `OPIK_MCP_READ`

Read any Opik entity by ID, name, or opik:// URI.

A UUID `id` costs one API call. A name also works for project,
experiment, prompt, dataset and annotation_queue: two calls, and a name
several records share returns them as candidates to retry by id.

Special shapes:
- project: returns {project, summary, vocabulary, contains, url} — the
  week's figures against the 7 days before (SDK traffic only, as the Logs
  cards show, though the UI opens on 30 days), the score names and usage
  keys to filter on, and the freshest experiment / dataset / prompt version
  / run. `since`/`until` move the summary's window; the rest is current.
- trace: returns {trace, spans, spansTruncated} with up to 200 spans
  inlined, their bodies slim, and spanBodies saying what the cut took.
- prompt: returns {prompt, versions, versionsTruncated} with up to 100 versions.
- annotation_queue: annotator_view.html comes back as html_chars, with the
  fields=['annotator_view.html'] call that returns it whole.
- thread: returns {thread, messages, messagesTruncated, messageBodies} —
  each message is one turn's trace input/output + a trace_id to
  read('trace', id). Bodies are slim, the thread's own first/last message
  included, since those are copies of the first and last turn. Needs
  project scope: pass a thread link/URI, or project_id/project_name.
- An inlined collection longer than what fits sets its …Truncated flag and
  adds moreSpans / moreMessages / moreVersions: the count, and the exact
  list(...) call that continues from where the inlined part stopped.
- agent_insights_issue: returns {issue, example_trace_ids, details, url,
  trace_url_template} — the Diagnostics issue with cause and suggested fix,
  the deduped ids of traces that exhibit it (open one with read('trace', id)),
  the per-day breakdown, the issue's Diagnostics page link, and a template
  for linking any example trace (both links omitted when the Opik URL or
  the session's workspace is unknown). Needs project scope like thread.
- All others: the flat record from /v1/private/{entity}/{id}.

Output is a one-line `[read: …]` header (entity_type, id, size in
tokens) followed by the record as compact JSON. The record you asked for
is never truncated: a large answer is large, and narrowing is done by
asking a narrower question — `fields` to name the paths you want back, a
span rather than its trace, a filtered `list` rather than a composite
read. A `fields` answer says in its header that it was projected.

The children a composite read inlines are the exception. Their bodies come
back slim: a field over ~10 KB is cut and base64 images are replaced with
"[image]", which is what keeps one attachment from costing more than the
other 199 spans together. The read says so in `spanBodies` /
`messageBodies`, and the named child is whole again through its own
read('span', id) or read('trace', trace_id).


#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | Yes | UUID, entity name (for nameable types), full opik:// URI (e.g. opik://traces/<uuid>), or a pasted Opik link — a thread link or a Diagnostics page link (…/projects/<pid>/diagnostics?issue=<id>). When a URI/link is passed, entity_type (and, for project-scoped entities, the project) is overridden from it. |
| `since` | string | No | Start of the window, as a relative span ('7d', '24h') or an ISO-8601 instant with timezone. On read: project (the summary's period, 7d by default) and agent_insights_issue (per-day details, truncated to UTC report days, all-time by default). Rejected for other types. |
| `until` | string | No | End of the window, same forms as since. |
| `fields` | string | No | Return only these paths of the record, uncut: dotted into nested objects ('trace.output'), arrays whole ('spans'). The record's id is always kept; an unknown path is refused with the valid ones. The answer says it was projected and what it omitted. Omit for the whole record. |
| `project_id` | string | No | Project UUID. Required for entity_type='thread' and 'agent_insights_issue' unless the id is a full Opik URL/URI (which carries the project). Ignored for globally-unique entities like trace/span. |
| `entity_type` | string ("agent_insights_issue" | "annotation_queue" | "dataset" | "dataset_item" | "experiment" | "project" | "prompt" | "span" | "thread" | "trace") | Yes | One of: agent_insights_issue, annotation_queue, dataset, dataset_item, experiment, project, prompt, span, thread, trace. |
| `project_name` | string | No | Project name — alternative to project_id for project-scoped reads (thread, agent_insights_issue). |

### Read skill

**Slug:** `OPIK_MCP_READ_SKILL`

Load one Opik agent skill — the same skills Opik publishes for coding agents. Use it when the skill you need is not already in your context.

WHEN TO CALL: before instrumenting, evaluating, or debugging with Opik — no local copy in the project, nothing fetched earlier this session.

Match the user's task to a skill:
- opik: "why aren't my traces showing up", "how do I add metadata to a span", "how do I version a prompt" — any SDK lookup. To instrument, use opik-instrument.
- opik-annotate: "build a custom annotator view", "set up an annotation queue".
- opik-compare: "did my fix work", "compare against the baseline", "run the regression suite", "why did quality drop", "which cases regressed", "compare these two experiments".
- opik-diagnose: "what is broken in production", "which traces need attention", "find failing or slow traces", "triage my agent".
- opik-evaluate: "evaluate my agent", "measure quality", "build an eval", "write an LLM judge", "how good is my RAG" — a first experiment with scores.
- opik-explain: "why did this trace fail", "explain this trace", "debug this trace", "why is my agent slow or wrong".
- opik-instrument: "instrument my code", "add opik tracing", "add observability", "trace my agent".
- opik-online-eval: "score production traces", "monitor hallucinations in prod", "take this judge live", "set up an online evaluation rule".
- opik-optimize: "optimize this prompt", "improve my system prompt", "tune the prompt against my dataset", "run the prompt optimizer".
- opik-test: "turn this into a test", "add a regression case for this trace", "make sure this doesn't happen again", "capture this failure".
- opik-verify: "is this safe to ship", "can I merge this", "go/no-go on this change", "gate this release" — a ship/hold verdict against a release policy.

`skill_name` accepts any of these forms:
- `opik` — the skill itself
- `<skill>/references/<file>.md` — one document inside a skill; a SKILL.md ends with the list of its references

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `skill_name` | string | Yes | A skill name ('opik-instrument'), a path inside a skill ('opik/references/tracing-python.md'), or a resource URI ('opik://skills/opik/SKILL.md'). A SKILL.md ends with the list of its references. |

### Schema

**Slug:** `OPIK_MCP_SCHEMA`

Return the JSON Schema, OAuth scope, and one validated example for a write operation's `data` payload, or — for `list.trace` / `list.span` / `list.thread` / `list.experiment` — the list tool's filterable fields with their operators and its sortable fields. Pure lookup — no backend call.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `operation` | string ("trace.create" | "trace.update" | "span.create" | "score.create" | "comment.create" | "prompt_version.save" | "dataset.create" | "dataset_item.upsert" | "experiment.create" | "experiment_item.create" | "thread.close" | "thread.open" | "agent_insights_issue.resolve" | "agent_insights_issue.close" | "agent_insights_issue.reopen" | "agent_insights_job.enable" | "agent_insights_job.trigger" | "annotation_queue.create" | "annotation_queue.update" | "list.trace" | "list.span" | "list.thread" | "list.experiment" | "list.dataset_item" | "list.dataset_item_case" | "list.annotation_queue" | "list.project_metric") | Yes | Write operation whose schema to return, or list.<entity> (list.trace, list.span, list.thread, list.experiment) for the filter and sort reference of the list tool. |

### Send feedback

**Slug:** `OPIK_MCP_SEND_FEEDBACK`

Send feedback about this MCP server (opik-mcp) to the Opik team at Comet. It is not for the user's Opik data. Call it when an opik-mcp tool failed, gave a wrong or confusing result, or cannot do what the user needs, or when the user asks to send feedback. Do not call it when the task went well, to report progress, or as a test. Send at most one report per task. Describe the problem in general terms: no trace content, names, IDs or secrets from the user's data. The report carries the workspace name and the user's Comet login.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tool` | string ("read" | "list" | "write" | "schema" | "read_skill" | "none") | No | The opik-mcp tool it concerns. |
| `impact` | string ("blocked" | "workaround" | "minor") | Yes | blocked: the task could not be done. workaround: it was done another way. minor: it cost time only. |
| `target` | string | No | The entity type or write operation, e.g. trace. |
| `category` | string ("error" | "wrong_result" | "confusing" | "missing_capability" | "slow" | "other") | Yes | What went wrong. |
| `description` | string | Yes | 2-4 sentences: what you tried, what came back, what you expected. No user data. |
| `requested_by_user` | boolean | No | True when the user asked to send this. |

### Write

**Slug:** `OPIK_MCP_WRITE`

Create, update, or annotate Opik entities. The `operation` field selects which entity/verb pair to invoke; `data` carries the payload for that operation (single object, or array up to 1000 for batch).

Operations:
- trace.create: Log a single trace (or a batch). Sets up the parent for spans/scores/comments. (batch ok)
- trace.update: Finalize or amend an existing trace by id. (batch ok)
- span.create: Log a single span on an existing trace (or a batch).; required: trace_id (batch ok)
- score.create: Attach a numeric feedback score to a trace, span, or thread.; required: target, target_id (batch ok)
- comment.create: Attach a free-text comment to a trace, span, or thread.; required: target, target_id
- prompt_version.save: Save a new prompt version. Creates the prompt by name if missing; BE auto-assigns the commit when omitted.
- dataset.create: Create a dataset. Pass type='test_suite' for an evaluation suite (items carry assertions and run as tests); default is a plain dataset.
- dataset_item.upsert: Upsert items into a dataset or test suite; data is the envelope {dataset_name|dataset_id, items: [...]}.; required: dataset_name, dataset_id
- experiment.create: Create an experiment scoped to a dataset or test suite.; required: dataset_name, dataset_id
- experiment_item.create: Attach trace + dataset_item rows to an experiment. Always the array envelope.; required: experiment_id, dataset_item_id, trace_id (batch ok)
- thread.close: Close a thread (mark it inactive/done). Pass thread_id + project (project_name or project_id).
- thread.open: Reopen a previously closed thread (mark it active). Pass thread_id + project (project_name or project_id).
- agent_insights_issue.resolve: Mark a Diagnostics (Agent Insights) issue resolved — the failure it groups has been dealt with. It leaves the default issue list and shows under status='resolved'. Pass issue_id + project_id or project_name. Do this only when the user asks: whether a failure is fixed is their call, not an inference from the traces.
- agent_insights_issue.close: Mark a Diagnostics (Agent Insights) issue closed — not worth acting on, as opposed to fixed. It leaves the default issue list and shows under status='closed'. Pass issue_id + project_id or project_name. Do this only when the user asks.
- agent_insights_issue.reopen: Put a resolved or closed Diagnostics (Agent Insights) issue back on the open list, for a failure that came back or was closed too early. Pass issue_id + project_id or project_name.
- agent_insights_job.enable: Turn Diagnostics (Agent Insights) on for a project: it then scans daily and groups recurring failures into issues you can read with list('agent_insights_issue', …). Pass project_id or project_name. Idempotent — an existing job is switched back on. Pair it with agent_insights_job.trigger to scan now instead of waiting for the nightly run. Refused when the deployment has no Diagnostics.
- agent_insights_job.trigger: Run a Diagnostics (Agent Insights) scan for a project now, over the last 24 hours, instead of waiting for the nightly run. Fire and forget: the response says where to watch it, and issues appear in list('agent_insights_issue', …) once the run finishes (minutes). Needs Diagnostics enabled for the project — see agent_insights_job.enable.
- annotation_queue.create: Create a project's annotation queue of traces or threads to review; annotator_view sets a custom HTML view, read_skill('opik-annotate') first.
- annotation_queue.update: Change an annotation queue by id; only the fields passed change. clear_annotator_view removes its custom view.

Notes:
- `data` shape: object for single, array for batch (where supported). Always-envelope ops (dataset_item.upsert, experiment_item.create) take their list inside the envelope, not at the top level.
- `dry_run=true`: validate + check authorization without calling the backend. Returns {dry_run, would_call: {method, path, body_size}}.
- A schema mismatch returns `validation_failed` with the issues and one corrected example; `schema(operation)` returns the JSON Schema.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Payload for the operation. Object for a single write, or array (max 1000 elements) for batch. Always-envelope operations (dataset_item.upsert, experiment_item.create) take their list inside the envelope, not at the top level. |
| `dry_run` | boolean | No | Validate against the operation's schema and OAuth scope without calling the backend. Returns {dry_run: true, would_call: ...}. |
| `operation` | string ("trace.create" | "trace.update" | "span.create" | "score.create" | "comment.create" | "prompt_version.save" | "dataset.create" | "dataset_item.upsert" | "experiment.create" | "experiment_item.create" | "thread.close" | "thread.open" | "agent_insights_issue.resolve" | "agent_insights_issue.close" | "agent_insights_issue.reopen" | "agent_insights_job.enable" | "agent_insights_job.trigger" | "annotation_queue.create" | "annotation_queue.update") | Yes | The entity/verb pair to invoke. See tool description for the list. Call schema(operation) for the JSON Schema, example, and required scope. |
| `idempotency_key` | string | No | Optional client-supplied UUID. Re-running with the same key is a no-op on the backend. Takes precedence over data.id when both are set. |
