Metadata-Version: 2.4
Name: agentsumo-mcp
Version: 0.1.3
Summary: MCP server for SUMO traffic simulation: orchestrate networks, trips, simulations, and analysis from LLM agents.
Author: Minwoo Jeong, Jeeyun Chang, Yoonjin Yoon
License-Expression: MIT
Project-URL: Homepage, https://github.com/mw-jeong/AgentSUMO
Project-URL: Documentation, https://agentsumo.readthedocs.io
Project-URL: Repository, https://github.com/mw-jeong/AgentSUMO
Project-URL: Issues, https://github.com/mw-jeong/AgentSUMO/issues
Keywords: mcp,sumo,traffic-simulation,llm,agent,anthropic
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp[cli]<2,>=1.13.1
Requires-Dist: sumolib>=1.24.0
Requires-Dist: traci>=1.24.0
Requires-Dist: geopy>=2.4.1
Requires-Dist: geopandas<0.15.0,>=0.14.3
Requires-Dist: pandas>=2.3.2
Requires-Dist: shapely>=2.1.1
Requires-Dist: pyproj>=3.6.0
Requires-Dist: lxml>=5.0.0
Requires-Dist: matplotlib>=3.7
Requires-Dist: ddgs>=9.0.0
Dynamic: license-file

<!-- mcp-name: io.github.mw-jeong/agentsumo-mcp -->

# agentsumo-mcp

[![PyPI](https://img.shields.io/pypi/v/agentsumo-mcp.svg)](https://pypi.org/project/agentsumo-mcp/)
[![arXiv](https://img.shields.io/badge/arXiv-2511.06804-b31b1b.svg)](https://arxiv.org/abs/2511.06804)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

MCP server for [SUMO](https://eclipse.dev/sumo/) (Simulation of Urban MObility) traffic simulation. Orchestrate network extraction, trip generation, scenario customization, simulation runs, and SQL-based result analysis from any MCP-compatible LLM client.

## Features

- **Pipeline tools**: OSM extraction -> network conversion -> trip generation -> route generation -> simulation
- **Scenario customization**: edge editing, lane reduction, speed limit changes, vehicle generation, traffic-light timing
- **Result analysis**: ingest tripinfo / edgedata / summary XML into SQLite for natural-language SQL queries
- **Visualization**: network plots, edge data heatmaps, policy-target visualizations
- **Geocoding**: place name -> coordinate -> nearest edge resolution
- **Bundled defaults**: ships a default `vehicle_types.add.xml` (passenger / electric / gasoline) that is auto-seeded into the simulation directory on the first `sumo_runner` call, so the SUMO additional-file dependency works without any manual setup

## Requirements

- Python 3.10 or later
- [SUMO](https://eclipse.dev/sumo/) installed locally (`SUMO_HOME` environment variable set)

## Installation

```bash
pip install agentsumo-mcp
```

Or run without installing via [`uvx`](https://docs.astral.sh/uv/guides/tools/):

```bash
uvx agentsumo-mcp
```

## Configuration

Set `SUMO_HOME` to point at your local SUMO installation:

```bash
export SUMO_HOME=/path/to/sumo
```

On macOS with the official SUMO installer this is usually `/Library/Frameworks/EclipseSUMO.framework/Versions/<version>/EclipseSUMO`.

## Usage with Claude Desktop

This package exposes the **MCP tool layer** (Section 3.3 of the paper). The
Planner Agent and the Interactive Planning Protocol described in Section 3.2
are part of the AgentSUMO framework
([github.com/mw-jeong/AgentSUMO](https://github.com/mw-jeong/AgentSUMO))
and are not bundled here. To reproduce the manuscript's case studies end to
end, clone the repository and run `python web.py`; the standalone snippet
below is the right starting point for using the SUMO tool surface from a
different MCP client.

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "agentsumo": {
      "command": "uvx",
      "args": ["agentsumo-mcp"],
      "env": {
        "SUMO_HOME": "/path/to/sumo"
      }
    }
  }
}
```

## Usage with other MCP clients

Any MCP client that supports stdio transport works:

```bash
agentsumo-mcp
```

## Tools

The server exposes 26 tools across five categories (aligned with Table 3 of the paper):

| Category | Examples |
|----------|----------|
| Scenario Generation | `osm_extract`, `net_convert`, `trip_generate`, `route_generate`, `sumo_runner` |
| Policy Experimentation | `edge_edit_tool`, `reduce_lanes_tool`, `speed_limit_edit_tool`, `vehicle_generation_tool`, `flow_generation_tool`, `tls_offset_tool`, `tls_adaptation_tool` |
| Result Analysis | `xml_to_sqlite_tool`, `simulation_report_tool` |
| Visualization | `visualize_net_tool`, `visualize_edge_tool`, `visualize_policy_target_tool`, `visualize_edgedata_tool` |
| Utility Functions | `network_summary_tool`, `route_analysis_tool`, `analyze_road_details_tool`, `get_road_names_tool`, `validate_od_coordinates_tool`, `web_search_tool` |

Each tool returns structured JSON suitable for downstream LLM reasoning.

## 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](LICENSE).
