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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
- name: Build
run: npm run build

- name: Verify the CLI contract
run: |
node dist/index.js --version | grep -q "^engineer-mcp"
node dist/index.js --list | grep -q "beam_bending"
node dist/index.js --list | grep -q "press_fit"

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

Expand Down
63 changes: 57 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ The release covers these domains:
- Helical compression spring design.
- Shaft torsion and first critical speed.
- Bearing rating life to ISO 281.
- Fatigue life to the Soderberg, Goodman, Gerber, and ASME-elliptic criteria.
- Press-fit and interference-fit joint design by Lamé theory.
- von Mises equivalent stress.
- Cross-section properties.
- Dimension-safe unit conversion.
- Dimension-safe unit conversion, including viscosity and thermal conductivity.
- Material property lookup.

## How results stay trustworthy
Expand Down Expand Up @@ -52,6 +54,8 @@ Warnings surface when a method uses an approximation.
| `spring_design` | Spring rate, shear stress, and safety factor of a compression spring. |
| `shaft_analysis` | Torsion stress, twist, and critical speed. |
| `bearing_life` | ISO 281 rating life in revolutions and hours. |
| `fatigue_analysis` | Fatigue safety factors for a constant-amplitude stress cycle. |
| `press_fit` | Contact pressure, stresses, and capacity of an interference fit. |
| `von_mises` | Equivalent stress and yield safety factor. |
| `unit_convert` | Conversion between compatible units. |
| `material_lookup` | Curated mechanical properties of materials. |
Expand Down Expand Up @@ -147,6 +151,43 @@ References:
- Machinery's Handbook (Thirty-first edition)
```

A call to `fatigue_analysis` for a steel part under a fluctuating load:

```text
Endurance limit 310 MPa
Mean stress 100 MPa
Alternating stress 100 MPa
Soderberg fatigue factor 1.622
Modified Goodman fatigue factor 2.067
Gerber fatigue factor 2.568
ASME-elliptic fatigue factor 2.291
First-cycle yield factor 1.7
Governing fatigue factor 1.622

Method: Constant-amplitude fatigue criteria
Formula: Soderberg: Sa/Se + Sm/Sy = 1/n. Goodman: Sa/Se + Sm/Sut = 1/n
References:
- Shigley's Mechanical Engineering Design (Tenth edition, 2015)
```

A call to `press_fit` for a steel hub on a steel shaft with 20 µm interference:

```text
Interface contact pressure 52.5 MPa
Hub tangential stress 87.5 MPa
Shaft tangential stress -52.5 MPa
Hub von Mises stress 122.5 MPa
Press-in force 22.27 kN
Torque capacity 334 N·m
Hub safety factor 2.898

