Agentic AutoML Data Scientist MCP
An AI platform that automates the complete machine learning workflow using LangGraph agents and integrates with MCP servers for file, compute, and database operations.
README
Agentic AutoML Data Scientist using MCP
An advanced, production-ready AI platform that automates the complete machine learning workflow (data analysis, cleaning, EDA, feature engineering, model selection, hyperparameter tuning, evaluation, explainability, and PDF report compilation) using multiple AI agents orchestrated with LangGraph and integrated with Model Context Protocol (MCP).
The platform mimics a junior data scientist, logging every step, comparing standard Scikit-learn models (SVM, Random Forests, KNN, Linear/Logistic regression, Gradient Boosting), and producing interactive dashboards and downloadable models/PDF reports.
Architecture Diagram
flowchart TD
UI["Web Dashboard (HTML5 / CSS3 / JS)"] <-->|REST API| FastAPI["FastAPI Server (:8000)"]
subgraph Orchestrator ["FastAPI Backend (LangGraph Orchestrator)"]
Planner["Planner Agent"]
Analyzer["Dataset Analysis Agent"]
EDA["EDA Agent"]
Cleaner["Data Cleaning Agent"]
FE["Feature Engineering Agent"]
Selector["Model Selection Agent"]
Tuner["Hyperparameter Tuning Agent"]
Evaluator["Evaluation Agent"]
Explain["Explainability Agent"]
Reporter["Report Generation Agent"]
end
FastAPI <-->|MCP Protocol / stdio| FS_MCP["Filesystem MCP Server"]
FastAPI <-->|MCP Protocol / stdio| PY_MCP["Python MCP Server"]
FastAPI <-->|MCP Protocol / stdio| DB_MCP["SQLite MCP Server"]
FS_MCP <-->|Read / Write| Disk[("Local Filesystem")]
PY_MCP <-->|Execute ML| ML["Scikit-Learn / Pandas"]
DB_MCP <-->|Log History| SQLite[("SQLite DB")]
Core Components
1. LangGraph Agents
- Planner Agent: Understands the user's optimization request, analyses the dataset preview, selects the target column, and sets the regression/classification type.
- Dataset Analysis Agent: Summarizes the columns, null counts, shapes, and types.
- EDA Agent: Generates figures (missingness, correlations, target distribution) and writes findings.
- Data Cleaning Agent: Configures and executes missing values imputation, encoding, and scaling.
- Feature Engineering Agent: Writes custom python pandas statements to drop useless columns (like IDs) and generate derived features.
- Model Selection Agent: Iterates and trains candidate models to compare performance.
- Hyperparameter Tuning Agent: Fine-tunes the best model using cv grid/randomized search.
- Evaluation Agent: Finalizes metrics (Accuracy/F1/ROC AUC or MAE/RMSE/R2) and generates fit curves.
- Explainability Agent: Generates textual model explanations and identifies top feature importances.
- Report Generation Agent: Compiles findings into a PDF and logs metrics to SQLite history.
2. MCP Server Integrations
Rather than tightly coupling operations, all file, compute, and database actions go through standard Model Context Protocol tool calls:
- Filesystem MCP Server: Manages disk files (CSV datasets, serialized model binaries, and PDF reports).
- Python MCP Server: Executes isolated Pandas preprocessing, trains Scikit-learn models, tunes hyperparameters, and outputs Matplotlib figures. It also has a code interpreter tool (
execute_python_code) to run dynamic feature engineering code. - SQLite MCP Server: Logs and retrieves historical experiment statistics.
Tech Stack
- Python 3.11
- FastAPI (Backend REST API & Static File Server)
- LangGraph (Agent flow graph)
- LangChain & Google Gemini 2.5 Flash (LLM brains)
- Model Context Protocol (MCP) (SDK for client-server tool calls)
- Scikit-learn, Pandas, NumPy (Machine Learning & Data Processing)
- Plotly, Matplotlib, Seaborn (Data Visualizations)
- ReportLab (PDF document compilation)
- HTML5 / CSS3 / JavaScript (Responsive Single-Page Web App)
- SQLite3 (Historical experiment logging database)
- Docker & Docker Compose (Containerization)
Local Setup
Prerequisites
- Python 3.11 installed.
- A Google Gemini API Key. Get one from Google AI Studio.
Installation
-
Clone this repository to your workspace.
-
Initialize virtual environment and install packages:
python -m venv .venv .venv\Scripts\activate pip install --upgrade pip pip install -r requirements.txt -
Set your API Key in your
.envfile or environment:- Windows (PowerShell):
$env:GEMINI_API_KEY="your-api-key-here" - Linux/macOS:
export GEMINI_API_KEY="your-api-key-here"
- Windows (PowerShell):
-
Generate example datasets:
.venv\Scripts\python backend\datasets\generate_sample_data.py -
Run server:
.venv\Scripts\python run_dev.py- Single-Page Web Dashboard & API: http://localhost:8000
- Swagger API Documentation: http://localhost:8000/docs
Docker Deployment
You can run the entire platform with a single command using Docker:
- Create a
.envfile in the root directory:GEMINI_API_KEY=your_actual_gemini_api_key_here - Build and launch:
docker-compose up --build - Access the web dashboard at http://localhost:8000.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。