Opik MCP Server

平台与服务

by comet-ml

通过 Model Context Protocol 与 Opik 的 prompts、traces 和 metrics 交互,便于统一访问与分析。

通过 MCP 把 Opik 的提示词、追踪和指标统一打通,少了来回切换与数据割裂,做 AI 应用分析调试更省心。

什么是 Opik MCP Server

通过 Model Context Protocol 与 Opik 的 prompts、traces 和 metrics 交互,便于统一访问与分析。

README

<h1 align="center" style="border-bottom: none"> <div> <a href="https://www.comet.com/site/products/opik/?from=llm&utm_source=opik&utm_medium=github&utm_content=header_img&utm_campaign=opik-mcp"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/comet-ml/opik-mcp/refs/heads/main/docs/assets/logo-dark-mode.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/comet-ml/opik-mcp/refs/heads/main/docs/assets/logo-light-mode.svg"> <img alt="Comet Opik logo" src="docs/assets/logo-light-mode.svg" width="200" /> </picture> </a> <br /> Opik MCP Server </div> </h1> <p align="center"> Model Context Protocol (MCP) server for <a href="https://github.com/comet-ml/opik/">Opik</a>, with both local stdio and remote streamable-http transports. </p> <div align="center">

License Node.js Version TypeScript <a href="https://www.comet.com/docs/opik/prompt_engineering/mcp_server"><img src="https://badge.mcpx.dev?status=on" title="MCP Enabled" alt="MCP Enabled" /></a> <a href="https://doi.org/10.5281/zenodo.15411156"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.15411156.svg" alt="DOI" /></a>

</div> <p align="center"> <a href="https://www.comet.com/site/products/opik/?from=llm&utm_source=opik&utm_medium=github&utm_content=website_button&utm_campaign=opik"><b>Website</b></a> • <a href="https://chat.comet.com"><b>Slack community</b></a> • <a href="https://x.com/Cometml"><b>Twitter</b></a> • <a href="https://www.comet.com/docs/opik/?from=llm&utm_source=opik&utm_medium=github&utm_content=docs_button&utm_campaign=opik"><b>Documentation</b></a> </p>

[!IMPORTANT] This repository ships the MCP server implementation only. We do not currently provide a hosted remote MCP service for Opik. If you run streamable-http remotely, authentication is fail-closed by default.

Why this server

Opik MCP Server gives MCP-compatible clients one interface for:

  • Prompt lifecycle management
  • Workspace, project, and trace exploration
  • Metrics and dataset operations
  • MCP resources and resource templates for metadata-aware flows

Quickstart

1. Run with npx

bash
# Opik Cloud
npx -y opik-mcp --apiKey YOUR_API_KEY

For self-hosted Opik, pass --apiUrl (for example http://localhost:5173/api) and use your local auth strategy.

2. Add to your MCP client

Cursor (.cursor/mcp.json):

json
{
  "mcpServers": {
    "opik": {
      "command": "npx",
      "args": ["-y", "opik-mcp", "--apiKey", "YOUR_API_KEY"]
    }
  }
}

VS Code / GitHub Copilot (.vscode/mcp.json):

json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "opik-api-key",
      "description": "Opik API Key",
      "password": true
    }
  ],
  "servers": {
    "opik-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "opik-mcp", "--apiKey", "${input:opik-api-key}"]
    }
  }
}

Windsurf (raw config):

json
{
  "mcpServers": {
    "opik": {
      "command": "npx",
      "args": ["-y", "opik-mcp", "--apiKey", "YOUR_API_KEY"]
    }
  }
}

More client-specific examples: docs/ide-integration.md

Run from source

bash
git clone https://github.com/comet-ml/opik-mcp.git
cd opik-mcp
npm install
npm run build

Optional local config:

bash
cp .env.example .env

Start the server:

bash
npm run start:stdio
npm run start:http

Transport modes

TransportUse caseCommand
stdioLocal MCP integration (same machine as client)npm run start:stdio
streamable-httpRemote/self-hosted MCP endpoint (/mcp)npm run start:http

Remote auth defaults (streamable-http)

  • Authorization: Bearer <OPIK_API_KEY> or x-api-key is required by default.
  • Workspace is resolved server-side (token map recommended); workspace headers are not trusted by default.
  • In remote mode, request-context workspace takes precedence over tool workspaceName.
  • Missing or invalid auth returns HTTP 401.

Key environment flags:

  • STREAMABLE_HTTP_REQUIRE_AUTH (default true)
  • STREAMABLE_HTTP_VALIDATE_REMOTE_AUTH (default true, except test env)
  • REMOTE_TOKEN_WORKSPACE_MAP (JSON token-to-workspace map)
  • STREAMABLE_HTTP_TRUST_WORKSPACE_HEADERS (default false)

Deep dive: docs/streamable-http-transport.md

Toolsets

Toolsets let you narrow which capabilities are enabled:

  • core
  • integration
  • expert-prompts
  • expert-datasets
  • expert-trace-actions
  • expert-project-actions
  • metrics
  • all (enables all modern toolsets)

Configure via:

  • CLI: --toolsets all
  • Env: OPIK_TOOLSETS=core,expert-prompts,metrics

Details: docs/configuration.md

MCP resources and prompts

  • resources/list exposes static URIs (for example opik://workspace-info)
  • resources/templates/list exposes dynamic URI templates (for example opik://projects/{page}/{size})
  • resources/read supports static and templated URIs
  • prompts/list and prompts/get expose workflow prompts

Development

bash
# Lint
npm run lint

# Test
npm test

# Build
npm run build

# Run precommit checks
make precommit

Documentation

Contributing

Please read CONTRIBUTING.md before opening a PR.

Citation

If you use this project in research, cite:

code
Comet ML, Inc, Koc, V., & Boiko, Y. (2025). Opik MCP Server. Github. https://doi.org/10.5281/zenodo.15411156

BibTeX:

bibtex
@software{CometML_Opik_MCP_Server_2025,
  author = {{Comet ML, Inc} and Koc, V. and Boiko, Y.},
  title = {{Opik MCP Server}},
  year = {2025},
  publisher = {GitHub},
  url = {https://doi.org/10.5281/zenodo.15411156},
  doi = {10.5281/zenodo.15411156}
}

Citation metadata is also available in CITATION.cff.

License

Apache 2.0

常见问题

Opik MCP Server 是什么?

通过 Model Context Protocol 与 Opik 的 prompts、traces 和 metrics 交互,便于统一访问与分析。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描137.2k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描137.2k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描15.4k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
85.9k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.9k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
51.1k

评论