内容
# LeWM-MCP
<p align="center">
<a href="https://github.com/casey/just"><img src="https://img.shields.io/badge/just-ready_to_go-7c5cfc?style=flat-square&logo=just&logoColor=white" alt="Just"></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
<a href="https://python.org"><img src="https://img.shields.io/badge/Python-3.12+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python"></a>
<a href="https://biomejs.dev"><img src="https://img.shields.io/badge/Linted_with-Biome-60a5fa?style=flat-square&logo=biome&logoColor=white" alt="Biome"></a>
<a href="https://github.com/PrefectHQ/fastmcp"><img src="https://img.shields.io/badge/FastMCP-3.2-7c5cfc?style=flat-square" alt="FastMCP"></a>
<a href="https://playwright.dev"><img src="https://img.shields.io/badge/E2E-Playwright-45ba4b?style=flat-square&logo=playwright&logoColor=white" alt="Playwright"></a>
<a href="https://tauri.app"><img src="https://img.shields.io/badge/Tauri-2.0-FFC131?style=flat-square&logo=tauri&logoColor=white" alt="Tauri"></a>
</p>
FastMCP **3.2** 服务器桥接 **LeWorldModel (LeWM)** — 来自 Maes 等人的紧凑 JEPA 世界模型 ([arXiv:2603.19312](https://arxiv.org/abs/2603.19312)) — 到集群中:**真正的上游训练/评估** 子进程,**智能代理** 工作流程准备,以及 **glass** Vite 仪表盘。
论文全文通过 `tools/ingest_lewm_paper.ps1` 被摄入到 **arxiv-mcp** 中,以便集群用户可以轻松阅读。
## 快速开始
```powershell
uv sync --extra test --extra dev
.\tools\bootstrap_upstream.ps1
.\tools\download_pusht_assets.ps1
.\tools\ingest_lewm_paper.ps1
.\start.bat
```
- 后端 + MCP:http://127.0.0.1:10927
- 仪表盘:http://127.0.0.1:10928
- 上游:`D:\Dev\repos\external\le-wm` (自动发现)
参见 [docs/INSTALL.md](docs/INSTALL.md) 以获取评估数据集(`-WithDataset`,约 13 GB)。
## MCP 工具
| 工具 | 操作 |
|---|---|
| `lewm_world` | 健康检查,训练准备,**训练运行**,推理准备,**评估运行**,检查点列表,作业状态,作业停止,作业日志 |
| `lewm_status` | 配置快照,设备,上游虚拟环境,活动作业 |
| `lewm_agentic_workflow` | 多步骤规划(可选 LLM 采样) |
`train_run` 启动上游 `python train.py data=pusht`。`eval_run` 启动 `python eval.py --config-name=pusht.yaml policy=pusht/lewm`。
## 文档
| 文档 | 主题 |
|-----|-------|
| [docs/PRD.md](docs/PRD.md) | 产品需求 |
| [docs/MCP.md](docs/MCP.md) | 工具和传输 |
| [docs/WEBAPP.md](docs/WEBAPP.md) | 仪表盘和 API |
| [docs/PAPER.md](docs/PAPER.md) | 研究论文 + arxiv-mcp |
| [docs/UPSTREAM.md](docs/UPSTREAM.md) | le-wm 集成 |
## 集群集成
- 端口 **10927** / **10928** 在 [mcp-central-docs](https://github.com/sandraschi/mcp-central-docs) 注册表中
- 可选代理通过 google-ai-mcp `google_ai_world` 在 http://127.0.0.1:11014
## 测试
```powershell
uv run pytest tests/ -q
cd webapp; npx playwright test
```
## 配置
```powershell
$env:LEWM_UPSTREAM_ROOT = "D:\Dev\repos\external\le-wm"
$env:LEWM_STABLEWM_HOME = "D:\Dev\repos\external\le-wm\.stable-wm"
$env:LEWM_DEVICE = "cuda:0"
```
## 仓库
https://github.com/sandraschi/lewm-mcp