SkillAgentSearch skills...

openswmm.mcp

An MCP server for the OpenSWMM engine

Install / Use

claude mcp add HydroCouple -- npx -y github:HydroCouple/openswmm.mcp

If the server publishes to npm under a different name, use that package instead — check the repo README.

About this skill
🔌

MCP Server

Model Context Protocol server

Quality Score

76/100

Supported Platforms

Claude Code
Claude Desktop

Tags

Our assessment of openswmm.mcp

openswmm.mcp scores 76/100 on our quality scale, 3757th of 4,708 Development & Engineering skills we index.

Its MCP Server is 13 KB long, well organised into 25 sections with 13 code examples: a thorough specification that gives an agent plenty to work with.

It has 3 GitHub stars, so there is little community track record yet; judge it on its content.

Substance
30/30
Structure
20/20
Description
8/15
Adoption
3/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 3 days ago, so openswmm.mcp is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 87/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

openswmm.mcp compared with similar skills

All 4 of these similar skills score higher than openswmm.mcp; compare them before choosing.

SkillScoreStarsUpdatedFormat
openswmm.mcp (this skill)by HydroCouple7633d agoMCP Server
taste-skillby Leonxlnx100121.0ktodayCLAUDE.md
Agent-Reachby Panniantong100114.5ktodayCLAUDE.md
hyperframesby heygen-com10089.4ktodayCLAUDE.md
rufloby ruvnet10082.4ktodayCLAUDE.md

Frequently asked questions

How do I install openswmm.mcp?
Run claude mcp add HydroCouple -- npx -y github:HydroCouple/openswmm.mcp. The install tabs above show the steps for each supported agent.
Which AI agents does openswmm.mcp work with?
It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
Is openswmm.mcp safe to use?
It is Apache-2.0-licensed and scores 87/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is openswmm.mcp still maintained?
The repository was last updated 3 days ago, so openswmm.mcp is actively maintained.
<p align="center"> <img src="images/hydrocouplecomposer.png" alt="OpenSWMM MCP" width="120"> </p>

openswmm-mcp

PyPI Python CI Docs License

Overview

openswmm-mcp is a Model Context Protocol (MCP) server that wraps the OpenSWMM stormwater engine (v6.0), built with FastMCP 3.x. It enables LLM clients -- such as Claude, ChatGPT, or any MCP-compatible agent -- to interact with the full SWMM simulation lifecycle through natural language:

  • Build SWMM models programmatically from scratch
  • Run simulations with progress reporting
  • Query nodes, links, subcatchments, and gages in real time
  • Apply runtime forcing overrides and control rules for what-if scenarios
  • Analyze flooding, pipe capacity, mass balance, and time-series output
  • Branch simulations via hot-start save/load and session cloning
  • Export results to CSV or JSON for downstream analysis

Features

The server exposes 15 core tools. Operators can enable the gym (5 tools), platform (8 tools) and ledger (3 tools) independently, plus run_python over stdio.

Six generic tools (describe, find, get, set, inspect, call) reach every property and method of the engine through its machine-readable catalog (openswmm.engine.catalog). New engine capabilities reach the server without new tool code.

  • Sessions and runs -- open_model, run, session, save
  • Catalog access -- describe, find, get, set, inspect (methods that only read), call (methods that change something), edit
  • Results -- timeseries, report, compare, export
  • Gym (OPENSWMM_MCP_TOOLSETS=core,gym) -- gym_describe, gym_config, gym_env, gym_job, gym_score
  • Platform (OPENSWMM_MCP_TOOLSETS=core,platform) -- platform_targets, platform_session, platform_model, platform_estimate, platform_run, platform_job, platform_results, platform_finding: submit runs to hydrocouple.platform under an agent session's budget, read their results provenance first, and record an answer whose every number is checked against the run summary
  • Ledger (OPENSWMM_MCP_TOOLSETS=core,ledger) -- tally commits a finished run's facts to a salted hash tree and checks narratives claim by claim; sources and locate record and query the files a model was built from and what they say about each element

Ledger limitation (SI models): tally commits the system volume facts (total_flooding, total_outflow) only after checking their unit against the .rpt "Flow Routing Continuity" block. That check has been tested on US-unit models only. It still needs an SI test model; until one is added, SI models may have these two facts listed under dropped instead of committed.

See the tools guide for details and the v1-to-v2 mapping.

Additional Capabilities

  • Resources for the engine catalog (swmm://catalog, swmm://catalog/{target}), sessions and bundled skills
  • Workflow prompts and bundled skills for capacity assessment, calibration, operational optimisation, verified narratives and model provenance
  • OAuth/JWT authentication for HTTP transport via fastmcp[auth]
  • Progress reporting for long runs and multi-session management

Installation

pip install openswmm-mcp

Authentication support is included by default through the fastmcp[auth] dependency. To install with development and documentation extras:

pip install "openswmm-mcp[dev,docs]"

The gym tools need the gym extra (pip install "openswmm-mcp[gym]") and OPENSWMM_MCP_TOOLSETS=core,gym.

Spatial queries for the ledger (locate with a point or buffer, sources with rule="nearest") need the ledger extra: pip install 'openswmm.mcp[ledger]'. Use it with OPENSWMM_MCP_TOOLSETS=core,ledger.

Requirements

  • Python 3.10+
  • openswmm >= 6.0.0a4.dev1 built with openswmm.engine.catalog (the OpenSWMM engine Python bindings)
  • fastmcp >= 3.2, < 4
  • pydantic >= 2.0
  • numpy >= 1.21

Quick Start

With Claude Code

Add the following to your MCP configuration (e.g. ~/.claude/settings.json or .mcp.json):

{
  "mcpServers": {
    "openswmm": {
      "command": "python",
      "args": ["-m", "openswmm_mcp"],
      "env": {
        "OPENSWMM_MCP_WORKING_DIR": "/path/to/models"
      }
    }
  }
}

With Claude Desktop

Add the server to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\), using the full path of the Python environment where the server is installed:

{
  "mcpServers": {
    "openswmm": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "openswmm_mcp"],
      "env": {
        "OPENSWMM_MCP_WORKING_DIR": "/path/to/models"
      }
    }
  }
}

With uv

{
  "mcpServers": {
    "openswmm": {
      "command": "uv",
      "args": ["run", "--with", "openswmm.mcp", "openswmm.mcp"]
    }
  }
}

Example Conversation

User:  Open the model at /data/site_drainage.inp and run the simulation.

Claude: [open_model] 12 nodes, 11 links, 7 subcatchments, CFS units, DYNWAVE routing.
        [run] Finished: 3,164 steps, routing continuity error 0.02 %.

User:  Which nodes flooded?

Claude: [report(name="flooding")] 6 nodes flooded; J10 worst: 231,937 ft3 over 29 min.

User:  What if we upsize C10, the conduit leaving J10, to 3 ft?

Claude: [open_model(session_id="upsize")]
        [set(kind="link.xsect", changes=[{"id": "C10", "field": "g1", "value": 3.0}])]
        [run] [compare(a="default", b="upsize", kind="node", variable="depth")]
        Reports the change in peak depth and flood volume at each node.

Available Resources

| URI | Contents | |-----|----------| | swmm://catalog | Every engine target with its class and description | | swmm://catalog/{target} | Fields and methods of one target | | swmm://sessions | Open sessions | | swmm://session/{id}/summary | Counts, options, time window and files of one session | | swmm://skills, swmm://skills/{name} | Bundled skills |

Available Prompts

| Prompt | Description | Parameters | |--------|-------------|------------| | analyze_model | Comprehensive model review and assessment | inp_path | | diagnose_flooding | Investigate flooding causes and suggest mitigations | session_id, node_ids (optional, comma-separated) | | compare_scenarios | Side-by-side comparison of two simulation sessions | session_a, session_b | | design_review | Check model against design standards | session_id, standard (optional) | | what_if | Set up and evaluate a what-if scenario | session_id, description | | build_simple_model | Guided construction of a model from a text description | description | | explain_results | Plain-language result explanation for stakeholders | session_id | | use_skill | Load a bundled skill's instructions | skill_name |

Configuration

All settings are controlled via environment variables with the OPENSWMM_MCP_ prefix:

| Environment Variable | Default | Description | |----------------------|---------|-------------| | OPENSWMM_MCP_WORKING_DIR | "./" | Base directory for model files and session data | | OPENSWMM_MCP_MAX_SESSIONS | 5 | Maximum number of concurrent simulation sessions | | OPENSWMM_MCP_TRANSPORT | "stdio" | Transport protocol: stdio, http, or sse | | OPENSWMM_MCP_HTTP_PORT | 8080 | Port for HTTP/SSE transport | | OPENSWMM_MCP_LOG_LEVEL | "INFO" | Logging level (DEBUG, INFO, WARNING, ERROR) | | OPENSWMM_MCP_TOOLSETS | "core" | Tool sets to register: core, core,gym for the gym tools, or core,ledger for the tally, sources and locate tools (combinable: core,gym,ledger) | | OPENSWMM_MCP_ENABLE_PYTHON | false | Register run_python (stdio transport only; runs code with the server's permissions) | | OPENSWMM_MCP_OAUTH_ISSUER | None | OAuth issuer URL for JWT validation | | OPENSWMM_MCP_OAUTH_AUDIENCE | None | Expected OAuth audience claim | | OPENSWMM_MCP_JWT_JWKS_URL | None | JWKS endpoint URL for JWT signature verification |

HTTP Transport with Authentication

To run the server over HTTP with OAuth/JWT authentication:

OPENSWMM_MCP_TRANSPORT=http \
OPENSWMM_MCP_HTTP_PORT=8000 \
OPENSWMM_MCP_OAUTH_ISSUER=https://auth.example.com \
OPENSWMM_MCP_OAUTH_AUDIENCE=openswmm-mcp \
OPENSWMM_MCP_JWT_JWKS_URL=https://auth.example.com/.well-known/jwks.json \
python -m openswmm_mcp

For unauthenticated HTTP (development only):

OPENSWMM_MCP_TRANSPORT=http OPENSWMM_MCP_HTTP_PORT=8000 python -m openswmm_mcp

Development

Setup

git clone https://github.com/HydroCouple/openswmm.mcp.git
cd openswmm.mcp
pip install -e ".[dev,docs]"

Running Tests

pytest tests/unit/ -v                        # requires the compiled engine
pytest tests/unit/ --cov=openswmm_mcp         # with coverage

Linting

ruff check src/ tests/
ruff format src/ tests/

Building Docs

For a docs-only environment, install the documentation requirements and the package without its runtime dependencies. Sphinx uses import mocks for the engine and optional integrations.

python -m pip install -r docs/requirements.txt
python -m pip install --no-deps -e .
sphinx-build -b html -W --keep-going docs docs/_build/html

The documentation site uses PyData Sphinx Theme with MyST Parser for Markdown support.

Architecture

                          MCP Client (Claude, etc.)
                                    |
                              MCP Protocol
                                    |
                        +-----------+-----------+
                        |  FastMCP Root Server  |
                        |  (openswmm-mcp)       |
                        +-----------+-----------+
                                    |
          +-------+-------+--------+--------+---------+-------+--------+--------+
          |       |       |        |        |         |       |        |        |
     lifecycle  query  forcing  analysis  building editing hotstart spatial
       (mcp)   (mcp)   (mcp)    (mcp)     (mcp)    (mcp)   (mcp)    (mcp)
          |       |       |        |        |         |       |        |        |
          +-------+-------+--------+--------+---------+-------+--------+--------+
                                    |
                           SessionManager
                          /      |       \
                     Session  Session  Session ...
                        |
               +--------+--------+
               |        |        |
            Solver   Nodes    Links   ...
               |
         openswmm.engine (C++ bindings)

Each tool namespace is a separate FastMCP sub-server, mounted on the root server with a namespace prefix. The SessionManager manages concurrent simulation sessions, each wrapping an openswmm.engine.Solver instance and its associated domain accessors (nodes, links, subcatchments, gages, pollutants, mass balance, statistics, forcing, controls, spatial, quality, hot-start, and infrastructure).

Resources and prompts are mounted without a namespace prefix to keep their URIs concise.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on the development workflow, code style, and how to submit pull requests.

Thi

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars3
CategoryDevelopment
Updated3d ago
Forks5

Trust signals

87/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

2 low