用途:该技能通过 MCP 服务器 mlflow-mcp 让智能体直接访问 MLflow,用自然语言查询运行、比较指标、浏览产物。
主要能力:按标签搜索运行,例如 MLflow:search_runs_by_tags(experiment_id, {"invocation_id": "<invocation_id>"});按条件查询运行,例如 MLflow:query_runs(experiment_id, "tags.model LIKE '%<model>%'") 与 MLflow:query_runs(experiment_id, "tags.task_name LIKE '%<task_name>%'");读取运行产物,例如 MLflow:get_artifact_content(run_id, "config.yml") 和 MLflow:get_artifact_content(run_id, "artifacts/eval_factory_metrics.json")。
ID 约定:用户给出十六进制 ID 而未说明类型时,默认视为 invocation_id 而非 MLflow run_id。invocation_id 标识一次启动器调用,同时存为 MLflow 运行的标签和参数;一次调用可产生多个运行(每个任务一个)。若不确定所属实验,可能需跨多个实验搜索。
产物结构:<harness>.<task>/ 下含 artifacts/(config.yml、launcher_unresolved_config.yaml、results.yml、eval_factory_metrics.json、report.html、report.json)与 logs/(client-.log、server--N.log、slurm-.log、proxy-.log)。
比较指标时建议先经 MCP 取数,再用 Python 精确计算,例如 uv run --with pandas python3 << 'EOF' ... EOF。
限制:MLflow 中不会出现 PENDING、RUNNING、KILLED 或 FAILED 运行,只有成功运行会导出。若 MCP 服务器加载失败或工具不可用:uvx 未找到时安装 uv,命令为 curl -LsSf https://astral.sh/uv/install.sh | sh;未配置 MCP 服务器时需添加配置并重启智能体。Claude Code 在 .claude/settings.json 的 mcpServers 下添加 "MLflow": {"command": "uvx", "args": ["mlflow-mcp"], "env": {"MLFLOW_TRACKING_URI": "https://<your-mlflow-server>/"}};Cursor 编辑 ~/.cursor/mcp.json,结构相同。