{
  "markdown": "# MLflow MCP Server\n\n> **The widest-coverage MLflow MCP — including MLflow 3 traces, prompt-optimization, webhooks, and Databricks trace attachments that no other MCP exposes.**\n>\n> 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.\n\n[![npm](https://img.shields.io/npm/v/@us-all/mlflow-mcp)](https://www.npmjs.com/package/@us-all/mlflow-mcp)\n[![downloads](https://img.shields.io/npm/dm/@us-all/mlflow-mcp)](https://www.npmjs.com/package/@us-all/mlflow-mcp)\n[![tools](https://img.shields.io/badge/tools-82-blue)](#tools)\n[![@us-all standard](https://img.shields.io/badge/built%20to-%40us--all%20MCP%20standard-blue)](https://github.com/us-all/mcp-toolkit/blob/main/STANDARD.md)\n[![Glama MCP server](https://glama.ai/mcp/servers/us-all/mlflow-mcp-server/badges/score.svg)](https://glama.ai/mcp/servers/us-all/mlflow-mcp-server)\n\n## What it does that others don't\n\n- **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).\n- **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).\n- **MCP Prompts** (4) — `debug-failed-traces`, `promote-best-run`, `compare-top-runs`, `annotate-trace-quality`. Workflow templates the model invokes directly.\n- **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}`.\n- **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.\n- **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.\n- **stdio + Streamable HTTP** — defaults to stdio. Set `MCP_TRANSPORT=http` for ChatGPT Apps SDK or remote clients (Bearer auth via `MCP_HTTP_TOKEN`).\n\n## Try this — 5 prompts\n\nConnect the server to Claude Desktop or Claude Code, then paste any of these:\n\n1. **Best run** — *\"In the `customer-churn-v3` experiment, find the run with the highest `val_accuracy`. Show its hyperparameters and metric history.\"*\n2. **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.\"*\n3. **Run comparison** — *\"Compare the top 5 runs of experiment 12 by `validation_loss`. Show differing hyperparameters in a table.\"*\n4. **Model promotion** — *\"Get the latest version of `recommendation_v2` registered model with the `champion` alias. Show its training metrics + lineage to the source run.\"*\n5. **Trace deep-dive** — *\"Pull trace `tr-abc123`. Highlight slow spans and any failed feedback annotations.\"* (Add `list-trace-attachments` on Databricks workspaces.)\n\n## When to use this vs alternatives\n\n| | Official `mlflow[mcp]` | kkruglik/mlflow-mcp | `@us-all/mlflow-mcp` (this) |\n|--|------------------------|---------------------|------------------------------|\n| Tool count | ~9 (trace-only) | ~25 | **78** |\n| MLflow 3 LoggedModel | ❌ | ✅ | ✅ |\n| Trace attachments | ❌ | ❌ | ✅ Databricks only |\n| Prompt-optimization-jobs | ❌ | ❌ | ✅ |\n| Webhooks | ❌ | ❌ | ✅ |\n| Aggregation tools | ❌ | ❌ | ✅ `summarize-experiment`, `summarize-run` |\n| MCP Prompts | ❌ | ✅ | ✅ |\n| MCP Resources | ❌ | ❌ | ✅ 6 URIs |\n| Auth | Databricks SDK | Bearer / basic | Bearer / basic |\n| Transport | stdio | stdio | stdio |\n\nThe 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.\n\n## Install\n\n### Claude Desktop\n\n```json\n{\n  \"mcpServers\": {\n    \"mlflow\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@us-all/mlflow-mcp\"],\n      \"env\": {\n        \"MLFLOW_TRACKING_URI\": \"http://localhost:5000\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add mlflow -s user \\\n  -e MLFLOW_TRACKING_URI=http://localhost:5000 \\\n  -- npx -y @us-all/mlflow-mcp\n```\n\n### Docker\n\n```bash\ndocker run --rm -i \\\n  -e MLFLOW_TRACKING_URI=http://your-host:5000 \\\n  ghcr.io/us-all/mlflow-mcp-server\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/us-all/mlflow-mcp-server.git\ncd mlflow-mcp-server && pnpm install && pnpm build\nnode dist/index.js\n```\n\n## Configuration\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `MLFLOW_TRACKING_URI` | ✅ | — | MLflow tracking URL (`http://localhost:5000`, Databricks workspace URL, etc.) |\n| `MLFLOW_TRACKING_TOKEN` | ❌ | — | Bearer token. Use for Databricks PAT (`dapi…`) |\n| `MLFLOW_TRACKING_USERNAME` | ❌ | — | Basic-auth username (alternative to token) |\n| `MLFLOW_TRACKING_PASSWORD` | ❌ | — | Basic-auth password |\n| `MLFLOW_EXPERIMENT_ID` | ❌ | — | Default experiment ID for tools that accept it implicitly |\n| `MLFLOW_ALLOW_WRITE` | ❌ | `false` | Set `true` to enable mutations (create/update/delete) |\n| `MLFLOW_TOOLS` | ❌ | — | Comma-sep allowlist of categories. Biggest token saver. |\n| `MLFLOW_DISABLE` | ❌ | — | Comma-sep denylist. Ignored when `MLFLOW_TOOLS` is set. |\n| `MCP_TRANSPORT` | ❌ | `stdio` | `http` to enable Streamable HTTP transport |\n| `MCP_HTTP_TOKEN` | conditional | — | Bearer token. Required when `MCP_TRANSPORT=http` |\n| `MCP_HTTP_PORT` | ❌ | `3000` | HTTP listen port |\n| `MCP_HTTP_HOST` | ❌ | `127.0.0.1` | HTTP bind host (DNS rebinding protection auto-enabled for localhost) |\n| `MCP_HTTP_SKIP_AUTH` | ❌ | `false` | Skip Bearer auth — e.g. behind a reverse proxy that handles it |\n\n**Categories** (8): `experiments`, `runs`, `registry`, `logged-models`, `traces`, `assessments`, `webhooks`, `prompts`.\n\nWhen `MCP_TRANSPORT=http`: `POST /mcp` (Bearer-auth JSON-RPC) + `GET /health` (public liveness).\n\n### Databricks managed MLflow\n\nFor Databricks-hosted MLflow:\n\n```bash\nMLFLOW_TRACKING_URI=https://<workspace>.cloud.databricks.com\nMLFLOW_TRACKING_TOKEN=dapi...   # PAT or service-principal token\n```\n\nThe MLflow REST API path (`/api/2.0/mlflow/...`) is identical between OSS and Databricks. Bearer auth handles both PAT and service-principal flows.\n\n### Token efficiency\n\n| Scenario | Tools | Schema tokens | vs default |\n|----------|------:|--------------:|-----------:|\n| default (all categories) | 78 | 9,200 | — |\n| typical (`MLFLOW_TOOLS=experiments,runs,registry,traces`) | 54 | 5,900 | −36% |\n| narrow (`MLFLOW_TOOLS=experiments,runs`) | 27 | **3,200** | **−66%** |\n\nPlus `extractFields` on `get-run` / `search-runs` / `search-traces` / `get-trace` / `summarize-experiment` — caller can scope response fields per call.\n\n### Read-only mode\n\nBy default, all writes are blocked. The following require `MLFLOW_ALLOW_WRITE=true`:\n\n`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.\n\n### Limitations & gotchas\n\n- **`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.\n- **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`.\n- **`search-traces.maxResults` cap applies per page**, not per call — pagination still gets you the full set.\n- **Bearer / Basic auth code paths are not yet validated against live Databricks** (see open roadmap item). Works against OSS MLflow 3.12 (Bearer optional).\n\n## MCP Prompts (4)\n\nWorkflow templates available via MCP `prompts/list`:\n\n- `debug-failed-traces` — find failed traces, group failure modes\n- `promote-best-run` — find best run, register, set `champion` alias\n- `compare-top-runs` — top-N comparison by metric\n- `annotate-trace-quality` — guided feedback annotation loop\n\n## MCP Resources\n\nURI-based read-only access:\n\n`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`.\n\n## Tools (82)\n\n8 categories. Use `search-tools` to discover at runtime; full list collapsed below.\n\n`get-run`, `search-runs`, `search-traces`, `get-trace`, and `summarize-experiment` accept `extractFields` for response slicing.\n\n<details>\n<summary>Full tool list</summary>\n\n### Experiments (9)\n`create-experiment`, `search-experiments`, `get-experiment`, `get-experiment-by-name`, `update-experiment`, `delete-experiment`, `restore-experiment`, `set-experiment-tag`, `delete-experiment-tag`\n\n### Runs (18)\n`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)*\n\n### Registered Models (12)\n`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`\n\n### Model Versions (9)\n`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`\n\n### Logged Models — MLflow 3 (8)\n`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`\n\n### Traces (8)\n`search-traces`, `get-trace`, `get-trace-info`, `delete-traces`, `set-trace-tag`, `delete-trace-tag`, `list-trace-attachments`, `get-trace-attachment`\n\n### Assessments (5)\n`log-feedback`, `log-expectation`, `get-assessment`, `update-assessment`, `delete-assessment`\n\n### Webhooks (6)\n`create-webhook`, `list-webhooks`, `get-webhook`, `update-webhook`, `delete-webhook`, `test-webhook`\n\n### Prompt Optimization (5)\n`create-prompt-optimization-job`, `get-prompt-optimization-job`, `search-prompt-optimization-jobs`, `cancel-prompt-optimization-job`, `delete-prompt-optimization-job`\n\n### Aggregations\n`summarize-experiment`, `summarize-run` — fold 3–5 round-trips into one structured response with `caveats` array.\n\n### Meta\n`search-tools` — query other tools by keyword; always enabled.\n\n</details>\n\n## Local validation with docker compose\n\n```bash\n# 1. start MLflow (UI at http://localhost:5050)\ndocker compose up -d mlflow\n\n# 2. seed demo experiment, runs, registered model, traces\ndocker compose run --rm seed\n\n# 3a. probe the MCP server locally against the compose'd MLflow\nMLFLOW_TRACKING_URI=http://localhost:5050 \\\n  MLFLOW_EXPERIMENT_ID=1 \\\n  MLFLOW_ALLOW_WRITE=true \\\n  node dist/index.js\n\n# 3b. or run inside compose (stdio)\ndocker compose run --rm mcp\n\n# tear down\ndocker compose down -v\n```\n\n`./dev/seed.py` is idempotent — skips if `demo` experiment already has runs.\n\n## Architecture\n\n```\nClaude → MCP stdio → src/index.ts → src/tools/*.ts → MlflowClient (fetch) → MLflow REST API\n```\n\nBuilt on [`@us-all/mcp-toolkit`](https://github.com/us-all/mcp-toolkit):\n- `extractFields` — token-efficient response projections\n- `aggregate(fetchers, caveats)` — fan-out helper for `summarize-experiment`\n- `createWrapToolHandler` — Bearer/basic credential redaction + MlflowError extraction\n- `search-tools` meta-tool\n\nTargets MLflow 3.5.1+ (uses v3 traces/assessments REST). Dev compose pinned to MLflow 3.12.0 (multimodal trace attachments + paginated trace search).\n\n## Tech stack\n\nNode.js 22+ • TypeScript strict ESM • pnpm • `@modelcontextprotocol/sdk` • zod • dotenv • vitest.\n\n## References\n\n- MLflow MCP overview: https://mlflow.org/docs/latest/genai/mcp/\n- MLflow REST API: https://mlflow.org/docs/latest/api_reference/rest-api.html\n\n## License\n\n[MIT](./LICENSE)\n",
  "bytes": 13322,
  "sha": "00e3b81dd72b55092d1dab92b7ee87d9b16b3b3caf6f0933d460b390aee719b8",
  "repo_slug": "us-all/mlflow-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_us_all_mlflow_f43a567c/readme"
}