# Opik MCP

```json
{
  "name": "Opik MCP",
  "slug": "opik_mcp",
  "url": "https://composio.dev/toolkits/opik_mcp",
  "markdown_url": "https://composio.dev/toolkits/opik_mcp.md",
  "logo_url": "https://logos.composio.dev/api/opik",
  "categories": [
    "ai & machine learning"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-12-03T05:52:38.792Z"
}
```

![Opik MCP logo](https://logos.composio.dev/api/opik)

## Description

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Opik MCP or direct API to read traces, manage datasets, review experiments, and update prompts through natural language.

## Summary

Opik MCP is Comet's hosted interface for Opik LLM observability data.
It provides a structured way to inspect and manage traces, experiments, prompts, and evaluation results.

## Categories

- ai & machine learning

## Toolkit Details

- Tools: 6

## Images

- Logo: https://logos.composio.dev/api/opik

## Authentication

- **Dcr Oauth**
  - Type: `custom`
  - Description: Dcr Oauth authentication for Opik MCP.
  - Setup:
    - Configure Dcr Oauth credentials for Opik MCP.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- Summarize errors in yesterday's production traces
- Compare scores across two Opik experiments
- Find prompts linked to failed traces

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `OPIK_MCP_LIST` | 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., 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`. |
| `OPIK_MCP_READ` | 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). |
| `OPIK_MCP_READ_SKILL` | 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 - `/references/.md` — one document inside a skill; a SKILL.md ends with the list of its references |
| `OPIK_MCP_SCHEMA` | 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. |
| `OPIK_MCP_SEND_FEEDBACK` | 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. |
| `OPIK_MCP_WRITE` | 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. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
```python
pip install composio composio_openai openai
```

```typescript
npm install @composio/core @composio/openai openai
```

#### Path 1, Step 2: Create a Composio session

Initialize Composio with the OpenAI Responses provider and create a session scoped to Opik MCP
```python
import json
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
client = OpenAI()

session = composio.create(user_id="your-user-id", toolkits=["opik_mcp"])
tools = session.tools()
```

```typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["opik_mcp"] });
const tools = await session.tools();
```

#### Path 1, Step 3: Run Opik MCP tools with your agent

Send a request, execute the Opik MCP tool calls through the session, and print the final answer
```python
response = client.responses.create(
    model="gpt-5.6-sol",
    tools=tools,
    input=[{"role": "user", "content": "List the latest Opik traces for the production project and summarize any errors."}],
)

while True:
    tool_calls = [o for o in response.output if o.type == "function_call"]
    if not tool_calls:
        break
    results = composio.provider.handle_tool_calls(response=response, session=session)
    response = client.responses.create(
        model="gpt-5.6-sol",
        tools=tools,
        previous_response_id=response.id,
        input=[
            {"type": "function_call_output", "call_id": call.call_id, "output": json.dumps(results[i])}
            for i, call in enumerate(tool_calls)
        ],
    )

print(response.output_text)
```

```typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "List the latest Opik traces for the production project and summarize any errors." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK and your agent framework
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
```

#### Path 2, Step 2: Create a session with MCP enabled

Create a session scoped to Opik MCP and read its MCP URL and headers
```python
from composio import Composio

composio = Composio()
session = composio.create(user_id="your-user-id", toolkits=["opik_mcp"], mcp=True)
```

```typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["opik_mcp"],
  mcp: true,
});
```

#### Path 2, Step 3: Connect your agent to the MCP server

Pass the session's MCP URL and headers to your agent and run a Opik MCP request
```python
import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage, TextBlock

