Mlflow

io.github.us-all由 GitHub 账号 us-all 发布v1.12.7更新于 Nov 3, 2026

MLflow MCP — experiments, runs, registered models, versions, traces, assessments (MLflow 3)

已验证STDIO仅桌面数据与分析AI 与机器学习

概览

AI 生成的概览

让助手浏览和管理 MLflow 跟踪服务器的 MCP 服务器,涵盖实验、运行、注册模型、追踪与评估。

可以做什么
  • 搜索、读取、创建和更新实验,包括标签与恢复
  • 查询运行、指标历史、产物、最佳运行,并并排比较多个运行
  • 管理注册模型、模型版本、别名与阶段转换
  • 查看 MLflow 3 的已记录模型、追踪与追踪附件,并记录反馈或期望
  • 管理 Webhook 与提示词优化任务
  • 一次调用汇总实验或运行,并按关键词查找可用工具
适用场景
适用于使用 MLflow 跟踪机器学习实验的场景,希望助手在对话中找出最佳运行、比较超参数、排查失败的追踪,或提升某个模型版本。面向 MLflow 3.5.1 及以上版本,也可连接 Databricks 托管的 MLflow。
运行要求
通过 npx 或 Docker 在本地运行(npm 包需要 Node.js 22 及以上)。必须设置 MLFLOW_TRACKING_URI 指向 MLflow 跟踪服务器;访问受保护的服务器时可选提供 MLFLOW_TRACKING_TOKEN,或 MLFLOW_TRACKING_USERNAME 加 MLFLOW_TRACKING_PASSWORD。需要能访问该服务器的网络。
安装前请注意
除非将 MLFLOW_ALLOW_WRITE 设为 true,否则写入和删除类工具被禁用;一旦开启,助手可创建、更新、删除和恢复实验、运行、模型、追踪、Webhook 及优化任务。MLFLOW_TRACKING_TOKEN 或 MLFLOW_TRACKING_PASSWORD 等凭据通过环境变量传入。文档说明 Bearer 与 Basic 认证路径尚未在真实 Databricks 环境中验证。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mlflow,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MLflow MCP Server

The widest-coverage MLflow MCP — including MLflow 3 traces, prompt-optimization, webhooks, and Databricks trace attachments that no other MCP exposes.

82 tools across experiments, runs, registry, logged models, traces, assessments, webhooks, prompt-optimization. Aggregation tools (summarize-experiment, summarize-run) fold 3–5 round-trips into one structured response with already-fetched metric stats.

[npm] [downloads] [tools] [@us-all standard] [Glama MCP server]

What it does that others don't

  • Full coverage — only third-party MLflow MCP shipping prompt-optimization-jobs (5 tools), webhooks (6), MLflow 3 LoggedModel (8), and Databricks trace attachments (list-trace-attachments, get-trace-attachment — Databricks MLflow only; OSS returns 404).
  • Aggregation tools — summarize-experiment returns experiment + topN runs + metric stats (min/max/mean) in one call from already-fetched data, zero extra round-trips. summarize-run dedups metricHistory.history.*.key (~100KB savings on 4k-point series).
  • MCP Prompts (4) — debug-failed-traces, promote-best-run, compare-top-runs, annotate-trace-quality. Workflow templates the model invokes directly.
  • MCP Resources (6) — mlflow://run/{runId}, mlflow://experiment/{expId}, mlflow://run/{runId}/artifacts, mlflow://experiment/{expId}/runs, mlflow://registered-model/{name}/versions, mlflow://trace/{traceId}.
  • Token-efficient by design — extractFields projection on get-run / search-runs / search-traces / get-trace / fat reads, MLFLOW_TOOLS / MLFLOW_DISABLE 8 categories, search-tools meta-tool.
  • Apps SDK card — compare-runs renders as a side-by-side card on ChatGPT clients (run summary + metric/param tables with diff highlight) via _meta["openai/outputTemplate"]. Claude clients receive the same JSON content.
  • stdio + Streamable HTTP — defaults to stdio. Set MCP_TRANSPORT=http for ChatGPT Apps SDK or remote clients (Bearer auth via MCP_HTTP_TOKEN).

Try this — 5 prompts

Connect the server to Claude Desktop or Claude Code, then paste any of these:

  1. Best run — "In the customer-churn-v3 experiment, find the run with the highest val_accuracy. Show its hyperparameters and metric history."
  2. Failure mode clustering — "Find traces with status=ERROR from the last 24h in experiment 12. Group the failures by exception type and surface the 3 most common."
  3. Run comparison — "Compare the top 5 runs of experiment 12 by validation_loss. Show differing hyperparameters in a table."
  4. Model promotion — "Get the latest version of recommendation_v2 registered model with the champion alias. Show its training metrics + lineage to the source run."
  5. Trace deep-dive — "Pull trace tr-abc123. Highlight slow spans and any failed feedback annotations." (Add list-trace-attachments on Databricks workspaces.)

When to use this vs alternatives

Official mlflow[mcp]kkruglik/mlflow-mcp@us-all/mlflow-mcp (this)
Tool count~9 (trace-only)~2578
MLflow 3 LoggedModel❌✅✅
Trace attachments❌❌✅ Databricks only
Prompt-optimization-jobs❌❌✅
Webhooks❌❌✅
Aggregation tools❌❌✅ summarize-experiment, summarize-run
MCP Prompts❌✅✅
MCP Resources❌❌✅ 6 URIs
AuthDatabricks SDKBearer / basicBearer / basic
Transportstdiostdiostdio

The official mlflow[mcp] is bundled inside MLflow itself and intentionally trace-narrow. Use it for quick managed-MLflow trace inspection. Use this server for end-to-end coverage, especially MLflow 3 entities, prompt-optimization workflows, and aggregation-driven AI debugging.

Install

Claude Desktop

json
{  "mcpServers": {    "mlflow": {      "command": "npx",      "args": ["-y", "@us-all/mlflow-mcp"],      "env": {        "MLFLOW_TRACKING_URI": "http://localhost:5000"      }    }  }}

Claude Code

bash
claude mcp add mlflow -s user \  -e MLFLOW_TRACKING_URI=http://localhost:5000 \  -- npx -y @us-all/mlflow-mcp

Docker

bash
docker run --rm -i \  -e MLFLOW_TRACKING_URI=http://your-host:5000 \  ghcr.io/us-all/mlflow-mcp-server

Build from source

bash
git clone https://github.com/us-all/mlflow-mcp-server.gitcd mlflow-mcp-server && pnpm install && pnpm buildnode dist/index.js

Configuration

