sy-automl-mcp
Click on "Install 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., "@sy-automl-mcpTrain a tabular model on the iris dataset"
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.
sy-automl-mcp
v0.2.0 — Phase 1 + Phase 2 + Phase 3 all complete. 48 tests pass on
:full, 46+2 skip on:latest. Live stdio MCP e2e verified.
将 AutoGluon 的 AutoML 能力封装为 MCP (Model Context Protocol) 服务,让 AI 助手(如 Claude Code)通过标准 MCP 工具调用完成数据加载、模型训练、预测、评估、模型管理全流程。
运行环境:Docker 优先。 AutoGluon 官方仅支持 Linux/macOS,原生 Windows 下多模态/torch 依赖不稳定。本项目通过 Linux 容器运行 MCP server,宿主为 Windows 时使用 Docker Desktop 即可,无需 WSL2 直装。
What's New in v0.2.0
Phase 3 tech-debt — 4 hardening items resolved, all verified against real AutoGluon in :full:
Per-task cancel race fixed —
tasks/registry.py+tasks/manager.pynow use per-task_state_lockwith sticky terminal states (SUCCESS/FAILED/CANCELLED). A cancel that arrives after completion returnsalready_terminalinstead of overwriting the result.LRU model cache —
tools/model_management.pyreplaced its unbounded predictor dict with a thread-safe_ModelLRUCache(OrderedDict + move-to-end + popitem(last=False)). Cap is configurable viaMCP_MODEL_CACHE_MAX(default4).Task retention —
tasks/registry.pyrunssweep()on add/get/list/snapshot/require, evicting terminal tasks older thanMCP_TASK_RETENTION_SECONDS(default86400) or over capMCP_TASK_MAX_RETAINED(default100). Running/pending tasks are never evicted; evicted-id lookup raises a clear "Task expired or not found".Thread-safe stdout redirect —
tools/_common.pyinstalls a process-wide_ThreadLocalOutputProxyonsys.stdout/sys.stderr._suppress_output()and the background worker set thread-local targets instead of swapping the global stream. Now safe to raiseMCP_MAX_WORKERSabove1for parallel training.
Plus: registry lock upgraded to RLock (sweep() re-enters the store lock), CANCELLED-before-execution now sets finished_at, _ThreadLocalOutputProxy gained explicit __iter__/__next__, and a new live harness e2e_stdio.py drives a real stdio MCP round-trip via the mcp SDK.
Related MCP server: Linear Regression MCP
当前状态
阶段 | 状态 | 说明 |
Phase 1 — Tabular + stdio + 后台任务 | ✅ 已验证 | 端到端 stdio 流程 |
Phase 2 — TimeSeries / Multimodal / 模型管理 | ✅ 已验证 | 在 |
Phase 3 — 加固(错误信封、资源限制、LRU、保留策略、线程安全、CI) | ✅ 完成 | envelope ✅,资源限制 ✅,stdout 污染修复 ✅,线程安全 ✅,LRU 缓存 ✅,任务保留 ✅,取消竞争 ✅ |
测试计数(v0.2.0): :latest 46 passed, 2 skipped(TS/MM skip 符合预期,它们在 :full 中);:full 48 passed, 0 skipped, 0 failed(~2.5 min)。Live stdio MCP e2e:PASSED(24 个工具 + 干净 stdout)。
关键事实: 镜像 sy-automl-mcp:latest(tabular tier,autogluon.tabular 1.5.0 + pandas 2.3.3)和 sy-automl-mcp:full(+ timeseries + multimodal)均已构建并通过全部测试。MCP server stdio 启动正常,tools/list 返回 24 个工具。stdout 污染已通过线程本地代理 + 两层防御(verbosity=0 + stdout/stderr 重定向)解决,max_workers > 1 安全。
快速开始
拉取预构建镜像(推荐)
# Tabular tier(默认,CPU 即可)
docker run -i --rm -v "$PWD/artifacts:/app/artifacts" ghcr.io/noahwang550/sy-automl-mcp:tabular
# Full tier(+ timeseries + multimodal,建议 GPU)
docker run --gpus all -i --rm -v "$PWD/artifacts:/app/artifacts" ghcr.io/noahwang550/sy-automl-mcp:full
v*tag push 会自动触发 GHCR publish workflow(.github/workflows/docker.yml)。标签包括:latest、:tabular、:full、:v0.2.0。
构建
# Tabular tier(默认,体积较小,CPU 即可)
docker build -t sy-automl-mcp .
# Full tier(+ timeseries + multimodal,建议 GPU)
docker build -t sy-automl-mcp:full --build-arg TIER=full .运行
# stdio 模式(本地 Claude Code)
docker run -i --rm -v "$PWD/artifacts:/app/artifacts" sy-automl-mcp
# streamable-http 模式(远程/共享)
docker run --rm -p 8000:8000 \
-e MCP_TRANSPORT=http -e MCP_PORT=8000 \
-v "$PWD/artifacts:/app/artifacts" sy-automl-mcpWindows Git Bash 注意: 使用
docker run -w /app时需要MSYS_NO_PATHCONV=1前缀,否则 Git Bash 会将/app自动转换为 Windows 路径。
在 Claude Code 中注册(stdio)
claude mcp add autogluon -- docker run -i --rm \
-v /absolute/path/to/sy-automl-mcp/artifacts:/app/artifacts \
sy-automl-mcp安装 Tier
Tier | 镜像标签 | 包含 | 用途 | 硬件 |
|
|
| 表格分类/回归 | CPU 即可 |
|
| + | 时序预测、图像/文本/多模态 | 建议 GPU |
# GPU 运行 full tier(多模态推荐)
docker run --gpus all -i --rm -v "$PWD/artifacts:/app/artifacts" sy-automl-mcp:full工具一览(24 个工具)
数据工具(2)
工具 | 说明 | Tier |
| 导入数据集(文件路径或内联 CSV),返回概要 | tabular |
| 训练前数据预检(列、缺失、类型) | tabular |
Tabular 工具(6)
工具 | 说明 | Tier |
| 后台训练 TabularPredictor,立即返回 | tabular ✅ |
| 用已训练模型预测(支持 dataset_id 或 inline_csv) | tabular ✅ |
| 返回模型排行榜 | tabular ✅ |
| 返回特征重要性 | tabular ✅ |
| 返回训练摘要 | tabular ✅ |
| 评估模型,返回指标 | tabular ✅ |
TimeSeries 工具(5)
工具 | 说明 | Tier |
| 后台训练 TimeSeriesPredictor | full ✅ |
| 时序预测(无数据时回退到训练集) | full ✅ |
| 时序模型排行榜 | full ✅ |
| 评估时序模型(支持自定义 id/time 列和指标) | full ✅ |
| 时序训练摘要 | full ✅ |
Multimodal 工具(3)
工具 | 说明 | Tier |
| 后台训练 MultimodalPredictor(图像/文本/多模态) | full ✅ |
| 多模态预测(校验 image_path/text 列) | full ✅ |
| 评估多模态模型(支持 metrics 列表) | full ✅ |
模型管理工具(4)
工具 | 说明 | Tier |
| 列出所有已训练模型 | tabular |
| 预加载模型到内存缓存 | tabular |
| 查询单个模型详情 | tabular |
| 删除模型(需 confirm=true) | tabular |
任务状态工具(4)
工具 | 说明 | Tier |
| 查询后台任务状态(pending/running/success/failed/cancelled) | tabular ✅ |
| 查询后台任务结果 | tabular ✅ |
| 软取消后台任务 | tabular ✅ |
| 列出所有后台任务 | tabular ✅ |
✅ = 已通过真实 AutoGluon 端到端验证(tabular 在
:latest,timeseries/multimodal 在:full)
目录约定
artifacts/datasets/— 导入的数据集artifacts/models/<model_id>/— AutoGluon 训练产物artifacts/predictions/— 预测输出artifacts/logs/<task_id>.log— 任务日志artifacts/registry.json— 模型注册表
artifacts/ 以 volume 挂载,跨容器重建保留;已 gitignore。
开发与测试
# 运行测试(pytest 不在生产镜像中,需运行时安装)
docker run --rm --entrypoint sh \
-v "$PWD/artifacts:/app/artifacts" \
sy-automl-mcp \
-c "pip install pytest pytest-asyncio -q && python -m pytest tests/ -v"
# 运行 lint
docker run --rm --entrypoint sh sy-automl-mcp \
-c "pip install ruff -q && ruff check ."
# 或使用 docker compose(需要 compose 中配置 test profile)
docker compose run --rm app pytest注意:
pytest未打入生产镜像以减小体积。测试时需在容器内临时安装,或使用独立的测试镜像。Windows Git Bash 注意:
docker run命令中若使用-w /app等工作目录参数,需加MSYS_NO_PATHCONV=1前缀防止路径被自动转换。
Stdout 污染防护
AutoGluon / PyTorch / Lightning 会向 stdout/stderr 输出进度条和横幅,可能破坏 MCP stdio JSON-RPC 流。本项目采用线程本地代理 + 两层防御:
tools/_common.py— 在 import 时一次性将sys.stdout/sys.stderr替换为进程级的_ThreadLocalOutputProxy。_suppress_output()上下文管理器将当前线程的目标设为os.devnull,仅影响调用线程。tasks/manager.py— 后台 worker 通过set_thread_output_target(task_log_fh)将该 worker 线程的输出重定向到任务日志文件;执行结束后调用reset_thread_output_target()。其他线程不受影响。此外,支持
verbosity参数的 AutoGluon 构造函数/方法均传入verbosity=0。
已验证::full 镜像的 stdio MCP 端到端测试(initialize → load_dataset → train_tabular → poll → predict_tabular)stdout 上仅有合法 JSON-RPC 帧,无 AutoGluon 泄漏,包括在并发 worker 线程下。
线程安全: stdout/stderr 重定向现在是线程安全的(线程本地目标,代理在安装后只读)。可安全提高
MCP_MAX_WORKERS以并行训练。
限制
训练
fit()可能运行很久;cancel_task为软取消(无法硬杀线程),实际中断依赖time_limit,请始终为训练设置合理的time_limit。streamable-http 模式当前无认证,仅限可信网络。
Windows 原生 Python 运行不在支持范围。
良性的 LRU 重复加载竞争:
tools/model_management.py中_load_model使用非原子性的检查-然后-设置,在max_workers > 1下两个并发调用可能同时加载同一个未缓存的模型(冗余工作,无崩溃,无正确性问题 —— 第二次加载简单覆盖第一次的条目)。在默认单 worker 配置下为良性。记录为未来加固项。进度解析(实时训练日志 tailing)未实现 —— 通过
get_task_status轮询log_tail。CI lint pipeline 与 80% 测试覆盖率目标尚未到位(可选)。
环境变量
变量 | 默认 | 说明 |
|
|
|
|
| streamable-http 模式的监听端口 |
|
| 后台任务线程池大小(v0.2.0 起可安全提高) |
|
| 内存中预测器 LRU 缓存上限 |
|
| 终态任务记录保留时长(秒) |
|
| 终态任务最大保留数量 |
| — | 数据集资源限制 |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/noahwang550/sy-automl-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server