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.

概覽

AI 產生的概覽

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 權杖。
安裝前請注意
模擬會在 AGENTSUMO_MCP_OUTPUT_BASE 或工作目錄下寫入路網、旅次、結果與報告檔案,建議指向專用資料夾。完整框架需要 ANTHROPIC_API_KEY 與 MAPBOX_TOKEN,這些是會產生費用的第三方憑證,應放在環境變數或 .env 檔案中,不要寫入共用檔案。README 提到已棄用的備援權杖檔案 claude_api.txt 與 mapbox_token.txt。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 AgentSUMO,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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]

Web interface: conversational planning panel, scenario list, and live simulation status.



[Geospatial visualization]

Geospatial visualization: per-edge metrics, congestion overlays, and trip replay on the 2.5D basemap.

Architecture

User (natural language)    |    vPlanner Agent (Claude LLM, Interactive Planning Protocol)    |    +--> AgentSUMO MCP Client --> AgentSUMO MCP Server (PyPI: agentsumo-mcp) --> SUMO    |    +--> SQLite MCP Client    --> SQLite MCP Server (Anthropic, open source)  --> simulations.db    |    +--> Filesystem MCP Client --> Filesystem MCP Server (Anthropic, open source) --> additional XML files

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.

CategoryPurposeRepresentative tools
Scenario GenerationBuild a baseline SUMO simulation: OSM → network → trips → routes → runosm_extract, net_convert, trip_generate, route_generate, sumo_runner
Policy ExperimentationApply infrastructure, demand, and signal-control interventionsedge_edit_tool, reduce_lanes_tool, vehicle_generation_tool, flow_generation_tool, tls_offset_tool, tls_adaptation_tool
Result AnalysisConvert SUMO XML output to SQLite and render HTML reportsxml_to_sqlite_tool, simulation_report_tool
VisualizationRender networks, highlighted edges, and per-edge metric heatmapsvisualize_net_tool, visualize_edge_tool, visualize_policy_target_tool, visualize_edgedata_tool
Utility FunctionsNetwork statistics, routing, road-name ↔ edge-id resolution, OD-coordinate validation, web-search groundingnetwork_summary_tool, route_analysis_tool, validate_od_coordinates_tool, web_search_tool

Installation

Requirements

  • Python 3.10 or later
  • SUMO 1.24 or later (locally installed, with SUMO_HOME set)
  • Anthropic Claude API key (bring-your-own-key)
  • Mapbox access token (used by the web map renderer)

1. Install SUMO

macOS

bash
brew install sumo

Or download the installer from the Eclipse SUMO downloads page.

Windows — Download the installer from the Eclipse SUMO downloads page.

Linux (Ubuntu/Debian)

bash
sudo add-apt-repository ppa:sumo/stablesudo apt-get updatesudo apt-get install sumo sumo-tools sumo-doc

2. Set up the Python environment

Install uv:

bash
# macOS / Linuxcurl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Clone the repository, create a virtual environment, and install AgentSUMO:

bash
git clone https://github.com/mw-jeong/AgentSUMOcd AgentSUMO
# Create a Python 3.12 venvuv venv --python 3.12
# Activate the venvsource .venv/bin/activate              # macOS / Linux# .venv\Scripts\activate               # Windows
# Install AgentSUMO and all dependencies# (this also pulls agentsumo-mcp from PyPI as a dependency)uv pip install -e .

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:

bash
cp .env.example .env

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.

ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

MAPBOX_TOKEN (required for the web UI) — used to render the basemap. Get one at the Mapbox access tokens page.

MAPBOX_TOKEN=pk.eyJ1Ijoixxxxxxxxxxxxxxxxxx

SUMO_HOME (required) — absolute path to your local SUMO installation. The directory must contain bin/sumo (or bin/sumo.exe on Windows).

# macOS (Homebrew)SUMO_HOME=/opt/homebrew/share/sumo
# macOS (Eclipse SUMO installer)SUMO_HOME=/Library/Frameworks/EclipseSUMO.framework/Versions/<version>/EclipseSUMO  # e.g. 1.24.0; use the directory name installed under Versions/
# WindowsSUMO_HOME=C:\Program Files (x86)\Eclipse\Sumo
# LinuxSUMO_HOME=/usr/share/sumo

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.

AGENTSUMO_MCP_OUTPUT_BASE=/path/to/your/output/dir

4. Run

bash
# Web interface (opens at http://localhost:8000)python web.py
# CLI modepython chat.py
# Clean up simulation outputspython clean.py

Project Structure

AgentSUMO/├── agentsumo/│   ├── agent/        # Planner Agent (Claude orchestrator + prompts)│   ├── client/       # MCP clients (AgentSUMO, SQLite, Filesystem)│   └── core/         # Configuration├── agentsumo_mcp/    # AgentSUMO MCP Server source (also published to PyPI)│   └── defaults/     # Packaged fixtures (e.g., vehicle_types.add.xml)├── packaging/mcp/    # PyPI build configuration for agentsumo-mcp├── web/              # Web interface (FastAPI + Jinja2 templates)├── docs/             # Sphinx documentation source├── tests/            # Unit tests├── assets/           # README images├── output/           # Runtime artifacts (auto-populated; 8 categories tracked│                     #   via .gitkeep — simulations/, networks/, trips/,│                     #   analysis/, reports/, uploads/, visualizations/, additional/)├── chat.py           # CLI entry point├── web.py            # Web server entry point└── .env.example      # Environment variable template

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):

bash
pip install agentsumo-mcp

Or via uvx without installing:

bash
uvx agentsumo-mcp

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:

bash
uv pip install -e . --upgrade

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.db ER diagram and column reference
  • Tutorials — walkthroughs of the paper case studies

Citation

If you use AgentSUMO in academic work, please cite:

bibtex
@article{jeong2025agentsumo,  title         = {AgentSUMO: An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Models},  author        = {Jeong, Minwoo and Chang, Jeeyun and Yoon, Yoonjin},  journal       = {arXiv preprint arXiv:2511.06804},  year          = {2025},  url           = {https://arxiv.org/abs/2511.06804}}

License

MIT. See LICENSE.


Developed at

[KAIST]      [CAUS]      [Spatial Tech Innovation Lab]

來源:README.md,提交 2ad1d91

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分