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 @@ -38,3 +38,6 @@ jobs:

- name: Verify the demo runs
run: npm run demo

- name: Verify the package contents
run: npm pack --dry-run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
dist/
coverage/
*.tsbuildinfo
*.tgz

*.sqlite
*.sqlite-journal
Expand Down
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Engineer MCP

[![CI](https://github.com/DanielCuevas1208/engineer-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/DanielCuevas1208/engineer-mcp/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)
[![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, shafts, bearings, stress, sections, and units.
It gives coding agents verified answers for beams, bolts, shafts, bearings, stress, fatigue, sections, and units.
Every result shows the formula, the method, and the source.

## What it provides
Expand All @@ -21,6 +22,7 @@ The release covers these domains:
- Shaft torsion and first critical speed.
- Bearing rating life to ISO 281.
- von Mises equivalent stress.
- Fatigue analysis for cyclic loads.
- Cross-section properties.
- Dimension-safe unit conversion.
- Material property lookup.
Expand Down Expand Up @@ -50,6 +52,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` | Endurance limit, fatigue safety factor, and estimated life. |
| `unit_convert` | Conversion between compatible units. |
| `material_lookup` | Curated mechanical properties of materials. |

Expand Down Expand Up @@ -124,6 +127,22 @@ References:
- Mechanics of Materials (Euler-Bernoulli beam theory)
```

A call to `fatigue_analysis` for a machined S355 part with a 220 MPa amplitude and 60 MPa mean stress:

```text
Corrected endurance limit 214 MPa
Fatigue safety factor 0.8692
Equivalent fully reversed amplitude 250.7 MPa
Yield safety factor 1.268
Estimated life to failure 220564 cycles

Warning: The fatigue safety factor is below 1. Fatigue failure is predicted.
Method: Stress-life fatigue analysis
Formula: Se = ka kb kc (0.5 Sut), 1/n = Sa/Se + Sm/Sut
References:
- Shigley's Mechanical Engineering Design (Tenth edition, 2015)
```

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

```text
Expand All @@ -146,9 +165,9 @@ 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.

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

Run `npm test` to reproduce the results.

Expand All @@ -159,6 +178,7 @@ Run `npm test` to reproduce the results.
- The bolt tables cover coarse metric threads from M5 to M36.
- The bearing factors are typical values for deep-groove ball bearings.
- The critical speed is a first-mode approximation.
- The fatigue model uses typical Marin factors. Confirm critical designs with test data.
- The built-in SQLite module of Node.js is still experimental.

Check the cited sources for exact values.
Expand All @@ -168,10 +188,18 @@ Check the cited sources for exact values.
The server grows in independent releases.
Each release stays useful on its own.

- Add fatigue analysis for cyclic loads.
- Add press-fit and spring calculators.
- Add more unit categories.
### Complete

- Fatigue analysis for cyclic loads.
The `fatigue_analysis` tool estimates the endurance limit and the safety factor.

### Remaining

- Add press-fit and interference-fit calculators.
- Add a spring calculator for helical compression springs.
- Add more unit categories, including viscosity and thermal conductivity.
- Add HTTP transport.
- Add a catalog of ISO and DIN standard sections.

See [docs/integration.md](docs/integration.md) for the EngineerKit plan.

Expand Down
7 changes: 6 additions & 1 deletion docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ This server follows semantic versioning. Breaking a tool signature or the result

Engineer MCP grows in independent releases. Each release stays useful on its own.

- Add fatigue analysis for cyclic loads.
### Complete

- Fatigue analysis for cyclic loads. The `fatigue_analysis` tool estimates the endurance limit and the fatigue safety factor.

### Remaining

- Add press-fit and interference-fit calculators.
- Add a spring calculator for helical compression springs.
- Add more unit categories, including viscosity and thermal conductivity.
Expand Down
34 changes: 34 additions & 0 deletions docs/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,40 @@ 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 estimated life of a cyclic stress.

The tool follows the stress-life method of Shigley. It applies the Marin factors to estimate the endurance limit. It uses a mean stress failure line for the safety factor.

Inputs:

- `ultimateStrength`: ultimate tensile strength Sut in pascals.
- `yieldStrength`: tensile yield strength in pascals. Enables the yield check and the Soderberg criterion.
- `stressAmplitude`: stress amplitude of the cycle in pascals.
- `meanStress`: mean stress of the cycle in pascals. The default is zero for a fully reversed cycle.
- `enduranceLimit`: corrected endurance limit Se in pascals. When omitted, the tool estimates it from the Marin factors.
- `surfaceFinish`: `ground`, `machined`, `hot_rolled`, or `as_forged`. Sets the surface factor ka. The default is `machined`.
- `loading`: `bending`, `axial`, or `torsion`. Sets the load factor kc. The default is `bending`.
- `sizeFactor`: size factor kb. The default is 1.
- `criterion`: `goodman`, `soderberg`, or `gerber`. Sets the mean stress failure line. The default is `goodman`.
- `targetSafetyFactor`: design safety factor. When set, the tool returns the allowable stress amplitude.

Example:

```json
{
"ultimateStrength": 490000000,
"yieldStrength": 355000000,
"stressAmplitude": 220000000,
"meanStress": 60000000,
"surfaceFinish": "machined",
"loading": "bending"
}
```

The tool reports a warning when the peak stress exceeds yield strength. It reports a warning when the fatigue safety factor falls below 1.

## 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 @@ -73,6 +73,7 @@ type ToolHandlers = {
shaft_analysis: Handler;
bearing_life: Handler;
von_mises: Handler;
fatigue_analysis: Handler;
unit_convert: Handler;
material_lookup: Handler;
};
Expand All @@ -86,6 +87,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 @@ -132,6 +134,15 @@ const inputs: Array<Record<string, unknown>> = [
yieldStrength: 355e6,
outputUnits: { vonMisesStress: "MPa", maxShearStress: "MPa" },
},
{
ultimateStrength: 490e6,
yieldStrength: 355e6,
stressAmplitude: 220e6,
meanStress: 60e6,
surfaceFinish: "machined",
loading: "bending",
outputUnits: { enduranceLimit: "MPa", equivalentStressAmplitude: "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.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"name": "@engineerkit/engineer-mcp",
"version": "0.1.0",
"version": "0.2.0",
"description": "MCP server for verified mechanical-engineering calculations, references, and material data.",
"type": "module",
"license": "MIT",
"author": "EngineerKit",
"repository": {
"type": "git",
"url": "git+https://github.com/DanielCuevas1208/engineer-mcp.git"
},
"bugs": {
"url": "https://github.com/DanielCuevas1208/engineer-mcp/issues"
},
"homepage": "https://github.com/DanielCuevas1208/engineer-mcp#readme",
"engines": {
"node": ">=22.13.0"
},
Expand Down
Loading
Loading