convez.ai
MCP Server
benajaero

rocket-tools

benajaero/rocket-tools

Ver no GitHub
InicialPluginScore · de 0 a 100

35 MCP tools for aerospace engineering — structural analysis, margin of safety, trusses, aerodynamics, compressible flow, thermodynamics, aircraft performance, rocket nozzle design, and mission planning

Instalação

$npx convez-ai benajaero/rocket-tools

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 3 meses
Versão
v0.6.1
Issues abertas
0
Contribuidores
2

README

A tradução para o português deste README ainda está na fila.

🚀 rocket-tools

Engineering-grade aerospace computation. AI-native interface.

Tests Coverage Python License


Install & Run in 30 Seconds

pip install rocket-tools
from rocket_tools.materials import material_lookup
from rocket_tools.aerodynamics import dynamic_pressure

# How much pressure does a rocket face at Mach 2.5, sea level?
mat = material_lookup("Inconel-718")
q = dynamic_pressure(velocity=857, altitude_m=0)  # 857 m/s ≈ Mach 2.5
print(f"Dynamic pressure: {q['dynamic_pressure_pa']/1e3:.0f} kPa")
print(f"Inconel-718 yield strength: {mat['yield_strength_mpa']:.0f} MPa")

→ Skills Library · → Quick Start for AI Agents · → Contributing


What is This?

rocket-tools is a Python library that gives you fast, precise aerospace engineering calculations — from beam deflection to atmospheric properties to material trade studies. It is built for three kinds of people:

  • Hobbyists & students designing rockets, drones, or aircraft in Python
  • Propulsion & structures engineers who need reliable numbers without opening a full FEM suite
  • AI-agent builders who want engineering tools exposed through the Model Context Protocol (MCP)

Unlike monolithic engineering suites, rocket-tools is composable: each tool is self-contained, validated, and fast enough to call thousands of times per second. Use one function or chain them into full design reviews.


What Can It Do?

CapabilityWhat You Get
35 MCP ToolsExposed via FastMCP — AI agents can call aerospace computations with structured inputs and validated outputs
49+ MaterialsAluminum, titanium, steel, nickel superalloys, composites, refractory metals — with thermal & mechanical properties, filterable by application (rocket, drone, aircraft, spacecraft, engine)
Structural AnalysisBeam bending/deflection/shear, 7 cross-section types, Euler-Johnson column buckling, plate buckling coefficients, margin of safety (stress/load/deflection), von Mises combined stress, 2D/3D truss analysis
Compressible FlowIsentropic relations, normal & oblique shocks, Prandtl-Meyer expansions — all Numba JIT-compiled
Aircraft PerformanceLift curve slope, drag polar with compressibility, Breguet range & endurance, wing loading & stall speed
Rocket Nozzle DesignThrust, Isp, thrust coefficient, expansion ratio optimization with under/over-expansion detection
Mission DesignTsiolkovsky ΔV, multi-stage staging, orbital velocity, payload fraction, thrust-to-weight, composite CG, propellant tank sizing
Natural Language RouterAsk "What's the Reynolds number at 250 m/s and 5 km?" and get a validated tool call — no API memorization needed
ISA AtmosphereStandard atmosphere 0–25,000 m with ~54 ns cached lookups
Workflow EngineChain tools into reusable YAML workflows for design reviews
ASGI ServerProduction-ready SSE (Server-Sent Events) endpoint with /health, /ready, and Prometheus /metrics
Unit ConversionsNIST-traceable SI ↔ imperial (psi, psf, ft, in, lbf, mph, knots, Fahrenheit, Rankine)

Performance: All hot paths are Numba JIT-compiled. Every tool runs in under 1 ms.


How to Use It

1. As a Python Library

The simplest way — import and compute.

from rocket_tools.structural import beam_analysis, section_properties, column_buckling
from rocket_tools.materials import material_lookup, compare_materials
from rocket_tools.aerodynamics import (
    aero_analysis, mach_number, isentropic_flow, normal_shock, oblique_shock
)
from rocket_tools.design import (
    rocket_delta_v, multi_stage_delta_v, orbital_velocity,
    payload_fraction, propellant_tank_sizing
)
from rocket_tools.utils.units import convert

# --- Structural: design a beam ---
mat = material_lookup("6061-T6")
beam = beam_analysis(
    load=500.0,
    length=2.0,
    youngs_modulus=mat["youngs_modulus_pa"],
    cross_section={"type": "rectangle", "width": 0.05, "height": 0.02},
    load_type="point_midspan",
    support_type="simply_supported",
)
print(f"Deflection: {beam['max_deflection_m']*1000:.2f} mm")
print(f"Bending stress: {beam['bending_stress_pa']/1e6:.1f} MPa")

# --- Cross-section properties ---
section = section_properties("ibeam", width=0.1, height=0.2, flange_thickness=0.01, web_thickness=0.008)
print(f"Ixx = {section['i_xx_m4']:.2e} m⁴")

# --- Column buckling ---
buckling = column_buckling(
    youngs_modulus=mat["youngs_modulus_pa"],
    area_moment=section["i_xx_m4"],
    area=section["area_m2"],
    length=1.5,
    yield_strength=mat["yield_strength_mpa"] * 1e6,
    end_condition="pinned-pinned",
)
print(f"Critical load: {buckling['critical_load_n']:.0f} N ({buckling['failure_mode']})")

# --- Materials: compare alloys for a rocket tank ---
comparison = compare_materials(["2219-T87", "Ti-6Al-4V", "2195"])
for m in comparison:
    print(f"{m['name']}: specific strength = {m['specific_strength']:.0f} m²/s²")

# --- Aerodynamics: full characterization ---
aero = aero_analysis(
    velocity=250.0,
    altitude_m=5000.0,
    characteristic_length=20.0,
    reference_area=40.0,
    lift=50000.0,
    drag=5000.0,
)
print(f"Re = {aero['reynolds_number']:.2e}")
print(f"Mach = {aero['mach_number']:.3f} ({aero['mach_regime']})")
print(f"L/D = {aero['lift_to_drag_ratio']:.1f}")

# --- Compressible flow ---
iso = isentropic_flow(mach=2.5, gamma=1.4)
print(f"P/P0 = {iso['pressure_ratio']:.4f}, T/T0 = {iso['temperature_ratio']:.4f}")

ns = normal_shock(mach1=2.5, gamma=1.4)
print(f"Downstream Mach = {ns['mach2']:.3f}, P2/P1 = {ns['pressure_ratio']:.3f}")

os = oblique_shock(mach1=2.5, deflection_deg=10, gamma=1.4)
print(f"Weak shock angle = {os['weak_shock_wave_angle_deg']:.1f}°")

# --- Rocket mission design ---
dv = rocket_delta_v(isp_s=320, mass_fraction=0.85)
print(f"Single-stage ΔV = {dv:.0f} m/s")

orb = orbital_velocity(altitude_m=400e3, planet="earth")
print(f"Circular orbit at 400 km: {orb['circular_velocity_m_s']:.0f} m/s")

tank = propellant_tank_sizing(
    propellant_volume_m3=5.0,
    tank_shape="cylinder",
    material="Ti-6Al-4V",
    safety_factor=1.5,
)
print(f"Tank mass: {tank['tank_mass_kg']:.1f} kg")

# --- Units: convert anything ---
convert(14.7, "psi", "Pa")      # 101352.9...
convert(68, "F", "C")           # 20.0
convert(100, "mph", "m_s")      # 44.704

Key concepts:

  • material_lookup(name) — Fuzzy-matches material names ("6061", "ti-6al-4v", "inconel 718" all work). Returns a dict with youngs_modulus_pa, density_kg_m3, yield_strength_mpa, thermal_conductivity_w_m_k, and more.
  • compare_materials([...]) — Side-by-side trade study sorted by specific strength (strength-to-weight ratio).
  • beam_analysis(...) — Supports rectangle and circle cross-sections, point/distributed/axial loads, and simply-supported/cantilever/fixed-ends boundary conditions.
  • section_properties(...) — 7 shapes: rectangle, hollow_rectangle, circle, hollow_circle, ibeam, cchannel, tsection.
  • aero_analysis(...) — One call returns Reynolds number, Mach number, dynamic pressure, lift coefficient, drag coefficient, and skin friction coefficient.
  • isentropic_flow(...), normal_shock(...), oblique_shock(...) — Compressible flow relations for supersonic/hypersonic analysis.
  • rocket_delta_v(...), multi_stage_delta_v(...) — Tsiolkovsky rocket equation and serial staging.
  • propellant_tank_sizing(...) — Cylindrical, spherical, or ellipsoidal tanks with wall thickness and mass estimates.

2. Natural Language Router

If you do not want to memorize function signatures, ask in plain English:

from rocket_tools.router import route_query

# First question
result = route_query("Mach number at 250 m/s and 10,000 m")
print(result.tool_name)      # 'mach_number'
print(result.params)         # {'velocity': 250.0, 'altitude_m': 10000.0}

# Follow-up with session memory
from rocket_tools.memory import SessionMemory
session = SessionMemory(session_id="design-1")
session.parameters["beam_analysis"] = {"load": 1000.0, "length": 1.5}

result = route_query("What is the deflection?", session=session)
print(result.tool_name)      # 'beam_analysis' — inferred from context

The router uses regex-based extractors for parameters (velocity, altitude, load, length, etc.) and a lightweight intent classifier to pick the right tool. It handles imperial units ("10 inch beam", "500 lbf load") automatically.

