DagsHub MCP
Provides tools for exploring and comparing DagsHub-hosted MLflow experiments and runs: list experiments, search/filter runs, inspect metrics, parameters, tags, metric history, artifacts, and calculate baseline differences, rankings, and threshold checks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DagsHub MCP Compare the latest runs in owner/repository by recall and flag comparability gaps."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
# DagsHub MCP
Explore your DagsHub experiments with an AI agent. Compare runs, inspect evaluation reports, and make model decisions backed by metrics and source references.
DagsHub MCP is a local, read-only Model Context Protocol server that connects your AI client to DagsHub repositories and their MLflow tracking servers. Your client provides the AI model; the server retrieves evidence and calculates comparisons.
"Compare my latest runs against the baseline for recall, require latency below 100 ms, and recommend the next experiment. Show the evidence and any comparability gaps."
Features
Explore experiments: search runs and inspect metrics, parameters, tags, and metric history.
Compare results: calculate baseline differences, rank runs, and check metric thresholds.
Inspect reports: read JSON, CSV, Markdown, and text from artifacts or repository revisions.
Trace the evidence: return run references, resolved commit SHAs, and provenance warnings.
Use your preferred agent: connect through local MCP over stdio, without an LLM API key in the server.
The server analyzes existing results. It does not train models, run new evaluations, modify repositories, or deploy models.
Related MCP server: Comet ML MCP Server
Quick start
1. Install
Requires Python 3.11+, uv, and access to a DagsHub repository. Python 3.12 is the tested interpreter. For natural-language analysis, use an MCP-compatible AI client such as VS Code with GitHub Copilot.
git clone https://github.com/InduwaraRathnayake/dagshub-mcp.git
cd dagshub-mcp
uv sync --locked --python 3.12Dependencies are installed into the project's .venv, leaving system Python packages unchanged.
2. Configure DagsHub access
Create a local .env from the template:
# Windows PowerShell
Copy-Item .env.example .env# macOS / Linux
cp .env.example .envEdit .env:
DAGSHUB_USERNAME=your-username
DAGSHUB_TOKEN=your-access-token
DAGSHUB_REPOSITORIES=owner/repositoryVariable | Where to find it |
| Your personal DagsHub username, including when accessing an organization repository. |
| Generate an access token in DagsHub token settings. |
| The |
Only repositories in DAGSHUB_REPOSITORIES can be accessed. Both credentials may be omitted
for public access, although experiment tracking can still require repository permissions.
Authentication uses your username and token through Basic authentication.
.env is ignored by Git. Keep tokens in your local environment and out of chat messages.
3. Connect your AI client
VS Code with GitHub Copilot
Open the cloned project folder in VS Code and sign in to GitHub Copilot. The included
.vscode/mcp.json uses the workspace location to launch the server and load .env.
Open the Command Palette and run MCP: List Servers.
Select dagshub, start it, and review any server trust prompt.
Open Copilot Chat and select Agent.
Enable DagsHub through Configure Tools beside the chat input. If that picker is unavailable, run Chat: Open Customizations, select Tools, and enable DagsHub.
Ask a question using your configured repository name:
Use the DagsHub MCP tools to list experiments in
owner/repository. Show the latest completed runs and their available metrics.
VS Code starts its own server process. No separate terminal server or Inspector session is needed. See the VS Code MCP reference and tool controls for client-specific details.
Other local MCP clients
For clients using a mcpServers configuration, add this entry. Replace the directory with
an absolute path to your clone; adapt the configuration to your client's schema.
{
"mcpServers": {
"dagshub": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/dagshub-mcp",
"run",
"--locked",
"--env-file",
".env",
"dagshub-mcp"
]
}
}
}On Windows, a path such as C:/Users/you/projects/dagshub-mcp works without JSON backslash escaping.
The --directory argument ensures the server loads the project's environment and .env file.
Example questions
Replace repository, metric, report, and run names with values from your project.
List the experiments in
owner/repositoryand summarize the latest completed runs.
Compare these runs by
accuracy, where higher is better. Show parameter differences and flag any dataset or split differences before recommending a run.
Compare run A against baseline B for
recall, and requirelatency_ms <= 100. Explain whether the improvement meets that constraint.
Read
reports/evaluation.jsonat revisionmainand inspect the selected run's metric history. Summarize the observations and propose the next experiment.
The server also provides an analyze_experiments MCP prompt for an evidence-based review.
Prompt availability and invocation depend on the client.
Available tools
All tools require an explicit repository in owner/repository format.
Tool | Purpose | Main inputs |
| Discover active MLflow experiments | Pagination |
| Find active runs using MLflow filters and sorting |
|
| Inspect metrics with steps/timestamps, params, tags, and dataset inputs |
|
| Read a metric's logged history |
|
| Browse an artifact directory |
|
| Preview an evaluation artifact |
|
| Browse versioned repository files |
|
| Preview a report at a resolved commit |
|
| Calculate differences, ranks, and threshold results |
|
Page sizes range from 1 to 100. Follow next_page_token and inspect warnings and truncated.
Reuse returned commit SHAs for repository reads and subsequent pages to keep revisions consistent.
Comparison behavior
compare_runs accepts 2-20 distinct runs from one repository, including the selected baseline.
Specify maximize or minimize for the objective metric. For example:
{
"repository": "owner/repository",
"run_ids": ["baseline-run-id", "candidate-run-id"],
"baseline_run_id": "baseline-run-id",
"metric": "recall",
"direction": "maximize",
"thresholds": [
{"metric": "latency_ms", "operator": "<=", "value": 100}
]
}Changes are signed
candidate - baseline; percentage change divides byabs(baseline). A zero baseline has no percentage change.Ranks use the objective metric, independently of threshold eligibility. Ties share a dense rank.
Missing or non-finite objective/threshold values make a run unevaluable.
Comparisons use the latest logged values, which may come from different training steps.
Missing or differing dataset, split, and code provenance produces warnings. Summary metrics alone do not establish statistical significance or causation.
Supported data and limitations
Area | Current support |
Transport | Local stdio MCP |
Report formats | UTF-8 |
File reads | At most 1 MiB per file |
Previews | Up to 20,000 text characters or 100 CSV rows, including a header if present |
Repository data | Git/DVC content at a branch, tag, or commit resolved to a full SHA |
Artifact storage |
|
External S3/GCS/local artifact locations, signed URLs, redirected downloads, and Data Engine browsing are unsupported. Large JSON previews are text excerpts rather than complete JSON objects. No repository code or serialized model is executed. Retrieved content is treated as untrusted data.
Requests have timeouts and response-size bounds. Transient service failures and rate limits are retried within a fixed attempt limit. Credentials are not forwarded through redirects.
Troubleshooting
Symptom | What to check |
Terminal appears idle | Expected: stdio waits for an MCP client. It is not an interactive chat. |
VS Code cannot find | Make |
Server fails at startup | Check |
DagsHub tools are missing | Start the server, enable its tools in chat, and inspect Show Output for errors. |
Authentication error | Check the token, personal username, and access to the selected repository. |
Repository not allowed | Add the exact |
Empty experiment list | Confirm the repository contains MLflow experiments and your account can access them. |
Unsupported storage or large report | Check the supported formats, artifact locations, and size limits above. |
To inspect individual tools, run this from the project root (requires Node.js/npm):
npx @modelcontextprotocol/inspector uv run --locked --env-file .env dagshub-mcpOpen the URL printed in the terminal, connect, and call list_experiments with your repository.
Development and testing
uv sync --locked --python 3.12
uv run --locked pytest
uv run --locked ruff check .
uv run --locked ruff format --check src testsThe default suite uses fixtures and mocked APIs. It covers comparison calculations, report bounds, authentication failures, pagination, retries, MCP discovery, and a real stdio subprocess.
Live tests are opt-in and read from the first configured repository in alphabetical order:
# Windows PowerShell
$env:DAGSHUB_LIVE_TEST = "1"
uv run --locked --env-file .env pytest -m live -v
Remove-Item Env:DAGSHUB_LIVE_TEST# macOS / Linux
DAGSHUB_LIVE_TEST=1 uv run --locked --env-file .env pytest -m live -vThe live test lists repository files and experiments, then inspects a run if available. It does not validate every report or artifact storage configuration.
API adapters, deterministic analysis, and MCP tool registration are separated under
src/dagshub_mcp. Contributions should include relevant tests and pass
the checks above. When reporting an issue, include reproduction steps and sanitized error
output; omit credentials and private experiment data.
License
Copyright 2026 Induwara Rathnayake.
Licensed under the Apache License, Version 2.0.
References
Available Tools
9 toolscompare_runsARead-onlyIdempotent
Compare 2–20 distinct runs in one repo using latest logged metric values.
Baseline must be selected. Rank considers the objective only, independently of threshold eligibility. Changes are signed candidate minus baseline; percentage uses abs(baseline). Missing objective or threshold metrics make a run unevaluable. Check provenance warnings.
Inputs: metric (required), run_ids (required), direction (required), repository (required), +2 more. Returns: runs, metric, source, warnings, +4 more
get_metric_historyBRead-onlyIdempotent
Read a bounded metric-history page. Check truncation and follow next_page_token.
Inputs: metric (required), run_id (required), repository (required), limit, +1 more. Returns: items, source, revision, warnings, +3 more
get_runBRead-onlyIdempotent
Read latest logged metrics (including steps), parameters, tags and dataset inputs.
Inputs: run_id (required), repository (required). Returns: tags, params, run_id, source, +8 more
list_artifactsCRead-onlyIdempotent
List an artifact directory; follow next_page_token for remaining entries.
Inputs: run_id (required), repository (required), path, limit, +1 more. Returns: items, source, revision, warnings, +3 more
list_experimentsBRead-onlyIdempotent
List active MLflow experiments in an allowed owner/repo; follow next_page_token.
Inputs: repository (required), limit, page_token. Returns: items, source, revision, warnings, +3 more
list_repo_filesBRead-onlyIdempotent
List versioned files at a branch/tag/SHA, resolving it to a full commit SHA.
Reuse the returned revision for stable subsequent pages and reads.
Inputs: revision (required), repository (required), path, limit, +1 more. Returns: items, source, revision, warnings, +3 more
read_artifactARead-onlyIdempotent
Read a UTF-8 JSON/CSV/MD/TXT artifact, at most 1 MiB; previews may be truncated.
Inputs: path (required), run_id (required), repository (required). Returns: path, rows, text, format, +7 more
read_repo_fileARead-onlyIdempotent
Read a UTF-8 JSON/CSV/MD/TXT report pinned to a resolved commit; 1 MiB limit.
Inputs: path (required), revision (required), repository (required). Returns: path, rows, text, format, +7 more
search_runsBRead-onlyIdempotent
Search active runs using MLflow filter syntax, e.g. metrics.accuracy > 0.9.
order_by uses MLflow expressions such as metrics.accuracy DESC. Follow pagination.
Inputs: repository (required), experiment_ids (required), limit, order_by, +2 more. Returns: items, source, revision, warnings, +3 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct target: experiments, runs, metric history, artifacts, repo files, or run comparison. The closest pairs (get_run/get_metric_history and list_artifacts/list_repo_files) are separated by resource and description.
All tools follow a consistent snake_case verb_noun convention: list_experiments, search_runs, get_run, get_metric_history, list_artifacts, read_artifact, list_repo_files, read_repo_file, compare_runs.
Nine tools is well-scoped for an MLflow/DagsHub read-oriented server, covering experiments, runs, metrics, artifacts, repo files, and comparison without excessive surface area.
The surface covers core read workflows for experiments, runs, metrics, artifacts, repo files, and run comparison. Minor gaps exist around experiment-level details, model registry concepts, or broader artifact binary handling, but the main investigative workflows are supported.
Maintenance
Related MCP Connectors
Experiment tracking for coding agents: read your team's ML runs, metrics and lineage. Read-only.
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Browser-local and CLI static evidence for deployed AI model artifacts.
Read-only MCP for AI usage profiles, leaderboards, stats, and docs; no writes or private data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables read-only access to SwanLab workspaces, projects, runs, and metrics through the Model Context Protocol.10MIT

Comet ML MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables interaction with Comet ML's experiment tracking platform through the Model Context Protocol, providing tools for experiment management, project organization, and advanced search.91 PyPI2Apache 2.0- AlicenseNot gradedqualityDmaintenanceLocal, read-only Modal context for coding agents. Enables agents to inspect Modal apps, deployments, logs, containers, volumes, and sandboxes without granting mutation tools.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely browse, search, inspect, and understand local project files through Model Context Protocol tools.1MIT