MLflow Claude Desktop 模板访问工具
通过 Claude Desktop 启用对 MLflow 中管理的提示模板的访问,允许用户使用保存的模板来指导 Claude 完成重复性任务或常见工作流程。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mlflow": {
"args": [
"\u003cabsolute-path-to-this-repository\u003e/dist/index.js"
],
"command": "node",
"env": {
"MLFLOW_TRACKING_URI": "http://localhost:5000"
}
}
}
}
该服务需要配置环境变量:MLFLOW_TRACKING_URI
服务介绍
MLflow Prompt Registry MCP 服务器
用于 MLflow Prompt Registry 的 Model Context Protocol (MCP) 服务器,能够访问在 MLflow 中管理的提示模板。
该服务器实现了 MCP 提示规范,以便从 MLflow Prompt Registry 发现和使用提示模板。主要用例是在 Claude Desktop 中从 MLflow 加载提示模板,允许用户方便地为重复任务或常见工作流程提供指令。

工具
list-prompts- 列出可用的提示
- 输入:
cursor(可选字符串):分页游标filter(可选字符串):提示过滤器
- 返回:提示对象列表
get-prompt- 检索并编译特定的提示
- 输入:
name(字符串):要检索的提示名称arguments(可选对象):带有提示变量的 JSON 对象
- 返回:已编译的提示对象
设置
1: 安装 MLflow 并启动 Prompt Registry
如果您还没有安装并启动 MLflow 服务器以托管 Prompt Registry,请执行以下操作:
pip install mlflow>=2.21.1
mlflow server --port 5000
2: 在 MLflow 中创建一个提示模板
如果您还没有创建过提示模板,请按照 此指南 在 MLflow 中创建一个提示模板。
3: 构建 MCP 服务器
npm install
npm run build
4: 将服务器添加到 Claude Desktop
通过编辑 claude_desktop_config.json 配置 Claude for Desktop:
{
"mcpServers": {
"mlflow": {
"command": "node",
"args": ["<absolute-path-to-this-repository>/dist/index.js"],
"env": {
"MLFLOW_TRACKING_URI": "http://localhost:5000"
}
}
}
}
确保将 MLFLOW_TRACKING_URI 替换为您实际的 MLflow 服务器地址。