beam-analysis
The beam-analysis server is a lightweight MCP server for linear-static structural analysis of 3D beam and truss models — bridges and building frames — enabling you to build, analyze, visualize, and export structural models.
Environment Check: Verify availability of the built-in solver, CalculiX (ccx), and FreeCAD (freecadcmd) on the host machine.
Model Management: Create, list, inspect (counts, materials, sections, loads, bounding box), and delete models within the session.
Manual Model Building (step-by-step):
Add nodes (3D coordinates)
Add materials (Young's modulus, Poisson ratio, density, yield strength)
Add cross-sections (rectangle, box, pipe, circle, I-section, or generic)
Add members (
beamfor 6-DOF frame elements ortrussfor axial-only)Add supports (
fixed,pinned,roller, custom 6-flag, etc.)Add loads (nodal forces/moments, member UDLs in global or local axes, self-weight)
Parametric Generation: Instantly generate complete structures from presets — girder/truss/arch/cable-stayed bridges, portal frames, multi-story moment/braced frames, and roof trusses — with customizable parameters.
Structural Analysis:
Built-in direct-stiffness
beamsolver (fast, Euler-Bernoulli, pure JS)External
calculixFEM solver (B32R beam elements)Run
bothsimultaneously for cross-validationRetrieve nodal displacements, support reactions, member force envelopes (N, V, M, T), stresses, and utilization ratios (σ/fy)
Visualization: Render SVG figures showing geometry, deformed shape, and force/moment/stress diagrams.
Export: Export solid 3D models to FreeCAD (.FCStd) or write CalculiX input decks (.inp) without solving.
Export structural analysis models as solid 3D FreeCAD documents (.FCStd) that can be opened and inspected in FreeCAD.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@beam-analysis Generate a 3-span girder bridge and run analysis with both engines."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
beam-analysis-mcp
A lightweight MCP (Model Context Protocol) server for linear-static structural analysis of bridges and building frames, written in Node.js with no heavy dependencies.
It gives an AI client (Claude Desktop, Claude Code, Cursor, ...) tools to:
Build 3D beam/truss models (nodes, members, sections, materials, supports, loads) or generate complete structures from parametric typology presets (girder bridges, Pratt/Howe/Warren truss bridges, arch bridges, cable-stayed bridges, portal frames, moment frames, 3D braced buildings, roof trusses).
Analyze them with two engines:
beam— built-in 3D direct-stiffness frame solver (pure JavaScript, instant). Euler-Bernoulli elements with consistent fixed-end forces and exact in-span deflection/moment recovery — one element per member is enough.calculix— writes a CalculiX input deck (B32R beam elements), runsccx, and parses displacements/reactions. Useengine: "both"to cross-check the two solvers.
Export to FreeCAD — builds a solid 3D model of the structure and saves a
.FCStddocument you can open and inspect in FreeCAD.Get member force envelopes (N, V, M, T), stresses, and utilization (σ/fy), reactions, and displacements.
No CalculiX install needed if you have FreeCAD: FreeCAD bundles
ccxwith its FEM workbench, and this server auto-detects it (e.g.C:\Program Files\FreeCAD 1.1\bin\ccx.exe).
Requirements
Node.js ≥ 18
Optional: FreeCAD (provides both
freecadcmdfor export and the bundled CalculiX solver)Optional: standalone CalculiX (
ccx) if you don't use FreeCAD
Related MCP server: FreeCAD Robust MCP Server
Install & run
git clone https://github.com/StructuralWizard/beam-analysis-mcp.git
cd beam-analysis-mcp
npm install
npm test # closed-form validation + MCP e2e + CalculiX cross-check
npm run typologies # analyze 10 bridge/building typologies with both enginesClaude Desktop / Claude Code configuration
Add to claude_desktop_config.json (or .mcp.json for Claude Code):
{
"mcpServers": {
"beam-analysis": {
"command": "node",
"args": ["C:/path/to/beam-analysis-mcp/src/server.js"]
}
}
}Optional environment variables:
Variable | Purpose |
| Explicit path to the CalculiX |
| Explicit path to |
| Default directory for exported |
Tools
Tool | Purpose |
| Report Node/ccx/freecadcmd availability and unit conventions |
| Create an empty model |
| List parametric typology generators and their defaults |
| Build a complete bridge/building from a preset + parameter overrides |
| Manual model building |
| Run linear-static analysis ( |
| Detailed displacements, reactions, or member force envelopes |
| Render an SVG figure: geometry, mesh, deformed shape, moment/shear/axial diagrams, stress/strain maps |
| Save a solid 3D |
| Write the CalculiX |
| Session management |
Structure presets
Preset | Typology |
| Simply supported or continuous girder bridge (1..n spans) |
| 3D through-truss bridge — |
| Deck arch bridge: parabolic rib + spandrel columns + deck girder |
| Single-pylon fan-pattern cable-stayed bridge |
| Gable portal frame (warehouse/industrial shed) |
| Multi-story multi-bay moment-resisting frame |
| Full 3D building with columns, two-way beams, perimeter X-bracing |
| Triangular (Howe-style) roof truss |
Example conversation with an MCP client:
"Generate a 3-span continuous girder bridge (30 m + 40 m + 30 m), analyze it with both engines, and export it to FreeCAD."
which maps to generate_structure {preset: "beam_bridge", params: {spans: [30,40,30]}} → analyze {engine: "both"} → export_freecad.
Conventions
Units: SI — meters, Newtons, Pascals, kg/m³. Downward loads are negative
fz/wz.Axes: global +Z is up. Member local x runs along the member; for non-vertical members local z lies in the vertical plane, so section depth
hresists gravity bending (strong axis =Iy).Supports:
fixed,pinned,roller(uz),roller-yz(bridge sliding bearing),planar-xz(out-of-plane restraint for 2D models), or a custom 6-flag string like"111100"(ux,uy,uz,rx,ry,rz).Member types:
beam(6-DOF frame element) ortruss(axial only — braces, cables, truss webs).
Validation
Full test documentation — every test case, the theory it checks against, tolerances, and the investigation notes behind the cross-engine differences — is in docs/VALIDATION.md.
An illustrated per-structure validation report for all 10 typologies — geometry/supports/loads figures, CalculiX meshes, load cases with superposition checks, deformed shapes (built-in vs CalculiX overlay), moment/shear/axial diagrams, stress & strain maps, CalculiX von Mises fields parsed from .frd, and 35 analytical hand-calculation checks — is in docs/validation/.
npm test checks the solver against closed-form solutions:
Simply supported beam under UDL:
5wL⁴/384EIdeflection andwL²/8moment (exact to 1e-6)Cantilever tip load / UDL:
PL³/3EI,wL⁴/8EI, fixed-end momentsTwo-bar truss axial force
P/(2 sin θ)Equilibrium (ΣR = ΣF) on every generator preset
Cross-validation against CalculiX (skipped automatically if
ccxis not installed)
npm run typologies builds and analyzes 10 typologies end-to-end and prints a built-in vs CalculiX comparison table. Results on the reference machine (FreeCAD 1.1 bundled CalculiX 2.22, Windows 11):
# | Typology | Nodes/Members | Max defl. beam [mm] | Max defl. ccx [mm] | Diff | Equilibrium |
1 | Simply supported girder bridge (35 m) | 7/6 | 137.40 | 138.11 | 0.5% | ok |
2 | Continuous girder bridge (30+40+30 m) | 19/18 | 56.65 | 57.83 | 2.0% | ok |
3 | Pratt truss bridge (60 m) | 32/74 | 48.46 | 48.23 | 0.5% | ok |
4 | Warren truss bridge (64 m) | 34/79 | 69.51 | 69.27 | 0.3% | ok |
5 | Deck arch bridge (90 m) | 34/47 | 10.72 | 10.74 | 0.2% | ok |
6 | Cable-stayed bridge (140 m) | 15/26 | 118.90 | 118.72 | 0.2% | ok |
7 | Portal frame warehouse (30 m) | 5/4 | 136.30 | 131.22 | 3.7% | ok |
8 | 5-story moment frame | 24/35 | 5.60 | 5.59 | 0.3% | ok |
9 | 6-story 3D braced tower | 63/174 | 11.51 | 19.64 | 41%* | ok |
10 | Howe roof truss (28 m) | 16/29 | 13.86 | 13.22 | 4.6% | ok |
* Expected: the tower mixes several cross-sections, and CalculiX models joints between members of different sections as flexible "knots" (see Limitations). Re-run with uniform sections and the two engines agree within 6%.
Limitations
Linear static only: no buckling, no dynamics, no P-Δ, no nonlinear cable sag (stays are modeled as linear truss members that can also take compression).
The two engines answer slightly different questions: the built-in solver assumes ideal rigid joints (classic beam theory), while CalculiX expands beams into solid elements and models joints between members of different sections as "knots", which are more flexible. Agreement is sub-1% on determinate structures and within a few % on frames with uniform sections, but expect larger differences (which ccx reports as a note) on tall 3D frames mixing many sections.
CalculiX backend reports displacements and reactions; member force envelopes come from the built-in engine.
I-sections and generic sections are mapped to an equivalent rectangle in the CalculiX deck (ccx beam sections support RECT/CIRC/PIPE/BOX only).
Results are for preliminary/educational analysis — not a substitute for design verification by a qualified engineer.
License
MIT
Available Tools
17 toolsadd_loadsAdd loadsA
Add nodal loads [N, N·m], member uniformly distributed loads [N/m], and/or set the self-weight factor (1 = full gravity). Downward = negative fz/wz. UDL sys "global" (default) or "local" (member axes).
Inputs: model (required), nodal, memberUDL, selfWeightFactor.
add_materialAdd materialA
Add a material. E = Young's modulus [Pa], nu = Poisson ratio, density [kg/m3] (needed for self-weight), fy = yield/design strength [Pa] (needed for utilization checks). Example steel: E=210e9, nu=0.3, density=7850, fy=355e6.
Inputs: E (required), name (required), model (required), fy, +2 more.
add_membersAdd membersA
Add beam or truss members between existing nodes. type "beam" (default, 6 DOF frame element) or "truss" (axial only, for braces/cables/truss webs). rollDeg rotates the section about the member axis.
Inputs: model (required), members (required).
add_nodesAdd nodesA
Add nodes to a model. Coordinates in meters, global +Z up. Node ids are optional (auto-assigned integers).
Inputs: model (required), nodes (required).
add_sectionAdd cross-sectionA
Add a cross-section. Shapes and required params [m]: rectangle{b,h}, box{b,h,t}, pipe{d,t}, circle{d}, isection{b,h,tf,tw}, generic{A,Iy,Iz,J[,cy,cz]}. Convention: b = width (local y), h = depth (local z); for horizontal members local z is vertical, so Iy is the strong axis for gravity bending. Valid shapes: rectangle, box, pipe, circle, isection, generic.
Inputs: name (required), model (required), shape (required), params (required).
add_supportsAdd supportsB
Add supports at nodes. type is one of fixed, pinned, roller, roller-yz, planar-xz, or a 6-character 0/1 string for (ux,uy,uz,rx,ry,rz), e.g. "111100". "roller-yz" is a typical bridge sliding bearing; "planar-xz" restrains out-of-plane DOFs for 2D models in the XZ plane.
Inputs: model (required), supports (required).
analyzeRun structural analysisA
Run linear-static analysis. engine "beam" = built-in 3D direct-stiffness solver (fast, exact for Euler-Bernoulli frames); "calculix" = CalculiX FEM (B32R beam elements); "both" = run both and compare max displacements. Returns displacements, reactions, member force envelopes, stresses and utilization (stress/fy).
Inputs: model (required), engine, subdivisions.
check_environmentCheck environmentA
Report availability of the built-in solver, CalculiX (ccx) and FreeCAD (freecadcmd) on this machine.
Inputs: no named parameters.
create_modelCreate empty modelA
Create a new empty structural model. Use add_nodes/add_material/add_section/add_members/add_supports/add_loads to build it, or use generate_structure for common typologies.
Inputs: name (required).
delete_modelDelete modelC
Delete a model from the session.
Inputs: model (required).
export_calculix_inpExport CalculiX input deckB
Write the CalculiX .inp input deck for the model (B32R beam elements) without running the solver.
Inputs: model (required), path, subdivisions.
export_freecadExport model to FreeCADA
Build a solid 3D representation of the model (member solids + support markers) and save it as a FreeCAD .FCStd document you can open in FreeCAD. Runs headless freecadcmd; takes ~5-20 s.
Inputs: model (required), path.
generate_structureGenerate a structure from a presetA
Create a complete model (geometry, sections, supports, loads) from a parametric typology preset: beam_bridge, truss_bridge (pratt/howe/warren), arch_bridge, cable_stayed_bridge, portal_frame, moment_frame_building, braced_frame_building, roof_truss. Params override preset defaults (see list_structure_presets).
Inputs: preset (required), name, params.
get_resultsGet detailed resultsA
Retrieve detailed results from the last analysis: "displacements" (per node), "reactions" (per support), or "member_forces" (end forces + envelopes per member). Optionally filter by ids.
Inputs: what (required), model (required), ids, engine.
list_modelsList modelsA
List all models in this session.
Inputs: no named parameters.
list_structure_presetsList structure presetsA
List parametric structure generators (bridge and building typologies) with their default parameters.
Inputs: no named parameters.
model_infoModel infoB
Summary of a model: counts, materials, sections, loads, bounding box.
Inputs: model (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool has a clearly distinct purpose. The add_* tools each add a different aspect (nodes, materials, sections, members, supports, loads), and all other tools (analyze, export, list, delete, etc.) are uniquely identifiable. There is no overlap or confusion between tools.
Most tool names follow a consistent verb_noun pattern (e.g., add_nodes, list_models, get_results). However, 'model_info' is a noun_info construction and 'analyze' is a bare verb, which deviates slightly from the predominant pattern, so it is not perfectly consistent.
With 17 tools, the server covers a comprehensive workflow for parametric structural analysis: model creation, component addition, analysis, results retrieval, export, and management. The count is well-scoped for its domain, each tool earning its place.
The tool set covers the core workflow (create, add components, analyze, get results, export), but lacks update or delete operations for individual components (e.g., no tool to modify a node or remove a member). This is a notable gap for iterative design, though the essential lifecycle is present.
Maintenance
Related MCP Connectors
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Official MCP server for Softhills 3D/2D Visualization SDKs, API documentation, and code examples.
Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables AI agents to interact with Nastran FEA models by reading, writing, and analyzing BDF and OP2 files. It provides tools for mesh quality assessment, geometric analysis, and automated report generation for structural engineering workflows.3MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that enables AI assistants to interact with FreeCAD for 3D modeling, macro development, and debugging through 150+ tools supporting multiple connection modes.280Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables automation of FreeCAD model creation, macro execution, and view management through a server-client architecture, supporting integration with external AI tools like Claude and Cursor.103MIT
- FlicenseBqualityDmaintenanceUltra-lightweight MCP server for construction calculations and material estimation, enabling material calculator and cost estimator tools for structures like foundations, walls, slabs, and beams.42-