Skip to main content
plugin

mlflow — Claude Code plugin: what it does, how to install

Equips Claude Code with workflows for tracing, debugging, and evaluating GenAI apps using MLflow. Helpful when instrumenting LLMOps.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin install mlflow@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official
Open on GitHub

What mlflow does

This plugin gives the assistant skills for MLflow tracing and evaluation. It handles Python and TypeScript. You get autologging setups for OpenAI, Anthropic, LangChain, LangGraph, and LiteLLM. The agent inspects execution spans, investigates multi-turn conversations, and isolates root causes in your code.

For quality control, the package provides workflows to build evaluation datasets, generate custom code-based or model scorers, and query aggregate metrics like token counts. It also provides an optional prompt hook (mlflow-suggest-hook.py) that monitors incoming requests and suggests relevant skills on the fly.

All instructions and code patterns require MLflow 3.8 or newer.

What it helps with

  • instrument Python or TypeScript agents with MLflow tracing
  • diagnose span failures and chat errors without manual test runs
  • generate datasets and scorers to assess agent output quality
  • track token usage trends and request latencies over time

Example prompts for the agent

  • Add MLflow tracing to my LangChain app
  • Analyze trace tr-abc123 and explain why it returned the wrong answer
  • Show me token usage trends for the last 7 days

How to install mlflow

Plugin marketplace

/plugin install mlflow@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-official

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about mlflow

How to install mlflow in Claude Code?

First add the marketplace registry with /plugin marketplace add anthropics/claude-plugins-official. Then install the plugin using /plugin install mlflow@claude-plugins-official.

What does the mlflow plugin do?

It gives your coding agent procedures to instrument LLM calls, diagnose failing spans, generate quality scorers, and query MLflow performance metrics.

Which MLflow version is required?

The bundled skills and code examples are designed for MLflow 3.8+. Running them against older releases may lead to command or API mismatches.

Source text

SKILL.md · Apache-2.0
![MLflow Skills](/assets/header.svg)

# MLflow Skills for Coding Agents

> Turn your favorite coding agent into an LLMOps expert with MLflow skills.

Build, debug, and evaluate GenAI applications with confidence. These skills give your AI coding assistant deep knowledge of MLflow's tracing, evaluation, and observability features.

