Opik MCP Server is an implementation of the Model Context Protocol for the Opik platform. It provides a unified interface for accessing Opik's capabilities, supporting multiple transport mechanisms for seamless integration with IDEs and offering standardized access to features like prompts management, projects organization, and metrics tracking.
# 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 by copying the example:
cp .env.example .env
Then edit the .env
file with your specific configuration settings, including your Opik API key and workspace information.
You can start the MCP server using one of two transport mechanisms:
Best for local integration where client and server run on the same machine:
npm run start:stdio
For network access and multiple simultaneous clients:
npm run start:sse
Note: SSE transport is currently experimental and recommended only for testing purposes.
To use Opik MCP Server with Cursor IDE, create a configuration file in your project:
.cursor/mcp.json
in your project directory{
"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 your Node.js executable path/path/to/opik-mcp
with your opik-mcp installation pathYOUR_API_KEY
with your actual Opik API keyOnce the server is running, you can:
The project includes a Makefile with helpful commands:
# Show all available commands
make help
# Run tests
make test
# Start with stdio transport
make start-stdio
# Start with SSE transport
make start-sse
This transport method is ideal for local IDE integration:
make start-stdio
For remote access and multiple clients (experimental):
make start-sse
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.