Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
verify:
Expand Down
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Node](https://img.shields.io/badge/Node-%3E%3D22.13-brightgreen.svg)](package.json)

Engineer MCP is a Model Context Protocol server for mechanical-engineering calculations.
It gives coding agents verified answers for beams, bolts, springs, shafts, bearings, stress, sections, and units.
It gives coding agents verified answers for beams, bolts, springs, shafts, bearings, fatigue, stress, sections, and units.
Every result shows the formula, the method, and the source.

## What it provides
Expand All @@ -23,6 +23,7 @@ The release covers these domains:
- Shaft torsion and first critical speed.
- Bearing rating life to ISO 281.
- von Mises equivalent stress.
- Fatigue life and safety factor for cyclic stress.
- Cross-section properties.
- Dimension-safe unit conversion.
- Material property lookup.
Expand All @@ -38,7 +39,7 @@ The unit layer knows the dimension of every unit.
It rejects a conversion between incompatible quantities.
For example, it rejects a torque-to-energy conversion.

Safety factors appear only when you provide a yield strength.
Yield-based safety factors appear only when you provide a yield strength.
The tool never hides an assumption.
Warnings surface when a method uses an approximation.

Expand All @@ -53,6 +54,7 @@ Warnings surface when a method uses an approximation.
| `shaft_analysis` | Torsion stress, twist, and critical speed. |
| `bearing_life` | ISO 281 rating life in revolutions and hours. |
| `von_mises` | Equivalent stress and yield safety factor. |
| `fatigue_analysis` | Fatigue safety factor, endurance limit, and predicted life for cyclic loads. |
| `unit_convert` | Conversion between compatible units. |
| `material_lookup` | Curated mechanical properties of materials. |

Expand Down Expand Up @@ -154,6 +156,24 @@ Error: Category mismatch: N·m is torque, J is energy.
Use a unit of the same quantity.
```

A call to `fatigue_analysis` for an S355 steel part with 180 MPa alternating stress and 40 MPa mean stress:

```text
Base endurance limit 245 MPa
Endurance correction factor 0.765
Corrected endurance limit 187.4 MPa
Fatigue strength at 10^3 cycles 441 MPa
Equivalent fully reversed amplitude 196 MPa
Predicted fatigue life 696874 cycles
Fatigue safety factor 0.9597

Method: Fatigue analysis for fluctuating stress
Formula: Se' = 0.5 Sut, Se = ka kb kc kd ke kf Se', Goodman: n = 1/(sa/Se + sm/Sut)
References:
- Shigley's Mechanical Engineering Design (Tenth edition, 2015)
- Machinery's Handbook (Thirty-first edition)
```

## Development

| Command | Purpose |
Expand All @@ -169,7 +189,7 @@ Use a unit of the same quantity.
The test suite is deterministic and offline.
It covers the engines, the unit layer, the database, and the tools.

- 98 tests across 10 files.
- 130 tests across 11 files.
- All tests pass on Node 22 and Node 24.
- The CI workflow runs typecheck, tests, build, demo, and a package check.

Expand All @@ -183,7 +203,10 @@ Run `npm test` to reproduce the results.
- The bearing factors are typical values for deep-groove ball bearings.
- The critical speed is a first-mode approximation.
- The spring design covers static round-wire springs only.
It does not estimate fatigue life for cyclic loads.
Use `fatigue_analysis` for cyclic loads.
- The fatigue analysis uses the stress-life method.
It assumes a fully reversed load corrected for the mean stress.
It estimates the endurance limit for steel unless you supply a tested value.
- The built-in SQLite module of Node.js is still experimental.

Check the cited sources for exact values.
Expand All @@ -195,12 +218,19 @@ Each release stays useful on its own.

### Complete

- Beam bending stress, deflection, and safety factor.
- Cross-section properties for five common shapes.
- ISO 898 bolt tensile design.
- Helical compression spring design.
The `spring_design` tool reports the spring rate, the shear stress, and the safety factor.
- Shaft torsion and first lateral critical speed.
- ISO 281 bearing rating life.
- von Mises equivalent stress.
- Fatigue analysis for cyclic loads.
The `fatigue_analysis` tool reports the corrected endurance limit, the safety factor by four criteria, and the predicted life.
- Dimension-safe unit conversion and material lookup.

### Remaining

- Add fatigue analysis for cyclic loads.
- Add press-fit and interference-fit calculators.
- Add more unit categories, including viscosity and thermal conductivity.
- Add HTTP transport.
Expand Down
2 changes: 1 addition & 1 deletion data/references.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Shigley's Mechanical Engineering Design",
"source": "McGraw-Hill Education",
"edition": "Tenth edition, 2015",
"section": "Chapters 3, 5, 8, 11, and 12",
"section": "Chapters 3, 5, 6, 8, 11, and 12",
"note": "Standard reference for strength, fatigue, fasteners, and bearings."
},
"roark-2011": {
Expand Down
9 changes: 8 additions & 1 deletion docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ Engineer MCP grows in independent releases. Each release stays useful on its own

### Complete

- Beam bending stress, deflection, and safety factor. The `beam_bending` tool covers point and uniform loads on two supports.
- Cross-section properties. The `section_properties` tool covers five common shapes.
- ISO 898 bolt tensile design. The `bolt_strength` tool reports stress area, preload, and capacity.
- Helical compression spring design. The `spring_design` tool computes the spring rate, the shear stress, and the safety factor.
- Shaft torsion and critical speed. The `shaft_analysis` tool covers solid and hollow shafts.
- ISO 281 bearing rating life. The `bearing_life` tool reports life in revolutions and hours.
- von Mises equivalent stress. The `von_mises` tool covers principal and cartesian stress states.
- Fatigue analysis for cyclic loads. The `fatigue_analysis` tool reports the corrected endurance limit, the safety factor by four criteria, and the predicted life.
- Dimension-safe unit conversion and material lookup.

### Remaining

- Add fatigue analysis for cyclic loads.
- Add press-fit and interference-fit calculators.
- Add more unit categories, including viscosity and thermal conductivity.
- Add HTTP transport in addition to stdio.
Expand Down
21 changes: 21 additions & 0 deletions docs/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ Inputs:
- Cartesian mode uses `sigmaX`, `sigmaY`, `sigmaZ`, `tauXY`, `tauXZ`, `tauYZ`.
- `yieldStrength`: enables the safety factor.

## fatigue_analysis

Compute the fatigue safety factor, corrected endurance limit, and predicted life of a fluctuating stress state.

The tool defaults to the modified Goodman criterion. It also supports Gerber, Soderberg, and ASME-elliptic criteria.

The endurance limit defaults to 0.5 x ultimate strength for steel. Supply a tested value when you have one.

Inputs:

- `material`: material name from the database. Provides the ultimate and yield strength.
- `ultimateStrength`: ultimate tensile strength in pascals. Required when no material is set.
- `yieldStrength`: tensile yield strength in pascals. Required for Soderberg and ASME-elliptic.
- `enduranceLimit`: tested endurance limit in pascals. Defaults to the steel estimate.
- `stressAmplitude`: alternating stress in pascals.
- `meanStress`: mean stress in pascals. The default is zero.
- `surfaceFactor`, `sizeFactor`, `loadFactor`, `temperatureFactor`, `reliabilityFactor`, `miscellaneousFactor`: Marin correction factors. Each defaults to 1.
- `criterion`: `goodman`, `gerber`, `soderberg`, or `asme_elliptic`. The default is `goodman`.

The tool warns when it estimates the endurance limit. It warns when the predicted life falls below 10^3 cycles.

## unit_convert

Convert a value between two units.
Expand Down
11 changes: 11 additions & 0 deletions examples/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type ToolHandlers = {
shaft_analysis: Handler;
bearing_life: Handler;
von_mises: Handler;
fatigue_analysis: Handler;
unit_convert: Handler;
material_lookup: Handler;
};
Expand All @@ -88,6 +89,7 @@ const tools: NamedHandler[] = [
["shaft_analysis", toolHandlers.shaft_analysis],
["bearing_life", toolHandlers.bearing_life],
["von_mises", toolHandlers.von_mises],
["fatigue_analysis", toolHandlers.fatigue_analysis],
["unit_convert", toolHandlers.unit_convert],
["unit_convert (torque to energy)", toolHandlers.unit_convert],
["material_lookup", toolHandlers.material_lookup],
Expand Down Expand Up @@ -145,6 +147,15 @@ const inputs: Array<Record<string, unknown>> = [
yieldStrength: 355e6,
outputUnits: { vonMisesStress: "MPa", maxShearStress: "MPa" },
},
{
material: "Structural steel S355",
stressAmplitude: 180e6,
meanStress: 40e6,
surfaceFactor: 0.85,
sizeFactor: 0.9,
criterion: "goodman",
outputUnits: { correctedEnduranceLimit: "MPa", equivalentAmplitude: "MPa" },
},
{
value: 1000,
from: "psi",
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@engineerkit/engineer-mcp",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server for verified mechanical-engineering calculations, references, and material data.",
"type": "module",
"license": "MIT",
Expand Down
Loading
Loading