3. Workflow Engine

Chain tools into reusable YAML workflows for design reviews:

# my_workflow.yaml
name: aero_characterization
steps:
  - id: re
    tool: reynolds_number
    params:
      velocity: "${inputs.velocity}"
      altitude_m: "${inputs.altitude_m}"
      characteristic_length: "${inputs.characteristic_length}"
    save_as: re

  - id: mach
    tool: mach_number
    params:
      velocity: "${inputs.velocity}"
      altitude_m: "${inputs.altitude_m}"
    save_as: mach

  - id: skin_friction
    tool: skin_friction_coefficient
    params:
      reynolds_number: "${re.reynolds_number}"
      flow_regime: "${inputs.flow_regime}"
    save_as: cf

Run it:

from rocket_tools.workflows import load_workflow, run_workflow

wf = load_workflow("my_workflow.yaml")
result = run_workflow(wf, {
    "velocity": 100.0,
    "altitude_m": 5000.0,
    "characteristic_length": 2.0,
    "flow_regime": "laminar",
})

print(result["re"]["reynolds_number"])
print(result["mach"]["mach_number"])
print(result["cf"]["skin_friction_coefficient"])

Interpolation supports arithmetic (${re.reynolds_number / 1000}) and cross-step references. All expressions are evaluated safely via AST — no eval().

4. MCP Server

Expose all tools to AI agents via the Model Context Protocol:

# Stdio transport (for Claude Desktop, etc.)
rocket-tools

# SSE transport (for web clients)
uvicorn rocket_tools.asgi:app --host 0.0.0.0 --port 8000

The ASGI app exposes:

  • GET /sse — MCP Server-Sent Events endpoint
  • GET /health — Liveness probe
  • GET /ready — Readiness probe (checks tool registration)
  • GET /metrics — Prometheus metrics (rocket_tools_http_requests_total, rocket_tools_tool_calls_total, etc.)

All tool inputs are validated via Pydantic schemas before execution. Errors are structured with error_code, parameter, constraint, and suggestion fields.

5. Docker Deployment

docker build -t rocket-tools .
docker run -p 8000:8000 rocket-tools

Architecture

rocket_tools/
├── schemas/        # Pydantic models for all 30 tool inputs/outputs
├── utils/          # Units, validation, caching, safe_eval
├── materials/      # 49+ materials + ISA atmosphere
├── structural/     # Beam mechanics, section properties, buckling (Numba JIT)
├── aerodynamics/   # Re, Mach, q, CL, CD, Cf, compressible flow, aircraft perf, nozzle (Numba JIT)
├── design/         # Rocket ΔV, staging, orbital velocity, payload fraction, tank sizing, CG
├── router/         # Natural language intent + parameter extraction
├── memory/         # Session store for contextual conversations
├── workflows/      # YAML workflow engine + safe interpolation
├── config.py       # pydantic-settings configuration (ROCKET_* env vars)
├── server.py       # FastMCP tool definitions with schema validation
├── asgi.py         # Production SSE + health/metrics endpoints
└── rust_kernels/   # Rust PyO3 extension (scaffolded, deferred)

Numba JIT accelerates all hot paths. Pydantic schemas validate every tool input. Structured errors tell you exactly what went wrong and how to fix it.


Skills Library

Human-readable engineering references in skills/:

Each skill includes formulas, MCP tool cross-references, worked Python examples, and common pitfalls.


Roadmap

PhaseStatusFeatures
Phase 1✅ CompleteCore tools, tests, benchmarks, skills
Phase 2✅ Mostly CompleteRouter (11 intents), workflows, session memory, uncertainty propagation, structural & aerodynamic expansion
Phase 3📋 PlannedVisual intelligence (plots/diagrams), design optimization, standards compliance
Phase 4📋 PlannedKnowledge graph, FMEA, multi-agent sessions, plugin architecture

Contributing

We welcome contributions. See CONTRIBUTING.md for:

  • Development environment setup
  • Running the test suite
  • Code style (ruff, mypy)
  • Adding new materials
  • Adding new tools
  • Pull request process

Quick start for contributors:

git clone https://github.com/benajaero/rocket-tools.git
cd rocket-tools
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest -v                    # 240 tests
pytest --benchmark-only -v   # 18 benchmarks
ruff check src/ tests/       # lint
mypy src/rocket_tools/       # type check

License

Apache-2.0 — See LICENSE


Built by Human Engine labs for the agentic era.


For AI Agents

MCP Tool Manifest

This repository exposes 35 tools via FastMCP:

Structural Analysis

