Opik MCP Server Model Context Protocol (MCP) server for Opik , with both local stdio and remote streamable-http transports. Website • Slack community • Twitter • Documentation 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-a
Add this skill
npx mdskills install comet-ml/opik-mcpWell-documented MCP server with clear IDE setup instructions and useful LLM platform tools
1<h1 align="center" style="border-bottom: none">2 <div>3 <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">4 <picture>5 <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/comet-ml/opik-mcp/refs/heads/main/docs/assets/logo-dark-mode.svg">6 <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/comet-ml/opik-mcp/refs/heads/main/docs/assets/logo-light-mode.svg">7 <img alt="Comet Opik logo" src="docs/assets/logo-light-mode.svg" width="200" />8 </picture>9 </a>10 <br />11 Opik MCP Server12 </div>13</h1>1415<p align="center">16Model Context Protocol (MCP) server for <a href="https://github.com/comet-ml/opik/">Opik</a>, with both local stdio and remote streamable-http transports.17</p>1819<div align="center">2021[](https://github.com/comet-ml/opik-mcp/blob/main/LICENSE)22[](https://nodejs.org/)23[](https://www.typescriptlang.org/)24<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>25<a href="https://doi.org/10.5281/zenodo.15411156"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.15411156.svg" alt="DOI" /></a>2627</div>2829<p align="center">30 <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> •31 <a href="https://chat.comet.com"><b>Slack community</b></a> •32 <a href="https://x.com/Cometml"><b>Twitter</b></a> •33 <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>34</p>3536> [!IMPORTANT]37> This repository ships the MCP server implementation only. We do not currently provide a hosted remote MCP service for Opik.38> If you run `streamable-http` remotely, authentication is fail-closed by default.3940## Why this server4142Opik MCP Server gives MCP-compatible clients one interface for:4344- Prompt lifecycle management45- Workspace, project, and trace exploration46- Metrics and dataset operations47- MCP resources and resource templates for metadata-aware flows4849## Quickstart5051### 1. Run with npx5253```bash54# Opik Cloud55npx -y opik-mcp --apiKey YOUR_API_KEY56```5758For self-hosted Opik, pass `--apiUrl` (for example `http://localhost:5173/api`) and use your local auth strategy.5960### 2. Add to your MCP client6162Cursor (`.cursor/mcp.json`):6364```json65{66 "mcpServers": {67 "opik": {68 "command": "npx",69 "args": ["-y", "opik-mcp", "--apiKey", "YOUR_API_KEY"]70 }71 }72}73```7475VS Code / GitHub Copilot (`.vscode/mcp.json`):7677```json78{79 "inputs": [80 {81 "type": "promptString",82 "id": "opik-api-key",83 "description": "Opik API Key",84 "password": true85 }86 ],87 "servers": {88 "opik-mcp": {89 "type": "stdio",90 "command": "npx",91 "args": ["-y", "opik-mcp", "--apiKey", "${input:opik-api-key}"]92 }93 }94}95```9697Windsurf (raw config):9899```json100{101 "mcpServers": {102 "opik": {103 "command": "npx",104 "args": ["-y", "opik-mcp", "--apiKey", "YOUR_API_KEY"]105 }106 }107}108```109110More client-specific examples: [docs/ide-integration.md](docs/ide-integration.md)111112## Run from source113114```bash115git clone https://github.com/comet-ml/opik-mcp.git116cd opik-mcp117npm install118npm run build119```120121Optional local config:122123```bash124cp .env.example .env125```126127Start the server:128129```bash130npm run start:stdio131npm run start:http132```133134## Transport modes135136| Transport | Use case | Command |137| --- | --- | --- |138| `stdio` | Local MCP integration (same machine as client) | `npm run start:stdio` |139| `streamable-http` | Remote/self-hosted MCP endpoint (`/mcp`) | `npm run start:http` |140141### Remote auth defaults (`streamable-http`)142143- `Authorization: Bearer <OPIK_API_KEY>` or `x-api-key` is required by default.144- Workspace is resolved server-side (token map recommended); workspace headers are not trusted by default.145- In remote mode, request-context workspace takes precedence over tool `workspaceName`.146- Missing or invalid auth returns HTTP `401`.147148Key environment flags:149150- `STREAMABLE_HTTP_REQUIRE_AUTH` (default `true`)151- `STREAMABLE_HTTP_VALIDATE_REMOTE_AUTH` (default `true`, except test env)152- `REMOTE_TOKEN_WORKSPACE_MAP` (JSON token-to-workspace map)153- `STREAMABLE_HTTP_TRUST_WORKSPACE_HEADERS` (default `false`)154155Deep dive: [docs/streamable-http-transport.md](docs/streamable-http-transport.md)156157## Toolsets158159Toolsets let you narrow which capabilities are enabled:160161- `core`162- `integration`163- `expert-prompts`164- `expert-datasets`165- `expert-trace-actions`166- `expert-project-actions`167- `metrics`168- `all` (enables all modern toolsets)169170Configure via:171172- CLI: `--toolsets all`173- Env: `OPIK_TOOLSETS=core,expert-prompts,metrics`174175Details: [docs/configuration.md](docs/configuration.md)176177## MCP resources and prompts178179- `resources/list` exposes static URIs (for example `opik://workspace-info`)180- `resources/templates/list` exposes dynamic URI templates (for example `opik://projects/{page}/{size}`)181- `resources/read` supports static and templated URIs182- `prompts/list` and `prompts/get` expose workflow prompts183184## Development185186```bash187# Lint188npm run lint189190# Test191npm test192193# Build194npm run build195196# Run precommit checks197make precommit198```199200## Documentation201202- [API Reference](docs/api-reference.md)203- [Configuration](docs/configuration.md)204- [IDE Integration](docs/ide-integration.md)205- [Streamable HTTP Transport](docs/streamable-http-transport.md)206207## Contributing208209Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.210211## Citation212213If you use this project in research, cite:214215```216Comet ML, Inc, Koc, V., & Boiko, Y. (2025). Opik MCP Server. Github. https://doi.org/10.5281/zenodo.15411156217```218219BibTeX:220221```bibtex222@software{CometML_Opik_MCP_Server_2025,223 author = {{Comet ML, Inc} and Koc, V. and Boiko, Y.},224 title = {{Opik MCP Server}},225 year = {2025},226 publisher = {GitHub},227 url = {https://doi.org/10.5281/zenodo.15411156},228 doi = {10.5281/zenodo.15411156}229}230```231232Citation metadata is also available in [CITATION.cff](CITATION.cff).233234## License235236Apache 2.0237
Full transparency — inspect the skill content before installing.