MLLoop
An MCP server that enforces a scientific-method loop for AI-driven machine learning experiments, with hypothesis gating, diagnostics, and data forensics.
README
MLLoop
A scientific-method harness for AI-driven machine learning.
Coding agents (Claude Code, opencode, ...) can already write training code and run ten variants overnight. What they don't do by themselves is science: diagnose why a model underperforms, form falsifiable hypotheses, run discriminating experiments, and — when the data itself is the problem — produce evidence strong enough to convince stakeholders.
MLLoop is an MCP server that sits between the agent and your training code and enforces that loop at the tool layer, not via prompts:
- Experiment ledger — every run, hypothesis, and decision recorded in SQLite plus an
append-only JSONL event log, all under
.mlloop/in your project. - Hypothesis gate —
run_startrefuses any experiment that doesn't test a registered, falsifiable hypothesis. No hypothesis, no run. - Artifact contract — each run writes standardized
predictions.parquet+meta.json; diagnostics never read your training code, so any framework works. - Diagnostics battery — after every run: error slices, bootstrap noise floor ("what delta counts as evidence"), confusion/residuals, calibration, overfit gap. Diagnosing the previous run is itself a gate: no diagnosis, no next experiment.
- Data Verdict Report — when runs stagnate,
forensics_runinterrogates the dataset with independent probes (shuffled-label signal check, confident-learning label-noise estimation, conflicting-duplicate bound, learning curve, per-feature signal) andreport_generaterenders a stakeholder-readable HTML verdict: is the ceiling set by the data or by the modeling? Demo: inject 20% label noise into a clean dataset — the report catches it, quantifies it, and lists the suspect rows. - Dashboard (Phase 2) — iteration tree, hypothesis board, and metric trajectory for the morning-after review of an overnight autonomous session.
Status: Phase 1 — ledger, gates, diagnostics, forensics, and reports all working. Full design: DESIGN.md. Agent setup (Claude Code / opencode / Codex): docs/integrations.md.
Quickstart
pip install -e .
cd your-ml-project
mlloop init --agent claude # or opencode / codex / all — writes the MCP config
Then tell your agent to train a model. The enforced workflow:
| Step | Tool | Gate |
|---|---|---|
| 1 | goal_define |
Locks dataset, target column, primary metric. Required first. |
| 2 | run_start(kind='baseline') |
First run must be a simple baseline. |
| 3 | diagnose_run |
Every finished run must be diagnosed before the next experiment. |
| 4 | hypothesis_register |
Falsifiable claim about what limits performance, from the diagnosis. |
| 5 | run_start(hypothesis_id=...) |
Refused without a registered hypothesis. |
| 6 | run_finish |
Validates the artifact contract before accepting results. |
| 7 | hypothesis_resolve / decision_record |
Evidence-backed resolution, recorded decisions. |
| 8 | forensics_run → report_generate |
When stagnating: interrogate the data, render the verdict. |
status shows the current state and allowed actions at any time; ledger_query restores
full context after an agent restart or context compaction.
Contributing
Issues, design feedback, and pull requests are welcome — see CONTRIBUTING.md. Please note the Code of Conduct.
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.