Skip to content

Repository files navigation

structural-analysis-mcp

An MCP server that exposes structural analysis calculations to AI agents using established open-source Python engineering libraries.

This project is an early-stage Model Context Protocol server for basic structural engineering calculations. The MVP focuses on deterministic, unit-explicit tools for section properties, gross concrete section summaries, and a simple beam under uniformly distributed load.

It uses these libraries as dependencies and integration targets:

  • sectionproperties
  • concreteproperties
  • PyniteFEA / PyNite

It does not fork those projects.

Safety Disclaimer

This is an analysis and educational tool, not a certified design tool.

Outputs must be checked by a competent engineer before use. The server does not replace professional judgement, project-specific review, or independent verification. It does not currently perform code checks to Australian Standards, Eurocodes, ACI, AISC, or any other design standard. Code compliance checks are future roadmap items only.

Supported MCP Tools

calculate_rectangle_section_properties

Calculates gross geometric properties for a solid rectangular section.

Inputs:

  • width_mm
  • depth_mm

Outputs:

  • area_mm2
  • centroid_x_mm
  • centroid_y_mm
  • ixx_mm4
  • iyy_mm4
  • j_mm4
  • notes

Example tool call:

{
  "name": "calculate_rectangle_section_properties",
  "arguments": {
    "width_mm": 300,
    "depth_mm": 600
  }
}

calculate_rectangular_concrete_section_summary

Calculates a gross rectangular concrete section summary. This does not include reinforcement, cracking, capacity, interaction diagrams, or design-standard checks.

Inputs:

  • width_mm
  • depth_mm
  • concrete_strength_mpa

Outputs:

  • gross_area_mm2
  • centroid_x_mm
  • centroid_y_mm
  • gross_ixx_mm4
  • gross_iyy_mm4
  • notes

Example tool call:

{
  "name": "calculate_rectangular_concrete_section_summary",
  "arguments": {
    "width_mm": 300,
    "depth_mm": 600,
    "concrete_strength_mpa": 32
  }
}

analyse_simple_beam_udl

Analyses a simply supported beam with a vertical uniformly distributed load over the full span.

Assumptions:

  • Simply supported beam.
  • Vertical UDL over full span.
  • Linear elastic analysis.
  • No self-weight unless included in udl_kn_per_m.
  • No load combinations, shear deformation, lateral effects, or code checks.

Inputs:

  • span_m
  • udl_kn_per_m
  • elastic_modulus_mpa
  • ixx_mm4

Outputs:

  • reaction_left_kn
  • reaction_right_kn
  • max_shear_kn
  • max_moment_knm
  • max_deflection_mm
  • notes

Example tool call:

{
  "name": "analyse_simple_beam_udl",
  "arguments": {
    "span_m": 6.0,
    "udl_kn_per_m": 12.0,
    "elastic_modulus_mpa": 200000,
    "ixx_mm4": 85000000
  }
}

Installation

Prerequisites:

  • Python 3.11 or newer.
  • A Python environment capable of installing sectionproperties, concreteproperties, PyniteFEA, and mcp.

Install from a local checkout:

git clone https://github.com/Elandu/structural-analysis-mcp.git
cd structural-analysis-mcp
python -m venv .venv
.\.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

On macOS or Linux, activate the environment with:

source .venv/bin/activate

Local Development

Run tests:

pytest

Run linting:

ruff check .

Run formatting:

ruff format .

Run the MCP server locally over stdio:

structural-analysis-mcp

Equivalent module form:

python -m structural_analysis_mcp

Example MCP Configuration

Example client configuration:

{
  "mcpServers": {
    "structural-analysis": {
      "command": "structural-analysis-mcp",
      "args": []
    }
  }
}

For a local editable checkout where the console script is not on PATH, use the Python module:

{
  "mcpServers": {
    "structural-analysis": {
      "command": "python",
      "args": ["-m", "structural_analysis_mcp"]
    }
  }
}

Examples

Limitations

  • Early-stage MVP.
  • Gross section properties only for the first section tools.
  • No certified design checks.
  • No Australian Standards, Eurocode, ACI, or AISC compliance checks.
  • No load combinations.
  • No reinforced concrete interaction diagrams yet.
  • No steel section database yet.
  • No unit conversion system yet; inputs must use the units named in each field.
  • No external APIs are called.

Roadmap

See ROADMAP.md. Planned work includes additional section geometry tools, steel section support, reinforced concrete interaction diagrams, 2D frame analysis, load combinations, unit handling, result diagrams, report-ready output, validation examples against published references, and optional Australian Standards examples.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening an issue or pull request.

Good first contributions include:

  • More validation examples.
  • More section geometry tools.
  • Better unit handling.
  • Tests for edge cases and invalid inputs.
  • Documentation for MCP client setup.

License

MIT. See LICENSE.

About

MCP server exposing structural analysis calculations to AI agents using open-source Python engineering libraries.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages