MLOps协议服务器

一个基于Claude Code的MLOps协议服务器,支持与ML实验跟踪、模型注册和部署管道的交互,适用于多种MLOps平台。

  • by elliottdevo8
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 elliottdevo8/mlops-mcp-server

使用说明

MLOps MCP服务器

通过Claude Code实现AI驱动的MLOps工作流

MCP(模型上下文协议)服务器,使Claude能够与流行MLOps平台上的ML实验跟踪、模型注册表和部署管道进行交互。

特性

  • MLW集成 -列出实验、比较运行、找到最佳模型、使用过滤器搜索
  • 模型注册表 -浏览已注册的型号,跟踪版本,检查部署阶段
  • 交叉平台的 -MLflow、Weights&Biases和SageMaker的统一界面(即将推出)

快速开始

安装

# Install from PyPI
pip install mlops-mcp-server

# Or install with all optional dependencies
pip install mlops-mcp-server[all]

配置

添加到您的Claude Code MCP配置中(~/.claude.json):

{
  "mcpServers": {
    "mlops": {
      "command": "mlops-mcp-server",
      "env": {
        "MLFLOW_TRACKING_URI": "http://localhost:5000"
      }
    }
  }
}

环境变量

变量 描述 默认值
MLFLOW_TRACKING_URI mlflow跟踪服务器类型 ./mlruns
WANDB_API_KEY 权重和偏差API键 -
AWS_REGION SageMaker的AWS区域 us-east-1

可用工具

实验跟踪

工具 说明
mlflow_list_experiments 列出所有血流实验
mlflow_get_runs 获取指标实验的运行记录
mlflow_compare_runs 比较多个运行中的指标
mlflow_get_best_run 按指标查找最佳运行
mlflow_search_runs 使用类似SQL的筛选器运行搜索

模型注册表

工具 说明
mlflow_list_models 列出已注册的型号
mlflow_get_model_versions 获取模型版本历史记录

使用示例

列出实验

User: Show me all my MLflow experiments

Claude: [Uses mlflow_list_experiments]
Found 5 experiments:
1. fraud-detection (ID: 1) - 23 runs
2. recommendation-engine (ID: 2) - 45 runs
...

寻找最佳模特

User: Which model has the highest accuracy in the fraud-detection experiment?

Claude: [Uses mlflow_get_best_run]
Best run: run_abc123
- Accuracy: 0.956
- Model: XGBoost
- Parameters: max_depth=6, learning_rate=0.1

比较跑步记录

User: Compare the last 3 runs in terms of accuracy and F1 score

Claude: [Uses mlflow_compare_runs]
| Run ID | Accuracy | F1 Score |
|--------|----------|----------|
| abc123 | 0.956    | 0.943    |
| def456 | 0.948    | 0.935    |
| ghi789 | 0.951    | 0.940    |

发展

设置

# Clone the repository
git clone https://github.com/elliottdevo8/mlops-mcp-server.git
cd mlops-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install in development mode
pip install -e ".[dev]"

运行测试

pytest tests/ -v

本地运行

# Start the server
python -m mlops_mcp.server

# Or use the CLI entry point
mlops-mcp-server

路线图

  • [x] 流体流动实验跟踪
  • [x] MLflow模型注册表
  • []权重和偏差整合
  • []SageMaker模型注册表
  • []SageMaker端点管理
  • []模型漂移监测
  • []成本分析工具

贡献

欢迎投稿!请阅读我们的 贡献指南 了解详情。

许可证

MIT许可证-请参阅 许可证 了解详情。

致谢

与 模型上下文协议 通过Anthropic。