Spaces:
Runtime error
Runtime error
| 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. |