Opik MCP Server implements the Model Context Protocol for the Opik platform, providing a unified interface to Opik's capabilities through multiple transport mechanisms. It enables seamless integration with compatible IDEs and provides standardized access to features like prompt management, project organization, and trace analysis.
# Clone the repository
git clone https://github.com/comet-ml/opik-mcp.git
cd opik-mcp
# Install dependencies and build
npm install
npm run build
Create a configuration file based on the example:
cp .env.example .env
# Edit .env with your specific configuration
You can start the server using either of the available transport options:
# Start with stdio transport (default)
npm run start:stdio
# Start with SSE transport for network access (experimental)
npm run start:sse
Note: SSE (Server-Sent Events) transport is currently experimental. For production use, the direct process execution approach is recommended.
The project includes a Makefile for common operations:
# Display all available commands
make help
# Start the server with stdio transport
make start-stdio
# Start the server with SSE transport (experimental)
make start-sse
# Run tests
make test
To integrate with Cursor IDE, create a .cursor/mcp.json
file in your project directory with the following configuration:
{
"mcpServers": {
"opik": {
"command": "/path/to/node",
"args": [
"/path/to/opik-mcp/build/index.js",
"--apiUrl",
"https://www.comet.com/opik/api",
"--apiKey",
"YOUR_API_KEY",
"--workspace",
"default",
"--debug",
"true"
],
"env": {
"OPIK_API_BASE_URL": "https://www.comet.com/opik/api",
"OPIK_API_KEY": "YOUR_API_KEY",
"OPIK_WORKSPACE_NAME": "default"
}
}
}
}
Replace:
/path/to/node
with the path to your Node.js executable/path/to/opik-mcp
with the path to your opik-mcp installationYOUR_API_KEY
with your actual Opik API keyThis transport is ideal for local integration where the client and server run on the same machine.
make start-stdio
This transport enables remote access and multiple simultaneous clients over HTTP.
make start-sse
The MCP server provides access to these Opik platform features:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "opik" '{"command":"/path/to/node","args":["/path/to/opik-mcp/build/index.js","--apiUrl","https://www.comet.com/opik/api","--apiKey","YOUR_API_KEY","--workspace","default","--debug","true"],"env":{"OPIK_API_BASE_URL":"https://www.comet.com/opik/api","OPIK_API_KEY":"YOUR_API_KEY","OPIK_WORKSPACE_NAME":"default"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"opik": {
"command": "/path/to/node",
"args": [
"/path/to/opik-mcp/build/index.js",
"--apiUrl",
"https://www.comet.com/opik/api",
"--apiKey",
"YOUR_API_KEY",
"--workspace",
"default",
"--debug",
"true"
],
"env": {
"OPIK_API_BASE_URL": "https://www.comet.com/opik/api",
"OPIK_API_KEY": "YOUR_API_KEY",
"OPIK_WORKSPACE_NAME": "default"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"opik": {
"command": "/path/to/node",
"args": [
"/path/to/opik-mcp/build/index.js",
"--apiUrl",
"https://www.comet.com/opik/api",
"--apiKey",
"YOUR_API_KEY",
"--workspace",
"default",
"--debug",
"true"
],
"env": {
"OPIK_API_BASE_URL": "https://www.comet.com/opik/api",
"OPIK_API_KEY": "YOUR_API_KEY",
"OPIK_WORKSPACE_NAME": "default"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect