(Model Context Protocol)
A Model Context Protocol (MCP) implementation for the Opik platform with support for multiple transport mechanisms, enabling seamless integration with IDEs and providing a unified interface for Opik's capabilities.
Website • Slack community • Twitter • Documentation
⚠️ Notice: SSE (Server-Sent Events) transport support is currently experimental and untested. For production use, we recommend using the direct process execution approach shown in the IDE integration examples.
🚀 What is Opik MCP Server?
Opik MCP Server is an open-source implementation of the Model Context Protocol for the Opik platform. It provides a unified interface for interacting with Opik's capabilities, supporting multiple transport mechanisms for flexible integration into various environments.
You can use Opik MCP Server for:
-
IDE Integration:
- Seamlessly integrate with Cursor and other compatible IDEs
- Provide direct access to Opik's capabilities from your development environment
-
Unified API Access:
- Access all Opik features through a standardized protocol
- Leverage multiple transport options (stdio, SSE) for different integration scenarios
-
Platform Management:
- Manage prompts, projects, traces, and metrics through a consistent interface
- Organize and monitor your LLM applications efficiently
Features
- Prompts Management: Create, list, update, and delete prompts
- Projects/Workspaces Management: Organize and manage projects
- Traces: Track and analyze trace data
- Metrics: Gather and query metrics data
Quick Start
Installation
Manual Installation
1# Clone the repository 2git clone https://github.com/comet-ml/opik-mcp.git 3cd opik-mcp 4 5# Install dependencies and build 6npm install 7npm run build
Configuration
Create a .env
file based on the example:
1cp .env.example .env 2# Edit .env with your specific configuration
Starting the Server
1# Start with stdio transport (default) 2npm run start:stdio 3 4# Start with SSE transport for network access (experimental) 5npm run start:sse
IDE Integration
Cursor Integration
To integrate with Cursor IDE, create a .cursor/mcp.json
file in your project directory with the following configuration:
1{ 2 "mcpServers": { 3 "opik": { 4 "command": "/path/to/node", 5 "args": [ 6 "/path/to/opik-mcp/build/index.js", 7 "--apiUrl", 8 "https://www.comet.com/opik/api", 9 "--apiKey", 10 "YOUR_API_KEY", 11 "--workspace", 12 "default", 13 "--debug", 14 "true" 15 ], 16 "env": { 17 "OPIK_API_BASE_URL": "https://www.comet.com/opik/api", 18 "OPIK_API_KEY": "YOUR_API_KEY", 19 "OPIK_WORKSPACE_NAME": "default", 20 } 21 } 22 } 23}
Replace /path/to/node
with the path to your Node.js executable and /path/to/opik-mcp
with the path to your opik-mcp installation. Also replace YOUR_API_KEY
with your actual Opik API key.
Available Commands
The project includes a Makefile for common operations:
1# Display all available commands 2make help 3 4# Run tests 5make test 6 7# Run transport-specific tests 8make test-transport 9 10# Start the server with SSE transport (experimental) 11make start-sse 12 13# Start the server with stdio transport 14make start-stdio
Transport Options
Standard Input/Output
Ideal for local integration where the client and server run on the same machine.
1make start-stdio
Server-Sent Events (SSE)
Enables remote access and multiple simultaneous clients over HTTP. Note that this transport option is experimental.
1make start-sse
For detailed information about the SSE transport, see docs/sse-transport.md.
Development
Testing
1# Run all tests 2npm test 3 4# Run specific test suite 5npm test -- tests/transports/sse-transport.test.ts
Pre-commit Hooks
This project uses pre-commit hooks to ensure code quality:
1# Run pre-commit checks manually 2make precommit
Documentation
- SSE Transport - Details on using the SSE transport
- API Reference - Complete API documentation
- Configuration - Advanced configuration options
- IDE Integration - Integration with Cursor IDE
License
Apache 2.0