Works with any coding agent that support Skills, including [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Cursor](https://www.cursor.com/), [Codex CLI](https://github.com/openai/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli), and [OpenCode](https://github.com/opencode-ai/opencode).

## Why MLflow Skills?

Building production-ready AI agents is hard. You need observability to understand what your agent is doing, evaluation to measure quality, and debugging tools when things go wrong. MLflow provides SDKs and best practices for all of these operations, and with skills we bring them directly into the environment where LLM agent development happens. Now you can go to your favorite coding agent and just ask:

- *"Add tracing to my LangChain app"* → Instruments your code automatically
- *"Why did this trace fail?"* → Analyzes spans, finds root causes, suggests fixes
- *"Evaluate my agent's accuracy"* → Sets up datasets, scorers, and runs evaluation
- *"Improve my agent and verify your work"* → Gives the coding agent reproducible and verifiable mechanism with MLflow eval to hill climb on quality
- *"Show me token usage trends"* → Queries metrics and analyze trends

---

## Available Skills

### Tracing

| Skill | Description |
|-------|-------------|
| **instrumenting-with-mlflow-tracing** | Instruments Python and TypeScript code with MLflow Tracing. Supports OpenAI, Anthropic, LangChain, LangGraph, LiteLLM, and more. |
| **analyze-mlflow-trace** | Debugs issues by examining spans, assessments, and correlating with your codebase. |
| **analyze-mlflow-chat-session** | Debugs multi-turn chat conversations by reconstructing session history and finding where things went wrong. |
| **retrieving-mlflow-traces** | Powerful trace search and filtering by status, session, user, time range, or custom metadata. |
| **debug-agent** | Root-causes agent failures from existing MLflow traces without requiring a code change or evaluation suite. |

### Evaluation

| Skill | Description |
|-------|-------------|
| **agent-evaluation** | End-to-end agent evaluation workflow — dataset creation, scorer selection, evaluation execution, and results analysis. |
| **build-a-scorer** | Designs a small, cheap-to-run scorer suite from scratch — elicits quality criteria with you, routes each to code checks, built-in scorers, or LLM judges, then ships the implementation. |
| **querying-mlflow-metrics** | Fetches aggregated metrics (token usage, latency, error rates) with time-series analysis and dimensional breakdowns. |

### Setup

| Skill | Description |
|-------|-------------|
| **mlflow-onboarding** | Guides new users through MLflow setup based on their use case (GenAI apps vs traditional ML). |
| **searching-mlflow-docs** | Searches official MLflow documentation efficiently using the llms.txt index. |

---

## Installation

### Using `skills` installer

```bash
npx skills add mlflow/skills
```

### Direct Installation from Source

```bash
git clone https://github.com/mlflow/skills.git
cp -r mlflow-skills/* ~/.claude/skills/
```

Change the `~/.claude/skills/` directory to the appropriate location for your coding agent, e.g., `~/.codex/skills/` for Codex.

### Project-Level Installation

Add skills to your project for team sharing:

```bash
cd your-project
git clone https://github.com/mlflow/skills.git .skills/mlflow
# Or as a submodule:
git submodule add https://github.com/mlflow/skills.git .skills/mlflow
```

---

## Auto-Suggestion Hook (Optional)

The `hooks/` directory contains a `UserPromptSubmit` hook that automatically detects MLflow-related patterns in your prompts and surfaces the right skill before the agent responds — no need to remember which skill does what.

### Install the Hook

**Step 1:** Copy the hook somewhere permanent:

```bash
cp hooks/mlflow-suggest-hook.py ~/.claude/hooks/mlflow-suggest-hook.py
```

**Step 2:** Add it to your Claude Code settings (`~/.claude/settings.json`):

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "type": "command",
        "command": "python3 ~/.claude/hooks/mlflow-suggest-hook.py"
      }
    ]
  }
}
```

**Step 3:** Start a new session. When you ask something like *"Add tracing to my app"*, you'll see:

```
💡 Use the `instrumenting-with-mlflow-tracing` skill to add MLflow tracing.
```

See [`hooks/README.md`](hooks/README.md) for the full keyword-to-skill mapping and troubleshooting.

---

## Quick Examples

### Instrument Your App with Tracing

```
> Add MLflow tracing to my OpenAI app

The coding agent will:
1. Detect your LLM framework
2. Add the right autolog call
3. Configure experiment tracking
4. Verify traces are being captured
```

### Debug a Failed Trace

```
> Analyze trace tr-abc123 — why did it return the wrong answer?

The coding agent will:
1. Fetch the trace and examine all spans
2. Check assessments for quality signals
3. Walk the span tree to find the failure point
4. Correlate with your codebase to identify root cause
5. Suggest specific fixes
```

### Evaluate Agent Quality

```
> Set up evaluation for my customer support agent

The coding agent will:
1. Discover existing evaluation datasets
2. Help create test cases if needed
3. Select appropriate scorers (correctness, relevance, etc.)
4. Run evaluation and analyze results
5. Generate improvement recommendations
```

### Query Usage Metrics

```
> Show me token usage trends for the last 7 days

The coding agent will:
1. Query the MLflow metrics API
2. Generate time-series breakdowns
3. Identify cost spikes or anomalies
4. Suggest optimization opportunities
```

---

## Requirements

- **MLflow 3.8+** (Instructions and code examples are tested with MLflow 3.8)

---

## Contributing

We welcome contributions! Here's how to help:

1. **Report issues** — Found a skill giving incorrect advice? [Open an issue](https://github.com/mlflow/mlflow-skills/issues)
2. **Suggest improvements** — Have ideas for better workflows? We'd love to hear them
3. **Add new skills** — See [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) and file a pull request

### Testing skill behavior

The test code has two layers: live scenarios exercise skills through Claude; local verifier tests check that the graders accept valid work and reject broken work.

```text
tests/
  configs/
    setup/       # Onboarding, docs, backend prerequisites
    tracing/     # Instrumentation, retrieval, diagnosis, metrics
    evals/       # Evaluation, scorers, alignment, verified repair
  judges/        # Graders used by live scenarios
  scripts/       # Scenario setup and seeded application data
  verifiers/     # Local regression tests for graders and harness
  test_skill.py  # Existing YAML scenario runner
