Content
# Midas Bridge MCP
> 🌉 AI-driven Bridge Structural Analysis — Claude Directly Operates Midas Civil NX
[](https://www.python.org/)
[](https://modelcontextprotocol.io/)
[](LICENSE)
## What is This
A **Model Context Protocol (MCP) Server**, connecting Claude and Midas Civil NX.
Claude becomes a bridge engineer who can directly model, load, and analyze—you describe the structure in natural language, and Claude automatically executes it in Civil NX.
```
You: "Create a 4m box girder, with 3 circular holes in the web, Q345 steel, one end hinged and one end sliding, apply self-weight and live load"
↓
Claude + Midas Civil MCP
↓
Midas Civil NX automatically models → analyzes → generates calculation report
```
## Quick Start
### 1. Installation
```bash
git clone https://github.com/WWWeiZhang/midas-bridge-mcp.git
cd midas-bridge-mcp
pip install -e .
```
### 2. Configuration
Copy the environment variable template and fill in your Midas Civil NX connection information:
```bash
cp .env.example .env
# Edit .env, fill in your MIDAS_BASE_URL and MIDAS_MAPI_KEY
```
### 3. Launch
```bash
python -m midas_mcp.server
```
Or configure in Claude Code's `.mcp.json` (refer to `.mcp.json.example`).
### 4. Enable API in Civil NX
Civil NX → **Settings** → **MAPI-Key** → Generate a Key, fill in `.env`.
## Capability Overview
| Module | Supported Operations |
|------|-----------|
| **Modeling** | Node, Beam/Truss/Cable/Plate/Wall/Solid/Compressed Unit |
| **Material** | Steel (database + custom), Concrete |
| **Section** | Standard Steel, Rectangle, Variable Section, Steel-Concrete Composite Section |
| **Boundary** | Support (fix/pin/roller), Rigid Connection (master-slave), Elastic Connection (including support spring) |
| **Load** | Self-weight, Node Force/Bending Moment, Uniform Beam Load, Moving Load (CHINA/AASHTO, etc.) |
| **Combination** | Load Combination (including concrete/steel classification) |
| **Group** | Structural Group, Boundary Group, Load Group (idempotent addition) |
| **Construction Stage** | Stage Definition, Combined Section, Creep Coefficient, Time Load, Pre-arch |
| **Cable** | Cable Properties, Cable Layout, Prestress Tensioning |
| **Analysis** | Static Analysis, Eigenvalue, Buckling, Pushover, P-Delta, Nonlinear |
| **Result** | Node Displacement, Support Reaction, Beam Internal Force |
## Architecture
```text
tools/ ← MCP Tool Layer: @mcp.tool() packaging, docstring is Claude's "manual"
domain/ ← Business Logic Layer: Python functions encapsulate Midas JSON
core/ ← Connection Layer: HTTP + MAPI-Key authentication
```
Layering Iron Law: `tools` does not directly send HTTP, `domain` does not know MCP protocol, `core` does not include business judgment.
## Project Structure
```text
midas-bridge-mcp/
├── src/midas_mcp/
│ ├── server.py # MCP Entrance
│ ├── core/ # HTTP Client + Configuration
│ ├── domain/ # Business Logic (15 modules)
│ └── tools/ # MCP Tools (15 modules, ~70 tools)
├── pyproject.toml
├── .env.example # Environment Variable Template
└── .mcp.json.example # MCP Configuration Template
```
## License
MIT