VariableRequiredDefaultDescription
MLFLOW_TRACKING_URI✅—MLflow tracking URL (http://localhost:5000, Databricks workspace URL, etc.)
MLFLOW_TRACKING_TOKEN❌—Bearer token. Use for Databricks PAT (dapi…)
MLFLOW_TRACKING_USERNAME❌—Basic-auth username (alternative to token)
MLFLOW_TRACKING_PASSWORD❌—Basic-auth password
MLFLOW_EXPERIMENT_ID❌—Default experiment ID for tools that accept it implicitly
MLFLOW_ALLOW_WRITE❌falseSet true to enable mutations (create/update/delete)
MLFLOW_TOOLS❌—Comma-sep allowlist of categories. Biggest token saver.
MLFLOW_DISABLE❌—Comma-sep denylist. Ignored when MLFLOW_TOOLS is set.
MCP_TRANSPORT❌stdiohttp to enable Streamable HTTP transport
MCP_HTTP_TOKENconditional—Bearer token. Required when MCP_TRANSPORT=http
MCP_HTTP_PORT❌3000HTTP listen port
MCP_HTTP_HOST❌127.0.0.1HTTP bind host (DNS rebinding protection auto-enabled for localhost)
MCP_HTTP_SKIP_AUTH❌falseSkip Bearer auth — e.g. behind a reverse proxy that handles it

Categories (8): experiments, runs, registry, logged-models, traces, assessments, webhooks, prompts.

When MCP_TRANSPORT=http: POST /mcp (Bearer-auth JSON-RPC) + GET /health (public liveness).

Databricks managed MLflow

For Databricks-hosted MLflow:

bash
MLFLOW_TRACKING_URI=https://<workspace>.cloud.databricks.comMLFLOW_TRACKING_TOKEN=dapi...   # PAT or service-principal token

The MLflow REST API path (/api/2.0/mlflow/...) is identical between OSS and Databricks. Bearer auth handles both PAT and service-principal flows.

Token efficiency

ScenarioToolsSchema tokensvs default
default (all categories)789,200—
typical (MLFLOW_TOOLS=experiments,runs,registry,traces)545,900−36%
narrow (MLFLOW_TOOLS=experiments,runs)273,200−66%

Plus extractFields on get-run / search-runs / search-traces / get-trace / summarize-experiment — caller can scope response fields per call.

Read-only mode

By default, all writes are blocked. The following require MLFLOW_ALLOW_WRITE=true:

create-experiment, update-experiment, delete-experiment, restore-experiment, set-experiment-tag, delete-experiment-tag, create-run, update-run, delete-run, restore-run, log-metric, log-param, log-batch, log-inputs, set-run-tag, delete-run-tag, create-registered-model, rename-registered-model, update-registered-model, delete-registered-model, plus all model-version, logged-model, trace, assessment, webhook, and prompt-optimization writes.

Limitations & gotchas

  • search-traces.maxResults is clamped to 500. MLflow 3.12+ rejects per-page max_results > 500 with INVALID_PARAMETER_VALUE. For larger result sets, loop on nextPageToken — total trace count is unbounded.
  • Trace attachments are Databricks-only. list-trace-attachments / get-trace-attachment call routes that OSS MLflow (verified through 3.12.0) returns 404 for. Tool descriptions surface this; calls against OSS return a structured MlflowError.
  • search-traces.maxResults cap applies per page, not per call — pagination still gets you the full set.
  • Bearer / Basic auth code paths are not yet validated against live Databricks (see open roadmap item). Works against OSS MLflow 3.12 (Bearer optional).

MCP Prompts (4)

Workflow templates available via MCP prompts/list:

  • debug-failed-traces — find failed traces, group failure modes
  • promote-best-run — find best run, register, set champion alias
  • compare-top-runs — top-N comparison by metric
  • annotate-trace-quality — guided feedback annotation loop

MCP Resources

URI-based read-only access:

mlflow://run/{runId}, mlflow://experiment/{expId}, mlflow://experiment-by-name/{name}, mlflow://registered-model/{name}, mlflow://model-version/{name}/{version}, mlflow://trace/{traceId}, mlflow://run/{runId}/artifacts, mlflow://experiment/{expId}/runs, mlflow://registered-model/{name}/versions.

Tools (82)

8 categories. Use search-tools to discover at runtime; full list collapsed below.

get-run, search-runs, search-traces, get-trace, and summarize-experiment accept extractFields for response slicing.

Full tool list

Experiments (9)

create-experiment, search-experiments, get-experiment, get-experiment-by-name, update-experiment, delete-experiment, restore-experiment, set-experiment-tag, delete-experiment-tag

Runs (18)

create-run, get-run, search-runs, update-run, delete-run, restore-run, log-metric, log-param, log-batch, log-inputs, get-metric-history, set-run-tag, delete-run-tag, list-artifacts, get-best-run, compare-runs, search-runs-by-tags, summarize-run (aggregation)

Registered Models (12)

create-registered-model, get-registered-model, search-registered-models, rename-registered-model, update-registered-model, delete-registered-model, get-latest-model-versions, set-registered-model-tag, delete-registered-model-tag, set-registered-model-alias, delete-registered-model-alias, get-model-version-by-alias

Model Versions (9)

create-model-version, get-model-version, search-model-versions, update-model-version, delete-model-version, transition-model-version-stage, get-model-version-download-uri, set-model-version-tag, delete-model-version-tag

Logged Models — MLflow 3 (8)

create-logged-model, search-logged-models, get-logged-model, finalize-logged-model, delete-logged-model, set-logged-model-tags, delete-logged-model-tag, log-logged-model-params

Traces (8)

search-traces, get-trace, get-trace-info, delete-traces, set-trace-tag, delete-trace-tag, list-trace-attachments, get-trace-attachment

Assessments (5)

log-feedback, log-expectation, get-assessment, update-assessment, delete-assessment

Webhooks (6)

create-webhook, list-webhooks, get-webhook, update-webhook, delete-webhook, test-webhook

Prompt Optimization (5)

create-prompt-optimization-job, get-prompt-optimization-job, search-prompt-optimization-jobs, cancel-prompt-optimization-job, delete-prompt-optimization-job

Aggregations

summarize-experiment, summarize-run — fold 3–5 round-trips into one structured response with caveats array.

Meta

search-tools — query other tools by keyword; always enabled.

Local validation with docker compose

bash
# 1. start MLflow (UI at http://localhost:5050)docker compose up -d mlflow
# 2. seed demo experiment, runs, registered model, tracesdocker compose run --rm seed
# 3a. probe the MCP server locally against the compose'd MLflowMLFLOW_TRACKING_URI=http://localhost:5050 \  MLFLOW_EXPERIMENT_ID=1 \  MLFLOW_ALLOW_WRITE=true \  node dist/index.js
# 3b. or run inside compose (stdio)docker compose run --rm mcp
# tear downdocker compose down -v

./dev/seed.py is idempotent — skips if demo experiment already has runs.

Architecture

Claude → MCP stdio → src/index.ts → src/tools/*.ts → MlflowClient (fetch) → MLflow REST API

Built on @us-all/mcp-toolkit:

  • extractFields — token-efficient response projections
  • aggregate(fetchers, caveats) — fan-out helper for summarize-experiment
  • createWrapToolHandler — Bearer/basic credential redaction + MlflowError extraction
  • search-tools meta-tool

Targets MLflow 3.5.1+ (uses v3 traces/assessments REST). Dev compose pinned to MLflow 3.12.0 (multimodal trace attachments + paginated trace search).

Tech stack

Node.js 22+ • TypeScript strict ESM • pnpm • @modelcontextprotocol/sdk • zod • dotenv • vitest.

References

License

MIT

来源:README.md,提交 4cf1819

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.12.7最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分