```

Config paths for setup scripts and judges remain relative to the repository root. Run live scenarios from the repository root using their grouped paths below; the former flat config paths have moved.

The YAML scenarios in `tests/configs/` run a real Claude Code participant in a fresh project and Claude home, install the selected repository skills plus the MLflow tracing plugin, and verify its work against a real MLflow server. Each scenario checks a successful native skill invocation or complete skill read, plus an observable task outcome. Task-only prompts test discovery among the skills installed for each scenario. No prompt names a skill or instructs the agent to load one. The dispatcher currently disables automatic invocation, so its required-loading check can expose that discovery limitation. Merely mentioning an API or reporting success does not pass.

Validated with MLflow 3.17.1. Requires an authenticated `claude` CLI, Git, Node/npm (for Claude tracing and TypeScript), and `uv`. Run a scenario:

```sh
uv run --with mlflow==3.17.1 --with litellm --with pytest --with langgraph --with langchain-core \
  python tests/test_skill.py tests/configs/evals/evaluation_nested.yaml
```

The original general evaluation scenario remains `agent_evaluation.yaml`: it clones `REPO_URL` and checks datasets, registered scorers, evaluation results, application traces, and both evaluation/tracing skill reads. Run it with `REPO_URL=<repository-url>` as a CLI override. The separate `evaluation_nested.yaml` is a deterministic local regression fixture.

| Config field | Meaning |
|---|---|
| `skills` | Installed skills; all are required to load by default. |
| `required_skills` | Optional subset when other installed skills are only helpers. Sent to the verifier, not the participant. |
| `judges` | Checks of the participant's actions and actual application results. |
| `tracking_uri` | Optional external server. Omit for a fresh local server. |
| `mlflow_port` | Optional fixed-port override. Omit to select a free local port. |

Default timeouts, `keep_workdir: true`, and `test_runs_dir: /tmp` need not be repeated. Fixtures contain application context, data, and actual deliverable interfaces; prompts are short user requests. Conversational answers are checked by an MLflow judge using `JUDGE_MODEL` (or its default), alongside backend and tool-evidence checks; participants need not write grading JSON. Specialized regression cases still have explicit operational constraints, such as approved smoke inputs and an unavailable backend.

| Skill/workflow | Scenarios | Observable checks |
|---|---|---|
| Onboarding | `onboarding_existing`, `onboarding_unavailable`, `onboarding_classic_ml` | Reuse configuration and experiment; persist smoke trace; report a real connection failure without resetting setup; reload an actual sklearn model and verify held-out predictions |
| Dispatcher | `dispatcher_scorer` | Load the dispatcher and scorer skill; execute a native scorer against held-out empty/missing/null/valid answers |
| Documentation | `docs_classic_ml` | Fetch official docs and explain a runnable classic-ML example |
| SageMaker | `sagemaker_prerequisites` | Execute prerequisite checks; stop when plugin/credentials are missing |
| Instrumentation | `tracing_test`, `tracing_typescript`, `langgraph_autolog_guidance` | Rerun the delivered entrypoint and require fresh Python/TypeScript inputs and outputs; native graph/model spans without redundant tracing |
| Trace retrieval | `trace_retrieval` | Exact matching IDs amid time, status and tag distractors |
| Single-trace diagnosis | `trace_analysis` | Identify the actual failing child span and its timeout inputs |
| Session diagnosis | `session_analysis` | Ordered turns, first incorrect answer, propagation, evidence, and failed-scorer exclusion |
| Aggregate metrics | `trace_metrics` | Exact counts and token sums from the real metrics endpoint; distinguish unsupported endpoints from other failures |
| Diagnosis versus repair | `diagnosis_only`, `agent_debug_trace_first` | Diagnosis preserves source; repair follows trace evidence and verifies refund/general routing |
| Evaluation | `evaluation_nested`, `evaluation_precomputed`, `evaluation_dry_run` | Nested predictor kwargs; exact six-row scores and mean; reuse dataset/scorer; never rerun precomputed outputs; verify a scored dry run precedes full evaluation; stop after a failed three-row dry run |
| Scorer design | `scorer_deterministic_suite`, `scorer_model_criteria` | Execute independent criteria on private malformed/near-miss cases; code, built-in and domain judges; preserve model selection |
| Judge alignment | `scorer_label_alignment`, `scorer_memalign` | Criterion-specific human labels and train/holdout splits; missing-provider blocker; saved native MemAlign training IDs, participant holdout comparison, and separate verifier holdouts |

Model-backed scenarios require working provider credentials. Set `TEST_JUDGE_MODEL` for `scorer_model_criteria`; for `scorer_memalign`, also set `TEST_EMBEDDING_MODEL` and add `--with dspy`. The repair scenario's existing LLM judge accepts `JUDGE_MODEL`. No credentials or private endpoint names belong in scenario files. Each run retains `environment.json`, `skill-inventory.json`, `verification.json`, participant transcripts, generated files, and the local MLflow store in its printed work directory. Setup failures and skill failures both return nonzero, with different exit codes.

To run the local scenarios sequentially, excluding those needing a model provider:

```sh
for config in tests/configs/*/*.yaml; do
  case "$config" in
    *scorer_model_criteria*|*scorer_memalign*|*agent_debug_trace_first*|*agent_evaluation*) continue ;;
  esac
  uv run --with mlflow==3.17.1 --with litellm --with pytest --with langgraph --with langchain-core \
    python tests/test_skill.py "$config" || exit 1
done
```

Supporting verifier regression checks run without Claude or model calls:

```sh
uv run --with mlflow==3.17.1 --with pytest --with langgraph --with langchain-core --with dspy \
  pytest -q tests/verifiers
```

Expected answers are stored outside the project but remain accessible on the same machine; this is not an adversarial sandbox. Investigation grading also requires observed MLflow retrieval. These scenarios are behavioral regression coverage, not a claim of exhaustive platform coverage or a baseline-versus-treatment comparison. Live SageMaker connection, Databricks UC storage/Review App/online monitoring, GEPA prompt optimization, distributed tracing, and every supported framework still require dedicated environments and scenarios. A successful local run does not verify those integrations. The repository currently has no CI workflow that launches the paid Claude scenarios automatically.

### Creating a New Skill

We recommend using the [skill-creator](https://github.com/anthropics/skills/tree/main/skills/skill-creator) from Anthropic's skills repository as a starting point.

---

## License

Apache License 2.0 — see [LICENSE](LICENSE) for details.

---

## Links

- 📖 [Read MLflow Documentation](https://mlflow.org/docs/latest/)
- 📖 [Read MLflow Skills Blog](https://mlflow.org/blog/evaluating-skills-mlflow))
- ⭐️ [Star MLflow on GitHub](https://github.com/mlflow/mlflow)

---

<p align="center">
  <sub>Built with care for the MLflow community</sub>
</p>

© MLflow Team · Apache-2.0 · mlflow/skills

Similar plugins

All plugins for AI and ML →

From the same set10

searching-mlflow-docs Fetches official MLflow GenAI documentation and verbatim code snippets directly through the llms.txt index. CX Codex +1 1,000installs agent-evaluation A skill that runs systematic LLM agent evaluation through MLflow: datasets, scorers, tracing. Useful when an agent picks the wrong tool or returns incomplete answers. CX Codex +1 1,100installs analyzing-mlflow-trace The skill takes a single MLflow trace by ID and works out what went wrong: failed spans, odd behaviour, quality scores. CX Codex +1 1,000installs analyzing-mlflow-session Walks an MLflow session — the traces behind one multi-turn chat — to find which turn broke. Useful when a conversation with your agent goes sideways. CX Codex +1 960installs querying-mlflow-metrics Pulls aggregated trace metrics from MLflow: token usage, latency, trace counts and quality evaluations. Useful when you want experiment stats without leaving the chat. CX Codex +1 953installs mlflow-agent Reads an MLflow request and invokes the right sub-skill for you: tracing, evaluation, agent debugging or docs lookup. Useful when you don't want to memorize sub-skill names. CX Codex +1 789installs fix-agent-issue A skill that walks the agent through EXPLORE → PLAN → IMPLEMENT → VERIFY so a behavior change rests on a trace and a test, not a guess. CX Codex +1 365installs build-a-scorer Helps design and iterate MLflow judges and scorers for LLM apps or RAG agents. It defines atomic criteria and picks the cheapest reliable check. CX Codex +1 328installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor