Spaces:
Runtime error
Runtime error
File size: 6,571 Bytes
f8f8f2a bbfaf74 f8f8f2a a89400b f8f8f2a 7857730 9e274f7 7857730 f6f6c62 7857730 f8f8f2a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | ---
sdk: docker
emoji: π
colorFrom: red
colorTo: green
sdk_version: 6.22.0
---
# PCSWMM Engineering MCP β Rev1
---
title: PCSWMM Engineering Optimizer
emoji: π§οΈ
colorFrom: blue
colorTo: green
sdk: gradio
app_file: app.py
pinned: false
tags:
- mcp-server
- civil-engineering
- stormwater
- optimization
---
A local-first engineering copilot and Calgary SWMR service for consultants who use **PCSWMM**.
This package is a product-specific derivative of `SWMM6 Report Engineering Automation Rev31`. It is **not** the universal uploaded-INP product. Its public MCP tool surface begins with the active PCSWMM Engineering SDK package.
## Product boundary
| Product | Intended user | Public starting point |
|---|---|---|
| SWMM6 Report MCP | Consultant without PCSWMM | Upload an EPA SWMM `.inp` |
| PCSWMM Engineering MCP | Consultant working in PCSWMM | Connect the active PCSWMM SDK package |
The independent SWMM execution engine is retained internally for verification, reconciliation, and auditability. Generic standalone model upload is intentionally not exposed as an MCP tool.
## Architecture
```text
Active PCSWMM project
β
β PCSWMM Engineering SDK package
βΌ
PCSWMM Engineering MCP (localhost)
βββ validate active project identity
βββ independently execute exact INP
βββ reconcile PCSWMM and worker evidence
βββ deterministic QA/QC
βββ Calgary screening
βββ baseline/revision impact review
βββ City comment response matrix
βββ SWMR DOCX + audit ZIP
```
## Start locally
### Windows
```bat
start_pcswmm_mcp.bat
```
### PowerShell
```powershell
.\start_pcswmm_mcp.ps1
```
Default endpoint:
```text
http://127.0.0.1:8765/mcp
```
Health check:
```text
http://127.0.0.1:8765/health
```
The default binding is localhost only. Do not expose this service directly to the internet.
## Required first tool
```text
connect_active_pcswmm_project
```
The package should contain:
- PCSWMM project name and exact model filename;
- active scenario and result context;
- PCSWMM SDK version;
- exact INP text for independent verification;
- object inventory and unit metadata;
- deterministic PCSWMM findings;
- baseline and revised snapshots when applicable;
- revision comparison and impact assessment;
- source-model SHA-256 when available.
## Public MCP tools
### Connection and verification
- `connect_active_pcswmm_project`
- `validate_active_pcswmm_project`
- `get_active_pcswmm_project`
- `run_independent_pcswmm_verification`
- `review_active_pcswmm_model`
### Results
- `get_pcswmm_node_results`
- `get_pcswmm_link_results`
- `get_pcswmm_subcatchment_results`
- `get_pcswmm_timeseries`
### Revision and submissions
- `review_pcswmm_revision`
- `configure_pcswmm_submission`
- `set_pcswmm_city_comments`
- `build_pcswmm_city_response_matrix`
- `get_pcswmm_submission_readiness`
### Reporting
- `set_pcswmm_report_details`
- `set_pcswmm_report_configuration`
- `attach_pcswmm_figure`
- `generate_pcswmm_swmr`
### Session control
- `list_pcswmm_sessions`
- `close_pcswmm_session`
## First-submission workflow
```text
connect_active_pcswmm_project(auto_verify=false)
β review_active_pcswmm_model
β configure_pcswmm_submission(first_submission)
β set_pcswmm_report_details
β get_pcswmm_submission_readiness
β generate_pcswmm_swmr
```
## Revised-submission workflow
```text
PCSWMM baseline/revised snapshots and impact assessment
β connect_active_pcswmm_project(revised_submission)
β review_pcswmm_revision
β set_pcswmm_city_comments
β build_pcswmm_city_response_matrix
β review_active_pcswmm_model
β get_pcswmm_submission_readiness
β generate_pcswmm_swmr
```
## Engineering control philosophy
1. PCSWMM is the live design workspace and primary source of design context.
2. The local worker independently executes the exact INP for verification.
3. PCSWMM and worker values are kept as separate evidence until reconciled.
4. AI is optional and may explain deterministic findings; it does not calculate hydraulics.
5. Reports remain engineer-review drafts until professionally authenticated.
## Included skills
- `analyze-pcswmm-models` β primary PCSWMM MCP orchestration skill.
- `review-calgary-2011-stormwater` β Calgary evidence and criteria review.
The generic `automate-swmm-modeling` skill is not active in this product release because Rev1 is read-only with respect to the live PCSWMM model. Live design editing should be introduced only with explicit approval, rollback, and revision-snapshot controls.
## Rev1.5 native PCSWMM mode
PCSWMM is the required simulation backend. OpenSWMM verification is optional and disabled by default. First/model-only submissions do not require revision evidence. A PCSWMM-native SWMR draft and audit ZIP can be generated without OpenSWMM; when optional verification results exist, the full reconciled report engine is used.
## Rev1.8 deterministic evidence-folder bridge
The existing MCP can now consume the local evidence package written by the PCSWMM-native extraction SDK. No new report engine or parallel workflow is introduced.
New tools:
- `connect_deterministic_calgary_evidence`
- `generate_calgary_swmr_from_evidence`
One-command local workflow:
```text
Engineer runs PCSWMM
β native SDK writes evidence/<project_timestamp>/
β generate_calgary_swmr_from_evidence(evidence_dir=...)
β existing deterministic review
β existing Calgary SWMR DOCX + audit ZIP
```
Example MCP request:
```json
{
"evidence_dir": "C:\\Users\\razaa\\MCP\\PCSWMM_SWMR\\evidence\\Valleyfield_to-be_dual_system_20260804T151411Z",
"project_name": "Valleyfield To-Be Dual System",
"client": "",
"consultant": "",
"prepared_by": "",
"submission_type": "model_only_review",
"include_model_appendix": true
}
```
The bridge imports the normalized evidence, hashes, selected tables, result catalog, missing-information register, agentic findings, and selected primary figures. It does not rerun or modify the PCSWMM model.
## Rev1.9 β PySWMM backend
The existing PCSWMM-engineering MCP now accepts deterministic evidence generated by
the independent PySWMM Calgary SWMR Evidence App. No duplicate MCP server or report
engine is introduced. Use either:
- `connect_pyswmm_calgary_evidence`, then the normal review/readiness/report tools; or
- `generate_calgary_swmr_from_pyswmm_evidence` for the one-command draft workflow.
The generic `connect_deterministic_calgary_evidence` tool remains supported. |