Opik MCP Server

Official

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Used for configuration through environment variables in a .env file

  • Hosts the repository and provides licensing information

  • Provides a Makefile for common operations like testing and starting the server

⚠️ 注意: SSE(服务器发送事件)传输支持目前处于实验阶段,尚未经过测试。对于生产环境,我们建议使用 IDE 集成示例中所示的直接流程执行方法。

🚀 什么是 Opik MCP 服务器?

Opik MCP 服务器是 Opik 平台模型上下文协议 (MCP) 的开源实现。它提供了与 Opik 功能交互的统一接口,支持多种传输机制,可灵活集成到各种环境中。

您可以使用 Opik MCP 服务器进行以下操作:

  • IDE 集成:
    • 与 Cursor 和其他兼容 IDE 无缝集成
    • 可以从您的开发环境直接访问 Opik 的功能
  • 统一 API 访问:
    • 通过标准化协议访问所有 Opik 功能
    • 针对不同的集成场景利用多种传输选项(stdio、SSE)
  • 平台管理:
    • 通过一致的界面管理提示、项目、跟踪和指标
    • 高效组织和监控你的法学硕士 (LLM) 申请

特征

  • 提示管理:创建、列出、更新和删除提示
  • 项目/工作区管理:组织和管理项目
  • 跟踪:跟踪和分析跟踪数据
  • 指标:收集和查询指标数据

快速入门

安装

手动安装

# 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

配置

根据示例创建一个.env文件:

cp .env.example .env # Edit .env with your specific configuration

启动服务器

# Start with stdio transport (default) npm run start:stdio # Start with SSE transport for network access (experimental) npm run start:sse

IDE 集成

光标集成

要与 Cursor IDE 集成,请在项目目录中创建一个.cursor/mcp.json文件,并采用以下配置:

{ "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", } } } }

/path/to/node替换为 Node.js 可执行文件的路径,将/path/to/opik-mcp替换为 opik-mcp 安装的路径。同时将YOUR_API_KEY替换为你实际的 Opik API 密钥。

可用命令

该项目包含用于常见操作的 Makefile:

# Display all available commands make help # Run tests make test # Run transport-specific tests make test-transport # Start the server with SSE transport (experimental) make start-sse # Start the server with stdio transport make start-stdio

交通选择

标准输入/输出

非常适合客户端和服务器在同一台机器上运行的本地集成。

make start-stdio

服务器发送事件 (SSE)

通过 HTTP 启用远程访问和多个客户端同时访问。请注意,此传输选项尚处于实验阶段。

make start-sse

有关 SSE 传输的详细信息,请参阅docs/sse-transport.md

发展

测试

# Run all tests npm test # Run specific test suite npm test -- tests/transports/sse-transport.test.ts

预提交钩子

该项目使用预提交钩子来确保代码质量:

# Run pre-commit checks manually make precommit

文档

执照

Apache 2.0

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Opik 平台的模型上下文协议的实现,为访问 Opik 的功能提供了统一的接口,支持多种传输机制,可与 IDE 和其他环境灵活集成。

  1. Features
    1. Quick Start
      1. Installation
      2. Configuration
      3. Starting the Server
    2. IDE Integration
      1. Cursor Integration
    3. Available Commands
      1. Transport Options
        1. Standard Input/Output
        2. Server-Sent Events (SSE)
      2. Development
        1. Testing
        2. Pre-commit Hooks
      3. Documentation
        1. License
          ID: hcctr0h0vs