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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ jobs:
- name: Verify the demo runs
run: npm run demo

- name: Verify the CLI lists tools
run: node dist/index.js --list

- name: Verify the package contents
run: npm pack --dry-run
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog

This project follows semantic versioning. Adding a tool or a unit is a minor release. Breaking a tool signature is a major release.

## 0.3.0 - 2026-08-03

Added the fatigue analysis release.

- Added the `fatigue_analysis` tool.
- The tool reports infinite-life safety factors on four criteria.
- The criteria are modified Goodman, Soderberg, Gerber, and ASME-elliptic.
- The tool estimates the endurance limit for steel when you do not provide one.
- The tool reports warnings for estimated values and yield check failures.
- Added the `@engineerkit/engineer-mcp/engine` exports for the fatigue engine.
- The Shigley reference now covers the fatigue chapter.

## 0.2.0 - 2026-08-03

Added the helical spring release.

- Added the `spring_design` tool.
- The tool reports the spring rate, the shear stress, and the safety factor.
- The tool supports four end conditions and warns on buckling and solid height.
- Added stiffness units to the unit layer.

## 0.1.0 - 2026-08-03

Initial release.

- Added the MCP server over standard input and output.
- Added tools for beams, bolts, shafts, bearings, stress, sections, and materials.
- Added the dimension-safe unit layer.
- Added SQLite storage and provenance for every result.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 safety factors for cyclic loads.
- Cross-section properties.
- Dimension-safe unit conversion.
- Material property lookup.
Expand Down Expand Up @@ -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` | Infinite-life fatigue factors on four criteria. |
| `unit_convert` | Conversion between compatible units. |
| `material_lookup` | Curated mechanical properties of materials. |

Expand Down Expand Up @@ -147,6 +149,27 @@ References:
- Machinery's Handbook (Thirty-first edition)
```

A call to `fatigue_analysis` for an S355 shaft under a 150 MPa mean stress and a 100 MPa amplitude:

```text
Mean stress 150 MPa
Stress amplitude 100 MPa
Stress ratio R 0.2
Endurance limit 245 MPa
Modified Goodman safety factor 1.4
Soderberg safety factor 1.204
Gerber safety factor 1.748
ASME-elliptic safety factor 1.702
Yield safety factor 1.42

Method: Infinite-life fatigue analysis
Formula: R = (sm - sa)/(sm + sa); Goodman: 1/n = sa/Se + sm/Sut; Soderberg: 1/n = sa/Se + sm/Sy
References:
- Shigley's Mechanical Engineering Design (Tenth edition, 2015)
```

The endurance limit is an estimate unless you provide it. The tool warns when it estimates a value.

A call to `unit_convert` with a torque-to-energy request fails safely:

```text
Expand All @@ -169,7 +192,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.
- 126 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 +206,9 @@ 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 criteria assume a constant-amplitude cycle and an infinite life.
The endurance limit is an estimate for steel when you do not provide one.
- The built-in SQLite module of Node.js is still experimental.

Check the cited sources for exact values.
Expand All @@ -197,10 +222,11 @@ Each release stays useful on its own.

- Helical compression spring design.
The `spring_design` tool reports the spring rate, the shear stress, and the safety factor.
- Fatigue analysis for cyclic loads.
The `fatigue_analysis` tool reports infinite-life safety factors on four criteria.

### 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 All @@ -218,3 +244,5 @@ Read the boundary rules in [docs/integration.md](docs/integration.md).
## License

MIT. See [LICENSE](LICENSE).

See [CHANGELOG.md](CHANGELOG.md) for the release history.
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
2 changes: 1 addition & 1 deletion docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Engineer MCP grows in independent releases. Each release stays useful on its own
### Complete

- Helical compression spring design. The `spring_design` tool computes the spring rate, the shear stress, and the safety factor.
- Fatigue analysis for cyclic loads. The `fatigue_analysis` tool reports infinite-life safety factors on four criteria.

### 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
29 changes: 29 additions & 0 deletions docs/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,35 @@ Inputs:
- Cartesian mode uses `sigmaX`, `sigmaY`, `sigmaZ`, `tauXY`, `tauXZ`, `tauYZ`.
- `yieldStrength`: enables the safety factor.

## fatigue_analysis

Compute the infinite-life fatigue safety factors of a constant-amplitude stress cycle.

The tool evaluates four failure criteria. It reports one safety factor for each criterion. They are the modified Goodman, Soderberg, Gerber, and ASME-elliptic lines.

Inputs:

- `meanStress`: mean stress of the cycle in pascals.
- `amplitudeStress`: alternating stress amplitude in pascals.
- `material`: material name from the database. It provides the ultimate and yield strengths.
- `ultimateStrength`: tensile ultimate strength in pascals. Required when no material is set.
- `yieldStrength`: tensile yield strength in pascals. It enables the Soderberg, ASME-elliptic, and yield factors.
- `enduranceLimit`: fully reversed endurance limit in pascals. The default is an estimate for steel.
- `criterion`: primary criterion for the safety factor. The options are `goodman`, `soderberg`, `gerber`, and `asme_elliptic`. The default is `goodman`.

Example:

```json
{
"meanStress": 150000000,
"amplitudeStress": 100000000,
"material": "Structural steel S355",
"enduranceLimit": 245000000
}
```

The tool warns when the endurance limit is estimated. It warns when the amplitude exceeds the endurance limit. It warns when the cycle reaches yield at its peak or trough.

## unit_convert

Convert a value between two units.
Expand Down
8 changes: 8 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,12 @@ const inputs: Array<Record<string, unknown>> = [
yieldStrength: 355e6,
outputUnits: { vonMisesStress: "MPa", maxShearStress: "MPa" },
},
{
meanStress: 150e6,
amplitudeStress: 100e6,
material: "Structural steel S355",
outputUnits: { meanStress: "MPa", amplitudeStress: "MPa", minStress: "MPa", maxStress: "MPa", enduranceLimit: "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