Method: Interference fit by Lamé thick-cylinder theory
Formula: p = u / (r ((1/Eh)((ro^2+r^2)/(ro^2-r^2)+nh) + (1/Es)((r^2+ri^2)/(r^2-ri^2)-ns)))
References:
- Shigley's Mechanical Engineering Design (Tenth edition, 2015)
- Machinery's Handbook (Thirty-first edition)
```

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

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

- 98 tests across 10 files.
- 135 tests across 12 files.
- All tests pass on Node 22 and Node 24.
- The CI workflow runs typecheck, tests, build, demo, and a package check.
- The CI workflow runs typecheck, tests, build, the CLI contract, the demo, and a package check.

Run `npm test` to reproduce the results.

Expand All @@ -184,6 +225,10 @@ Run `npm test` to reproduce the results.
- 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.
- The fatigue criteria assume a polished test specimen.
Apply surface, size, and loading factors to a real part.
- The press-fit theory assumes uniform contact along the hub.
It ignores stress concentrations at the hub edges.
- The built-in SQLite module of Node.js is still experimental.

Check the cited sources for exact values.
Expand All @@ -197,12 +242,18 @@ 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.
- Constant-amplitude fatigue analysis.
The `fatigue_analysis` tool reports factors for four fatigue criteria.
- Press-fit and interference-fit design.
The `press_fit` tool reports pressure, stresses, and joint capacity.
- Viscosity and thermal-conductivity units.
The `unit_convert` tool converts dynamic viscosity, kinematic viscosity, and thermal conductivity.

### Remaining

- Add fatigue analysis for cyclic loads.
- Add press-fit and interference-fit calculators.
- Add more unit categories, including viscosity and thermal conductivity.
- Add fatigue analysis for welded or notched joints.
- Add a shrink-fit temperature for assembly.
- Add more unit categories, including specific heat capacity.
- Add HTTP transport.
- Add a catalog of ISO and DIN standard sections.

Expand Down
9 changes: 6 additions & 3 deletions docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ 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.
- Constant-amplitude fatigue analysis. The `fatigue_analysis` tool reports factors for the Soderberg, Goodman, Gerber, and ASME-elliptic criteria.
- Press-fit and interference-fit design. The `press_fit` tool reports pressure, stresses, and joint capacity from Lamé theory.
- Viscosity and thermal-conductivity units. The `unit_convert` tool covers dynamic viscosity, kinematic viscosity, and thermal conductivity.

### Remaining

- Add fatigue analysis for cyclic loads.
- Add press-fit and interference-fit calculators.
- Add more unit categories, including viscosity and thermal conductivity.
- Add fatigue analysis for welded or notched joints.
- Add a shrink-fit temperature for assembly.
- Add more unit categories, including specific heat capacity.
- Add HTTP transport in addition to stdio.
- Add a catalog of ISO and DIN standard sections.

Expand Down
61 changes: 61 additions & 0 deletions docs/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,59 @@ Inputs:
- `speedRpm`: enables life in hours.
- `requiredLifeHours`: enables the life margin.

## fatigue_analysis

Compute fatigue safety factors for a constant-amplitude stress cycle.

The tool evaluates the Soderberg, modified Goodman, Gerber, and ASME-elliptic criteria. It reports the minimum factor as the governing factor.

Inputs:

- `meanStress`: mean stress in pascals. Negative values are compressive.
- `amplitudeStress`: alternating stress in pascals. Zero means a steady load.
- `ultimateStrength`: ultimate tensile strength in pascals.
- `yieldStrength`: yield strength in pascals. Enables the Soderberg and ASME-elliptic criteria.
- `enduranceLimit`: endurance limit in pascals. The tool estimates it when missing.
- `criterion`: one of `soderberg`, `goodman`, `gerber`, `asme_elliptic`, or `all`. The default is `all`.

The tool warns when the mean stress is compressive. It warns when the endurance limit is an estimate. It warns when the governing factor is below one.

## press_fit

Compute the contact pressure, stresses, and capacity of an interference fit.

The tool uses the Lamé solution for two cylinders in interference. The hub carries tensile hoop stress. The shaft carries compressive hoop stress.

Inputs:

- `hubOuterDiameter`: hub outer diameter in metres.
- `interfaceDiameter`: interface diameter in metres.
- `shaftInnerDiameter`: shaft inner diameter in metres. The default is a solid shaft.
- `hubLength`: hub engagement length in metres.
- `diametralInterference`: diametral interference in metres.
- `hubElasticModulus` and `shaftElasticModulus`: Young's moduli in pascals.
- `hubPoissonRatio` and `shaftPoissonRatio`: Poisson's ratios. The default is `0.3`.
- `frictionCoefficient`: interface friction coefficient. The default is `0.15` for dry steel.
- `hubYieldStrength`: enables the hub safety factor.
- `shaftYieldStrength`: enables the shaft safety factor.
- `appliedAxialForce`: enables the axial joint safety factor.

Example:

```json
{
"hubOuterDiameter": 0.06,
"interfaceDiameter": 0.03,
"hubLength": 0.03,
"diametralInterference": 0.00002,
"hubElasticModulus": 210000000000,
"shaftElasticModulus": 210000000000,
"hubYieldStrength": 355000000
}
```

The tool warns on a thin hub. It warns when the applied axial force exceeds the press-in force.

## von_mises

Compute the von Mises equivalent stress and yield safety factor of a stress state.
Expand All @@ -156,6 +209,14 @@ Inputs:
- `from`: source unit symbol.
- `to`: target unit symbol.

The converter covers these quantities:

- length, mass, time, and angle.
- temperature, force, pressure, and torque.
- energy, power, velocity, and acceleration.
- area, volume, density, and stiffness.
- frequency, dynamic viscosity, kinematic viscosity, and thermal conductivity.

The converter rejects mismatched dimensions and mismatched quantity categories. For example, it rejects a torque-to-energy conversion.

## material_lookup
Expand Down
38 changes: 38 additions & 0 deletions examples/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ type ToolHandlers = {
von_mises: Handler;
unit_convert: Handler;
material_lookup: Handler;
fatigue_analysis: Handler;
press_fit: Handler;
};

const toolHandlers = handlers as ToolHandlers;
Expand All @@ -90,6 +92,9 @@ const tools: NamedHandler[] = [
["von_mises", toolHandlers.von_mises],
["unit_convert", toolHandlers.unit_convert],
["unit_convert (torque to energy)", toolHandlers.unit_convert],
["unit_convert (thermal conductivity)", toolHandlers.unit_convert],
["fatigue_analysis", toolHandlers.fatigue_analysis],
["press_fit", toolHandlers.press_fit],
["material_lookup", toolHandlers.material_lookup],
];

Expand Down Expand Up @@ -155,6 +160,39 @@ const inputs: Array<Record<string, unknown>> = [
from: "N·m",
to: "J",
},
{
value: 205,
from: "W/(m·K)",
to: "BTU/(ft·h·degF)",
},
{
meanStress: 100e6,
amplitudeStress: 100e6,
ultimateStrength: 620e6,
yieldStrength: 340e6,
outputUnits: { enduranceLimit: "MPa", meanStress: "MPa", amplitudeStress: "MPa" },
},
{
hubOuterDiameter: 0.06,
interfaceDiameter: 0.03,
hubLength: 0.03,
diametralInterference: 20e-6,
hubElasticModulus: 210e9,
shaftElasticModulus: 210e9,
hubYieldStrength: 355e6,
shaftYieldStrength: 355e6,
appliedAxialForce: 10000,
outputUnits: {
contactPressure: "MPa",
hubTangentialStress: "MPa",
shaftTangentialStress: "MPa",
radialStress: "MPa",
hubVonMisesStress: "MPa",
shaftVonMisesStress: "MPa",
pressForce: "kN",
torqueCapacity: "N·m",
},
},
{
query: "steel",
},
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

4 changes: 3 additions & 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 Expand Up @@ -48,6 +48,8 @@
"engineering",
"calculations",
"unit-conversion",
"fatigue",
"press-fit",
"sqlite",
"provenance",
"engineerkit"
Expand Down
Loading
Loading