
AgentSUMO
io.github.mw-jeong由 GitHub 账号 mw-jeong 发布v0.1.2更新于 Oct 24, 2026
MCP server for LLM-driven SUMO traffic simulation, scenario design, and result analysis.
概览
AgentSUMO 让助手根据自然语言提出的政策问题构建、运行并分析 SUMO 交通仿真,从 OSM 路网生成到结果报告。
- 可以做什么
- 构建基线仿真:提取 OSM 数据、转换路网、生成出行与路径,并运行 SUMO 仿真(场景生成)。施加政策干预,如边编辑、减少车道、需求与流量调整、信号配时偏移或自适应(政策实验)。将 SUMO XML 输出转换为 SQLite 并生成 HTML 仿真报告(结果分析)。可视化路网、高亮边、政策目标以及按边的指标热力图(可视化)。查看路网统计、分析路径、将道路名称解析为边 ID、校验起讫点坐标,并进行网络搜索佐证(实用工具)。
- 适用场景
- 适合把道路封闭、减少车道、信号优化或需求变化等交通政策问题转化为可运行的 SUMO 场景,并在多次运行之间比较结果,而无需手写 SUMO 配置文件。
- 运行要求
- 本地 Python 3.10+ 进程,可通过 uvx 或 pip install 运行;需本地安装 SUMO 1.24+,并将 SUMO_HOME 指向包含 bin/、share/ 和 tools/ 的目录。可选的 AGENTSUMO_MCP_OUTPUT_BASE 指定输出位置(默认为当前工作目录)。完整 AgentSUMO 框架另需 Anthropic Claude API 密钥和用于网页地图的 Mapbox 令牌。
安装
在 SourceWeft 中
- 打开 控制台中的 AgentSUMO,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
AgentSUMO
An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Models
[PyPI] [tests] [arXiv] [Docs] [License: MIT] [Python 3.10+] [MCP Registry]
[AgentSUMO overview]Documentation · Installation · Tools · Schema · Tutorials
Overview
AgentSUMO lets non-expert stakeholders design, execute, and analyze SUMO traffic simulations through natural-language interaction. The Planner Agent translates abstract policy questions into executable simulation plans, drives them via the Model Context Protocol (MCP), and surfaces results through a web dashboard.
- Conversational scenario design — describe a policy question, get a runnable simulation
- Policy experiments — road closures, lane reductions, signal optimization, demand changes
- Cross-scenario analysis — SQL-based comparison across runs, with auto-generated HTML reports
- Web dashboard — geospatial visualization, time-series charts, and trip replay
Demo
Web interface: conversational planning panel, scenario list, and live simulation status.
Geospatial visualization: per-edge metrics, congestion overlays, and trip replay on the 2.5D basemap.
Architecture
The reasoning layer (Planner Agent) lives in this repository. The execution layer (agentsumo-mcp) is published to PyPI and installed automatically as a dependency.
Tool Layer
The AgentSUMO MCP Server exposes 26 tools grouped into five capability categories that follow the simulation workflow. Full reference at agentsumo.readthedocs.io/.../tools.
Installation
Requirements
- Python 3.10 or later
- SUMO 1.24 or later (locally installed, with
SUMO_HOMEset) - Anthropic Claude API key (bring-your-own-key)
- Mapbox access token (used by the web map renderer)
1. Install SUMO
macOS
Or download the installer from the Eclipse SUMO downloads page.
Windows — Download the installer from the Eclipse SUMO downloads page.
Linux (Ubuntu/Debian)
2. Set up the Python environment
Install uv:
Clone the repository, create a virtual environment, and install AgentSUMO:
3. Configure environment variables
AgentSUMO reads API keys and the SUMO path from environment variables. The easiest way is a .env file at the project root:
Open .env in your editor and fill in:
ANTHROPIC_API_KEY (required) — Claude API key that drives the Planner Agent. Get one at the Anthropic Console.
MAPBOX_TOKEN (required for the web UI) — used to render the basemap. Get one at the Mapbox access tokens page.
SUMO_HOME (required) — absolute path to your local SUMO installation. The directory must contain bin/sumo (or bin/sumo.exe on Windows).
AGENTSUMO_MCP_OUTPUT_BASE (optional) — override the base directory where the MCP server writes simulation outputs (networks, trips, results). Defaults to the current working directory.
4. Run
Project Structure
Use the MCP Server Standalone
The AgentSUMO MCP Server can be used independently from this framework with any MCP-compatible LLM client (Claude Desktop, OpenAI tool clients, Gemini, local LLMs):
Or via uvx without installing:
The server is registered in the official MCP Registry under io.github.mw-jeong/agentsumo-mcp.
Troubleshooting
SUMO path error — Verify SUMO_HOME in your .env. The directory must contain bin/sumo (or bin/sumo.exe on Windows).
API key error — Verify ANTHROPIC_API_KEY in your .env is set to a valid Claude API key. The Planner Agent will refuse to start without it.
Dependency error — Re-resolve dependencies:
Legacy token files (deprecated, scheduled for removal in 0.2.0) — AgentSUMO still falls back to claude_api.txt and mapbox_token.txt at the project root when the corresponding environment variables are missing, but those code paths now emit a DeprecationWarning at import time. Use the .env workflow for new installations.
Documentation
Full documentation lives at agentsumo.readthedocs.io.
- Installation — SUMO, Python 3.10+, environment setup
- Tools — reference for all MCP tools
- Schema —
simulations.dbER diagram and column reference - Tutorials — walkthroughs of the paper case studies
Citation
If you use AgentSUMO in academic work, please cite:
License
MIT. See LICENSE.
Developed at
来源:README.md,提交 2ad1d91
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分