ToolSchemaDescription
beam_analysisBeamAnalysisInputStructural beam analysis with bending, deflection, shear, buckling
section_propertiesSectionPropertiesInputCross-section properties for 7 shapes (I-beam, C-channel, T-section, etc.)
column_bucklingColumnBucklingInputEuler-Johnson column buckling with effective length factors
plate_buckling_coefficientPlateBucklingInputBuckling coefficient k for plates under compression, shear, or bending
margin_of_safetyMarginOfSafetyInputAerospace margin of safety: MS = (Allowable / (FOS × Actual)) − 1
von_mises_stressVonMisesInputVon Mises equivalent stress and principal stresses for combined loading
combined_margin_of_safetyCombinedMarginInputMargin of safety for combined stress states using von Mises
deflection_marginDeflectionMarginInputMargin of safety against deflection limits (L/360, L/500, etc.)
truss_analysisTrussAnalysisInput2D/3D pin-jointed truss analysis via direct stiffness method

Aerodynamics

ToolSchemaDescription
aero_analysisAeroAnalysisInputComprehensive aerodynamic characterization (Re, Mach, q, CL, CD, Cf)
reynolds_numberReynoldsNumberInputReynolds number from velocity, altitude, and characteristic length
mach_numberMachNumberInputMach number at altitude
dynamic_pressureDynamicPressureInputDynamic pressure q = ½ρV²
lift_coefficientLiftCoefficientInputCL from lift, velocity, altitude, area
drag_coefficientDragCoefficientInputCD from drag, velocity, altitude, area
skin_friction_coefficientSkinFrictionInputBlasius skin friction (laminar / turbulent)

Compressible Flow

ToolSchemaDescription
isentropic_flowIsentropicFlowInputIsentropic relations: T/T0, P/P0, ρ/ρ0, A/A*
normal_shockNormalShockInputNormal shock relations: downstream Mach, pressure/temperature/density ratios
oblique_shockObliqueShockInputOblique shock wave angle for weak/strong solutions
prandtl_meyerPrandtlMeyerInputPrandtl-Meyer expansion angle from Mach number
prandtl_meyer_from_anglePrandtlMeyerInverseInputMach number from Prandtl-Meyer expansion angle

Aircraft Performance

ToolSchemaDescription
lift_curve_slopeLiftCurveSlopeInputSubsonic/supersonic lift curve slope a = dCL/dα
drag_polarDragPolarInputDrag coefficient with compressibility and wave drag
breguet_rangeBreguetRangeInputBreguet range equation for jet and propeller aircraft
breguet_enduranceBreguetEnduranceInputBreguet endurance equation
wing_loadingWingLoadingInputWing loading W/S with stall speed estimate

Rocket Nozzle Design

ToolSchemaDescription
nozzle_performanceNozzlePerformanceInputThrust, Isp, thrust coefficient, expansion state
optimal_area_ratioOptimalAreaRatioInputOptimal A/A* for matched expansion to ambient pressure

Mission Design

ToolSchemaDescription
rocket_delta_vRocketDeltaVInputTsiolkovsky rocket equation ΔV
multi_stage_delta_vMultiStageDeltaVInputSerial multi-stage rocket ΔV with mass ratios
orbital_velocityOrbitalVelocityInputCircular and escape velocity for planets
payload_fractionPayloadFractionInputMission payload fraction from ΔV, Isp, and inert mass fraction
thrust_to_weightThrustToWeightInputThrust-to-weight ratio with hover/climb capability
composite_cgCompositeCGInputCenter of gravity and mass moments for composite bodies
propellant_tank_sizingPropellantTankSizingInputTank mass, wall thickness, and dimensions for cylinder/sphere/ellipsoid

Materials & Utilities

ToolSchemaDescription
material_lookupMaterialLookupInputLook up 49+ aerospace materials by name
isa_atmosphereISAAtmosphereInputStandard atmosphere properties 0–25,000 m
unit_convertUnitConvertInputNIST-traceable unit conversion

ASGI Deployment

uvicorn rocket_tools.asgi:app --host 0.0.0.0 --port 8000

Endpoints:

  • GET /sse — MCP SSE transport
  • GET /health — {"status": "ok", "version": "0.3.3"}
  • GET /ready — {"status": "ready", "tools": 35}
  • GET /metrics — Prometheus metrics

Natural Language Routing

from rocket_tools.router import route_query
result = route_query("Calculate Reynolds number at 100 m/s, 5000 m, length 2 m")
# result.tool_name == 'reynolds_number'
# result.params == {'velocity': 100.0, 'altitude_m': 5000.0, 'characteristic_length': 2.0}

Schema Files

  • src/rocket_tools/schemas/structural.py — Beam, section, and buckling schemas
  • src/rocket_tools/schemas/aerodynamics.py — Aerodynamics, compressible flow, aircraft, and nozzle schemas
  • src/rocket_tools/schemas/materials.py — Materials & unit conversion schemas
  • src/rocket_tools/schemas/design.py — Mission design and performance schemas
Ver o original no GitHub

Bom para

Relacionados