options = ClaudeAgentOptions(
    mcp_servers={
        "composio": {
            "type": "http",
            "url": session.mcp.url,
            "headers": session.mcp.headers,
        }
    },
    system_prompt="You are a helpful assistant with access to Opik MCP tools.",
    tools=[],
    allowed_tools=["mcp__composio__*"],
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query("List the latest Opik traces for the production project and summarize any errors.")
        async for message in client.receive_response():
            if isinstance(message, AssistantMessage):
                for block in message.content:
                    if isinstance(block, TextBlock):
                        print(block.text)

asyncio.run(main())
```

```typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "List the latest Opik traces for the production project and summarize any errors.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
```

## Why Use Composio?

### 1. AI Native Opik MCP Integration

- Supports both Opik MCP and direct API based integrations
- Structured, LLM-friendly schemas for reliable tool execution
- Rich coverage for reading, writing, and querying your Opik MCP data

### 2. Managed Auth

- Connect your DCR OAuth credentials without embedding them in agent code
- Central place to manage, scope, and revoke Opik MCP access
- Per user and per environment credentials instead of hard-coded keys

### 3. Agent Optimized Design

- Tools are tuned using real error and success rates to improve reliability over time
- Comprehensive execution logs so you always know what ran, when, and on whose behalf

### 4. Enterprise Grade Security

- Fine-grained RBAC so you control which agents and users can access Opik MCP
- Scoped, least privilege access to Opik MCP resources
- Full audit trail of agent actions to support review and compliance

## Use Opik MCP with any AI Agent Framework

Choose a framework you want to connect Opik MCP with:

- [ChatGPT](https://composio.dev/toolkits/opik_mcp/framework/chatgpt)
- [Claude Cowork](https://composio.dev/toolkits/opik_mcp/framework/claude-cowork)

## Related Toolkits

- [Composio](https://composio.dev/toolkits/composio) - Composio is an integration platform that connects AI agents with hundreds of business tools. It streamlines authentication and lets you trigger actions across services—no custom code needed.
- [Perplexityai](https://composio.dev/toolkits/perplexityai) - Perplexityai delivers natural, conversational AI models for generating human-like text. Instantly get context-aware, high-quality responses for chat, search, or complex workflows.
- [Ai ml api](https://composio.dev/toolkits/ai_ml_api) - Ai ml api is a suite of AI/ML models for natural language and image tasks. It provides fast, scalable access to advanced AI capabilities for your apps and workflows.
- [AI/ML API MCP](https://composio.dev/toolkits/ai_ml_api_mcp) - AI/ML API MCP is a unified gateway to hundreds of AI models and generation APIs. It gives teams one place to compare models, run multimodal jobs, and track usage.
- [Aivoov](https://composio.dev/toolkits/aivoov) - Aivoov is an AI-powered text-to-speech platform offering 1,000+ voices in over 150 languages. Instantly turn written content into natural, human-like audio for any application.
- [All images ai](https://composio.dev/toolkits/all_images_ai) - All-Images.ai is an AI-powered image generation and management platform. It helps you create, search, and organize images effortlessly with advanced AI capabilities.
- [AllModels](https://composio.dev/toolkits/allmodels) - AllModels is a unified API for text-to-speech, speech-to-text, realtime voice, and voice cloning across AI providers. It gives developers one consistent way to build and manage voice features.
- [AltText.ai MCP](https://composio.dev/toolkits/alttext_ai_mcp) - AltText.ai MCP is a hosted image alt text service for generating, translating, and managing accessible image descriptions. It helps teams improve image accessibility and SEO without building custom AI workflows.
- [AltTextLab](https://composio.dev/toolkits/alt_text_lab) - AltTextLab is an AI service that generates accessible, SEO-aware alt text for images. It helps teams make image content easier to understand, index, and publish.
- [Anam MCP](https://composio.dev/toolkits/anam_mcp) - Anam MCP is Anam's hosted interface for building and managing real-time AI avatar personas. It brings avatars, voices, LLMs, knowledge, tools, meetings, and analytics together in one integration.
- [Anthropic administrator](https://composio.dev/toolkits/anthropic_administrator) - Anthropic administrator is an API for managing Anthropic organizational resources like members, workspaces, and API keys. It helps you automate admin tasks and streamline resource management across your Anthropic organization.
- [Api labz](https://composio.dev/toolkits/api_labz) - Api labz is a platform offering a suite of AI-driven APIs and workflow tools. It helps developers automate tasks and build smarter, more efficient applications.
- [Apiframe](https://composio.dev/toolkits/apiframe) - Apiframe is an API platform for generating and managing AI images, videos, music, uploads, assets, jobs, and custom LoRAs. It gives developers one clean API for creative AI workflows without juggling multiple model providers.
- [Apipie ai](https://composio.dev/toolkits/apipie_ai) - Apipie ai is an AI model aggregator offering a single API for accessing top AI models from multiple providers. It helps developers build cost-efficient, latency-optimized AI solutions without juggling multiple integrations.
- [Arize AX](https://composio.dev/toolkits/arize_ax) - Arize AX is an AI engineering platform for tracing, evaluating, and improving AI applications. Use it to debug LLM behavior, compare experiments, and improve production AI quality.
- [Artificial Analysis](https://composio.dev/toolkits/artificial_analysis) - Artificial Analysis is an independent benchmarking platform for AI models and API providers. Use it to compare model intelligence, coding, math, pricing, latency, throughput, and arena rankings.
- [AssemblyAI](https://composio.dev/toolkits/assemblyai) - AssemblyAI is a speech-to-text and audio intelligence API for uploaded or hosted media. Use it to turn audio and video into accurate transcripts, summaries, and insights.
- [AssemblyAI MCP](https://composio.dev/toolkits/assemblyai_mcp) - AssemblyAI MCP is a hosted speech-to-text and audio intelligence service for transcribing and analyzing media. It helps teams turn audio and video into searchable, translated, actionable transcripts.
- [Astica ai](https://composio.dev/toolkits/astica_ai) - Astica ai provides APIs for computer vision, NLP, and voice synthesis. Integrate advanced AI features into your app with a single API key.
- [Avoma](https://composio.dev/toolkits/avoma) - Avoma is an AI meeting assistant for recording, transcribing, analyzing, and managing meetings, calls, notes, scorecards, and conversation intelligence. It helps teams turn conversations into searchable notes, follow-ups, coaching insights, and revenue intelligence.

## Frequently Asked Questions

### Do I need my own developer credentials to use Opik MCP with Composio?

Yes, Opik MCP requires you to configure your own Dcr OAuth credentials. Once set up, Composio handles secure credential storage and management for you.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
