The Aerospace MCP server provides comprehensive aerospace engineering capabilities for flight planning, orbital mechanics, and aerodynamic analysis, accessible via HTTP API and Model Context Protocol (MCP).
Core Flight Operations:
Search airports by IATA code or city name with optional country filtering
Plan complete flight routes with performance estimates for specific aircraft types
Calculate great circle distances between geographic coordinates with polyline generation
Retrieve aircraft performance data using OpenAP models, including fuel consumption and flight time
Advanced Aerospace Analysis:
Aerodynamics: Wing analysis (VLM), airfoil polar generation, stability derivatives calculation, and propeller performance analysis (BEMT)
Atmospheric Modeling: International Standard Atmosphere (ISA) profiles and wind condition modeling
Coordinate Systems: Convert between aerospace reference frames (ECEF, ECI, geodetic)
Rocketry: 3DOF trajectory simulation, rocket sizing estimation, and launch optimization
Orbital Mechanics: Orbital element conversions, satellite orbit propagation (including J2 perturbations), ground track calculation, Hohmann transfers, and trajectory optimization using genetic algorithms and Monte Carlo analysis
UAV Operations: Energy consumption and endurance estimation
System Features:
Flexible search types with automatic detection
Customizable flight planning parameters (aircraft mass, cruise altitude, route resolution)
System status monitoring and capability verification
Provides access to IATA airport codes and standards for flight planning operations, enabling intelligent airport resolution and routing calculations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Aerospace MCPplan a flight from New York to London with a Boeing 787"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Aerospace MCP - Flight Planning API & MCP Server
A comprehensive aerospace research and flight planning service providing both HTTP API and Model Context Protocol (MCP) integration. Built with FastMCP for streamlined MCP server development. Features intelligent airport resolution, great-circle route calculation, aircraft performance estimation, atmospheric modeling, coordinate frame transformations, aerodynamic analysis, propeller performance modeling, rocket trajectory optimization, orbital mechanics calculations, and spacecraft trajectory planning for aerospace operations.
β οΈ SAFETY DISCLAIMER
THIS SOFTWARE IS FOR EDUCATIONAL, RESEARCH, AND DEVELOPMENT PURPOSES ONLY
NOT FOR REAL NAVIGATION: Do not use for actual flight planning or navigation
NOT CERTIFIED: This system is not certified by any aviation authority
ESTIMATES ONLY: Performance calculations are theoretical estimates
NO WEATHER DATA: Does not account for weather, NOTAMs, or airspace restrictions
NO LIABILITY: Authors assume no responsibility for any consequences of use
For real flight planning, always use certified aviation software and consult official sources including NOTAMs, weather reports, and air traffic control.
Related MCP server: Aviation Model Context Protocol
π Quick Start
Option 1: UV (Recommended)
# Install UV (fast Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
uv venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
uv sync
# Copy env and configure (optional but recommended)
cp .env.example .env
# Edit .env as needed (host/port/log level, optional LLM tools)
# Run HTTP server (package entrypoint)
uv run aerospace-mcp-http
# Alternatively (developer style)
uvicorn main:app --reload --host 0.0.0.0 --port 8080
# Test the API
curl "http://localhost:8080/health"Option 2: Docker
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
docker build -t aerospace-mcp .
docker run -p 8080:8080 aerospace-mcp
# Test the API
curl "http://localhost:8080/health"Option 3: MCP Client (Claude Desktop)
Add to your Claude Desktop configuration:
{
"mcpServers": {
"aerospace-mcp": {
"command": "uv",
"args": ["run", "aerospace-mcp"],
"cwd": "/path/to/aerospace-mcp",
"env": {
"LLM_TOOLS_ENABLED": "true",
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}Note: The env section is optional and only needed if you want to enable the AI-powered agent tools for enhanced user experience.
MCP via CLI
# Start the MCP server (stdio)
uv run aerospace-mcp
# Start in SSE mode (optional)
uv run aerospace-mcp sse 0.0.0.0 8001π Table of Contents
β¨ Features
Core Capabilities
Airport Resolution: Intelligent city-to-airport mapping with 28,000+ airports worldwide
Route Planning: Great-circle distance calculation with geodesic precision
Performance Estimation: Aircraft-specific fuel and time calculations via OpenAP
Atmospheric Modeling: ISA atmosphere profiles with optional enhanced precision
Coordinate Transformations: ECEF, ECI, geodetic frame conversions for aerospace analysis
Multiple Interfaces: HTTP REST API and Model Context Protocol (MCP) support
Real-time Processing: Sub-second response times for flight planning requests
Space & Orbital Mechanics Capabilities
π°οΈ Orbital Elements & State Vectors: Convert between Keplerian elements and Cartesian state vectors
π Orbit Propagation: Numerical integration with J2 perturbations using RK4 method
πΊοΈ Ground Track Computation: Calculate satellite ground tracks for mission planning
π Hohmann Transfers: Calculate optimal two-impulse orbital transfers
π€ Orbital Rendezvous: Plan multi-maneuver rendezvous sequences
π― Trajectory Optimization: Genetic algorithms and particle swarm optimization
π Uncertainty Analysis: Monte Carlo sampling for trajectory robustness assessment
π Lambert Problem: Two-body trajectory determination for given time-of-flight
Supported Operations
β Airport search by city name or IATA code
β Flight route planning with polyline generation
β Aircraft performance estimation (190+ aircraft types)
β Fuel consumption and flight time calculations
β Great-circle distance calculations
β Multi-leg journey planning
β Aircraft comparison analysis
β Atmospheric profile calculation (ISA standard atmosphere)
β Wind profile modeling (logarithmic/power law)
β Coordinate frame transformations (ECEF, ECI, geodetic)
β Wing aerodynamics analysis (VLM, lifting line theory)
β Airfoil polar generation and database access
β Aircraft stability derivatives calculation
β Propeller performance analysis (BEMT)
β UAV energy optimization and endurance estimation
β Motor-propeller matching analysis
β 3DOF rocket trajectory simulation with atmosphere integration
β Rocket sizing estimation for mission planning
β Launch angle optimization for maximum performance
β Thrust profile optimization using gradient descent
β Trajectory sensitivity analysis for design studies
β System capability discovery and status reporting
β Orbital mechanics calculations (Keplerian elements, state vectors, propagation)
β Ground track computation for satellite tracking and visualization
β Hohmann transfer planning for orbital maneuvers and mission design
β Orbital rendezvous planning for spacecraft proximity operations
β Trajectory optimization using genetic algorithms and particle swarm optimization
β Monte Carlo uncertainty analysis for trajectory robustness assessment
β Lambert problem solving for two-body trajectory determination
β Porkchop plot generation for interplanetary transfer opportunity analysis
β Optional SPICE integration with fallback to simplified ephemeris models
β Density altitude calculation for performance planning
β Airspeed conversions (IAS/CAS/EAS/TAS/Mach)
β Stall speed calculation for different configurations
β Weight and balance calculations with CG limits
β Takeoff/landing performance distance and V-speeds
β Fuel reserve calculation per FAR/ICAO regulations
β Kalman filter state estimation for sensor fusion
β LQR controller design for optimal control
Technical Features
π Fast: In-memory airport database for microsecond lookups
π§ Flexible: Pluggable backend system (currently OpenAP)
π Accurate: Uses WGS84 geodesic calculations
π Standards: Follows ICAO aircraft codes and IATA airport codes
π Reliable: Comprehensive error handling and graceful degradation
π Well-documented: Complete API documentation with examples
β‘ Hardware Optimized: NumPy vectorization with CuPy GPU acceleration support
π Batch Processing: Vectorized operations for efficient bulk calculations
π Tool Discovery: Dynamic tool search for finding relevant tools from 44+ available
πΎ Installation
System Requirements
Python: 3.11+ (3.12+ recommended for best performance)
Memory: 512MB RAM minimum (1GB+ recommended)
Storage: 200MB free space
Network: Internet connection for initial setup
Method 1: UV Package Manager (Recommended)
UV is the fastest Python package manager and provides excellent dependency resolution:
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux/macOS
# Or: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
# Clone repository
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
# Create virtual environment
uv venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# Install dependencies
uv add fastapi uvicorn[standard] airportsdata geographiclib pydantic python-dotenv
uv add openap # Optional: for performance estimates
uv add mcp # Optional: for MCP server functionality
# Install optional aerospace analysis dependencies
uv add --optional-dependencies atmosphere # Ambiance for enhanced ISA
uv add --optional-dependencies space # Astropy for coordinate frames
uv add --optional-dependencies all # All optional dependencies
# Install development dependencies (optional)
uv add --dev pytest httpx black isort mypy pre-commit
# Verify installation
python -c "import main; print('β
Installation successful')"Method 2: Pip (Traditional)
# Clone repository
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# Upgrade pip
pip install --upgrade pip
# Install core dependencies
pip install fastapi uvicorn[standard] airportsdata geographiclib pydantic python-dotenv
# Install optional dependencies
pip install openap # For performance estimates
pip install mcp # For MCP server
pip install python-dotenv # For loading .env in local/dev
# Install from pyproject.toml
pip install -e .
# Verify installation
python -c "import main; print('β
Installation successful')"Method 3: Docker
# Clone repository
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
# Build image
docker build -t aerospace-mcp .
# Run container
docker run -d -p 8080:8080 --name aerospace-mcp aerospace-mcp
# Health check
curl http://localhost:8080/health
# View logs
docker logs aerospace-mcp
# Stop container
docker stop aerospace-mcpMethod 4: Conda/Mamba
# Create conda environment
conda create -n aerospace-mcp python=3.11
conda activate aerospace-mcp
# Clone repository
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
# Install dependencies
conda install fastapi uvicorn pydantic
pip install airportsdata geographiclib openap mcp
# Verify installation
python -c "import main; print('β
Installation successful')"Troubleshooting Installation
Common Issues
OpenAP Installation Problems:
# Try these alternatives if OpenAP fails to install
pip install openap --no-cache-dir
pip install openap --force-reinstall
# Or install without OpenAP (performance estimates will be unavailable)GeographicLib Issues:
# Install system dependencies (Ubuntu/Debian)
sudo apt-get install libproj-dev proj-data proj-bin
# Install system dependencies (macOS)
brew install proj
# Install system dependencies (Windows)
# Download from: https://proj.org/download.htmlImport Errors:
# Verify your Python environment
python --version # Should be 3.11+
pip list | grep -E "(fastapi|openap|airportsdata)"
# Test individual imports
python -c "import fastapi; print('FastAPI OK')"
python -c "import airportsdata; print('AirportsData OK')"
python -c "import openap; print('OpenAP OK')" || echo "OpenAP not available (optional)"π― Usage Examples
HTTP API Examples
Basic Flight Planning
# Plan a simple flight
curl -X POST "http://localhost:8080/plan" \
-H "Content-Type: application/json" \
-d '{
"depart_city": "San Francisco",
"arrive_city": "New York",
"ac_type": "A320",
"cruise_alt_ft": 37000,
"backend": "openap"
}'Airport Search
# Find airports by city
curl "http://localhost:8080/airports/by_city?city=Tokyo"
# Filter by country
curl "http://localhost:8080/airports/by_city?city=London&country=GB"
# Multiple results
curl "http://localhost:8080/airports/by_city?city=Paris"Advanced Flight Planning
# Specify exact airports and aircraft mass
curl -X POST "http://localhost:8080/plan" \
-H "Content-Type: application/json" \
-d '{
"depart_city": "Los Angeles",
"arrive_city": "Tokyo",
"prefer_depart_iata": "LAX",
"prefer_arrive_iata": "NRT",
"ac_type": "B777",
"cruise_alt_ft": 39000,
"mass_kg": 220000,
"route_step_km": 100.0,
"backend": "openap"
}'Python Client Examples
Simple Client
import requests
import json
class AerospaceClient:
def __init__(self, base_url="http://localhost:8080"):
self.base_url = base_url
def plan_flight(self, departure, arrival, aircraft="A320", altitude=35000):
"""Plan a flight between two cities."""
response = requests.post(f"{self.base_url}/plan", json={
"depart_city": departure,
"arrive_city": arrival,
"ac_type": aircraft,
"cruise_alt_ft": altitude,
"backend": "openap"
})
return response.json()
def find_airports(self, city, country=None):
"""Find airports in a city."""
params = {"city": city}
if country:
params["country"] = country
response = requests.get(f"{self.base_url}/airports/by_city", params=params)
return response.json()
# Usage
client = AerospaceClient()
# Find airports
airports = client.find_airports("Sydney", "AU")
print(f"Sydney has {len(airports)} airports")
# Plan flight
plan = client.plan_flight("Sydney", "Melbourne", "B737")
print(f"Flight distance: {plan['distance_nm']:.0f} NM")
print(f"Flight time: {plan['estimates']['block']['time_min']:.0f} minutes")Batch Processing
import asyncio
import aiohttp
from typing import List, Dict
async def plan_multiple_flights(flights: List[Dict]) -> List[Dict]:
"""Plan multiple flights concurrently."""
async with aiohttp.ClientSession() as session:
tasks = []
for flight in flights:
task = plan_single_flight(session, flight)
tasks.append(task)
results = await asyncio.gather(*tasks, return_exceptions=True)
return results
async def plan_single_flight(session, flight_data):
"""Plan a single flight."""
async with session.post(
"http://localhost:8080/plan",
json=flight_data
) as response:
return await response.json()
# Example usage
flights_to_plan = [
{"depart_city": "New York", "arrive_city": "London", "ac_type": "A330"},
{"depart_city": "London", "arrive_city": "Dubai", "ac_type": "B777"},
{"depart_city": "Dubai", "arrive_city": "Singapore", "ac_type": "A350"}
]
# Run the batch planning
results = asyncio.run(plan_multiple_flights(flights_to_plan))
for i, result in enumerate(results):
if not isinstance(result, Exception):
print(f"Flight {i+1}: {result['distance_nm']:.0f} NM, {result['estimates']['block']['time_min']:.0f} min")Orbital Mechanics Examples
Python Examples
import requests
class OrbitalMechanicsClient:
def __init__(self, base_url="http://localhost:8080"):
self.base_url = base_url
def plan_hohmann_transfer(self, r1_km, r2_km):
"""Calculate Hohmann transfer between two circular orbits."""
response = requests.post(f"{self.base_url}/hohmann_transfer", json={
"r1_m": r1_km * 1000, # Convert to meters
"r2_m": r2_km * 1000
})
return response.json()
def propagate_satellite_orbit(self, elements, duration_hours):
"""Propagate satellite orbit with J2 perturbations."""
response = requests.post(f"{self.base_url}/propagate_orbit_j2", json={
"initial_state": elements,
"time_span_s": duration_hours * 3600,
"time_step_s": 300 # 5-minute steps
})
return response.json()
# Example usage
client = OrbitalMechanicsClient()
# Plan a GTO to GEO transfer
gto_alt = 200 # km (perigee)
geo_alt = 35786 # km (GEO altitude)
transfer = client.plan_hohmann_transfer(
6378 + gto_alt, # Earth radius + altitude
6378 + geo_alt
)
print(f"Transfer Delta-V: {transfer['delta_v_total_ms']/1000:.2f} km/s")
print(f"Transfer Time: {transfer['transfer_time_h']:.1f} hours")
# Propagate ISS orbit for one day
iss_elements = {
"semi_major_axis_m": 6793000, # ~415 km altitude
"eccentricity": 0.0001,
"inclination_deg": 51.6,
"raan_deg": 0.0,
"arg_periapsis_deg": 0.0,
"true_anomaly_deg": 0.0,
"epoch_utc": "2024-01-01T12:00:00"
}
orbit_states = client.propagate_satellite_orbit(iss_elements, 24)
print(f"Propagated {len(orbit_states)} orbital states over 24 hours")Trajectory Optimization Example
# Optimize a lunar transfer trajectory
def optimize_lunar_transfer():
initial_trajectory = [
{
"time_s": 0,
"position_m": [6700000, 0, 0], # LEO
"velocity_ms": [0, 7500, 0]
},
{
"time_s": 86400 * 3, # 3 days
"position_m": [384400000, 0, 0], # Moon distance
"velocity_ms": [0, 1000, 0]
}
]
response = requests.post("http://localhost:8080/genetic_algorithm_optimization", json={
"initial_trajectory": initial_trajectory,
"objective": "minimize_delta_v",
"constraints": {
"max_thrust_n": 50000,
"max_acceleration_ms2": 10
}
})
result = response.json()
print(f"Optimized Delta-V: {result['total_delta_v_ms']/1000:.2f} km/s")
print(f"Flight Time: {result['flight_time_s']/86400:.1f} days")
return result
optimized_trajectory = optimize_lunar_transfer()
# Generate porkchop plot for Mars mission planning
def plan_mars_mission():
response = requests.post("http://localhost:8080/porkchop_plot_analysis", json={
"departure_body": "Earth",
"arrival_body": "Mars",
"min_tof_days": 200,
"max_tof_days": 300
})
analysis = response.json()
if analysis["summary_statistics"]["feasible_transfers"] > 0:
optimal = analysis["optimal_transfer"]
print(f"Optimal Mars Transfer:")
print(f" Launch: {optimal['departure_date']}")
print(f" Arrival: {optimal['arrival_date']}")
print(f" C3: {optimal['c3_km2_s2']:.2f} kmΒ²/sΒ²")
print(f" Flight Time: {optimal['time_of_flight_days']:.0f} days")
else:
print("No feasible transfers found in date range")
plan_mars_mission()JavaScript/TypeScript Examples
interface FlightPlan {
depart_city: string;
arrive_city: string;
ac_type: string;
cruise_alt_ft?: number;
backend: "openap";
}
class AerospaceAPI {
constructor(private baseUrl: string = "http://localhost:8080") {}
async planFlight(request: FlightPlan) {
const response = await fetch(`${this.baseUrl}/plan`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(request),
});
if (!response.ok) {
throw new Error(`API Error: ${response.statusText}`);
}
return await response.json();
}
async findAirports(city: string, country?: string) {
const params = new URLSearchParams({ city });
if (country) params.append("country", country);
const response = await fetch(`${this.baseUrl}/airports/by_city?${params}`);
return await response.json();
}
}
// Usage
const api = new AerospaceAPI();
try {
const plan = await api.planFlight({
depart_city: "Boston",
arrive_city: "Seattle",
ac_type: "B737",
cruise_alt_ft: 36000,
backend: "openap"
});
console.log(`Flight planned: ${plan.distance_nm} NM`);
console.log(`Estimated time: ${plan.estimates.block.time_min} minutes`);
} catch (error) {
console.error("Flight planning failed:", error);
}ποΈ Architecture
System Overview
graph TB
Users[Users/Clients] --> API[FastAPI REST API]
Users --> MCP[MCP Server]
API --> Core[Core Services]
MCP --> Core
subgraph "Core Services"
Airport[Airport Resolution]
Route[Route Calculation]
Perf[Performance Estimation]
end
subgraph "Data Sources"
AirportDB[Airport Database<br/>28,000+ airports]
OpenAP[OpenAP Models<br/>190+ aircraft]
Geodesic[GeographicLib<br/>WGS84 calculations]
end
Airport --> AirportDB
Route --> Geodesic
Perf --> OpenAPKey Components
FastAPI Application (
main.py)RESTful endpoints for HTTP clients
Auto-generated OpenAPI documentation
Request/response validation with Pydantic
MCP Server (
aerospace_mcp/fastmcp_server.py)Model Context Protocol implementation via FastMCP
Tool-based interface for AI assistants
Async request handling
Core Services
Airport Resolution: City β Airport mapping with intelligent selection
Route Calculation: Great-circle paths with polyline generation
Performance Estimation: OpenAP-based fuel and time calculations
Data Layer
In-memory Airport Database: 28,000+ airports loaded at startup
OpenAP Integration: Aircraft performance models
GeographicLib: Precise geodesic calculations
Design Principles
Performance First: In-memory data structures for sub-millisecond lookups
Graceful Degradation: Works without optional dependencies
Type Safety: Full type hints and Pydantic validation
Extensible: Plugin architecture for new backends
Standards Compliant: ICAO, IATA, and OpenAP standards
Hardware Agnostic: NumPy/CuPy abstraction for CPU/GPU flexibility
π FastMCP Migration
This project has been migrated from the traditional MCP SDK to FastMCP, providing significant improvements in developer experience and code maintainability.
What is FastMCP?
FastMCP is a high-level, Pythonic framework for building Model Context Protocol servers. It dramatically reduces boilerplate code while maintaining full MCP compatibility.
Migration Benefits
β 70% Less Code: Tool definitions went from verbose JSON schemas to simple Python decorators β Better Type Safety: Automatic schema generation from type hints β Cleaner Architecture: Modular tool organization across logical domains β Improved Maintainability: Pythonic code that's easier to read and extend β Full Compatibility: Same MCP protocol, works with all existing clients
Before vs After
Before (Traditional MCP SDK):
Tool(
name="search_airports",
description="Search for airports by IATA code or city name",
inputSchema={
"type": "object",
"properties": {
"query": {"type": "string", "description": "IATA code or city name"},
"country": {"type": "string", "description": "Optional country filter"},
"query_type": {"type": "string", "enum": ["iata", "city", "auto"]}
},
"required": ["query"]
}
)
@server.call_tool()
async def handle_call_tool(name: str, arguments: dict):
if name == "search_airports":
return await _handle_search_airports(arguments)
# ... 40+ more tool handlersAfter (FastMCP):
@mcp.tool
def search_airports(
query: str,
country: str | None = None,
query_type: Literal["iata", "city", "auto"] = "auto"
) -> str:
"""Search for airports by IATA code or city name."""
# Implementation hereArchitecture Improvements
The FastMCP refactoring introduced a modular architecture with tools organized by domain:
tools/core.py- Core flight planning (search, plan, distance, performance)tools/atmosphere.py- Atmospheric modeling and wind analysistools/frames.py- Coordinate frame transformationstools/aerodynamics.py- Wing analysis and airfoil polarstools/propellers.py- Propeller BEMT and UAV energy analysistools/rockets.py- Rocket trajectory and sizingtools/orbits.py- Orbital mechanics and propagationtools/optimization.py- Trajectory optimization algorithms
Integration modules with NumPy vectorization:
integrations/_array_backend.py- NumPy/CuPy abstraction layer for GPU supportintegrations/atmosphere.py- Vectorized ISA atmosphere calculationsintegrations/aero.py- Vectorized aerodynamics computationsintegrations/rockets.py- Vectorized trajectory integrationintegrations/frames.py- Vectorized coordinate transformations
Compatibility Notes
Entry Point: Now uses
aerospace_mcp.fastmcp_server:runDependencies: Includes
fastmcp>=2.11.3instead of rawmcpServer Name: Still
aerospace-mcpfor client compatibilityAll Tools: All 44 tools maintain exact same names and parameters
βοΈ Configuration (.env)
Both the HTTP server and MCP servers automatically load environment variables from a local .env (via python-dotenv).
AEROSPACE_MCP_MODE:httpormcp(Docker entrypoint switch)AEROSPACE_MCP_HOST: Bind host for HTTP (default0.0.0.0)AEROSPACE_MCP_PORT: Port for HTTP (default8080)AEROSPACE_MCP_LOG_LEVEL:debug|info|warning|error(defaultinfo)AEROSPACE_MCP_ENV:development|production(controls reload)LLM_TOOLS_ENABLED:true|falseto enable AI agent tools (defaultfalse)OPENAI_API_KEY: Required if LLM tools are enabled
Example .env:
AEROSPACE_MCP_MODE=http
AEROSPACE_MCP_HOST=0.0.0.0
AEROSPACE_MCP_PORT=8080
AEROSPACE_MCP_LOG_LEVEL=debug
LLM_TOOLS_ENABLED=false
# OPENAI_API_KEY=sk-...β‘ Performance
Benchmarks
Operation | Response Time | Throughput | Memory Usage |
Health Check | < 1ms | 10,000+ req/sec | ~5MB |
Airport Search | 1-5ms | 1,000+ req/sec | ~50MB |
Flight Planning | 200-500ms | 5-10 req/sec | ~100MB |
Distance Calc | 10-50ms | 100+ req/sec | ~50MB |
Optimization Tips
Route Resolution: Use larger
route_step_kmvalues for faster processingCaching: Implement client-side caching for repeated requests
Batch Processing: Use async clients for multiple concurrent requests
Memory: Increase available RAM for better OpenAP performance
Scaling Considerations
Horizontal Scaling: Stateless design allows multiple instances
Load Balancing: Standard HTTP load balancers work well
Database: Consider external database for airport data at scale
Caching: Add Redis for shared cache across instances
GPU Acceleration (CuPy)
The aerospace calculations are optimized using NumPy's vectorized operations, with a drop-in CuPy backend for GPU acceleration on CUDA-capable hardware.
Enabling GPU Acceleration
# In your code, before using aerospace functions:
from aerospace_mcp.integrations._array_backend import set_backend, get_backend_info
# Check available backends
print(get_backend_info())
# {'current_backend': 'numpy', 'numpy_available': True, 'cupy_available': True, ...}
# Switch to GPU (requires CuPy and CUDA)
set_backend('cupy')
# Switch back to CPU
set_backend('numpy')Installing CuPy
# For CUDA 11.x
pip install cupy-cuda11x
# For CUDA 12.x
pip install cupy-cuda12x
# Auto-detect CUDA version
pip install cupyModules with GPU Support
The following integration modules support GPU acceleration via the array backend:
Module | Operations | Speedup (GPU vs CPU) |
| ISA calculations, wind profiles | 10-50x for large batches |
| Wing analysis, airfoil polars | 5-20x for alpha sweeps |
| Trajectory integration, performance analysis | 3-10x |
| Coordinate transformations (batch) | 20-100x for large datasets |
Note: GPU acceleration provides the most benefit for batch operations with 1000+ data points. For single calculations, CPU (NumPy) is typically faster due to GPU transfer overhead.
π API Documentation
Interactive Documentation
When running the server, comprehensive API documentation is available at:
Swagger UI: http://localhost:8080/docs
ReDoc: http://localhost:8080/redoc
OpenAPI Schema: http://localhost:8080/openapi.json
Core Endpoints
GET /health
Health check and system status.
Response:
{
"status": "ok",
"openap": true,
"airports_count": 28756
}GET /airports/by_city
Search airports by city name.
Parameters:
city(required): City name to searchcountry(optional): ISO country code filter
Example: GET /airports/by_city?city=London&country=GB
POST /plan
Generate complete flight plan.
Request Body:
{
"depart_city": "San Francisco",
"arrive_city": "New York",
"ac_type": "A320",
"cruise_alt_ft": 37000,
"mass_kg": 65000,
"route_step_km": 25.0,
"backend": "openap"
}Response: Complete flight plan with route polyline and performance estimates.
Error Handling
All endpoints return standard HTTP status codes:
200: Success400: Bad Request (invalid parameters)404: Not Found (airport/city not found)501: Not Implemented (backend unavailable)
Error responses include detailed messages:
{
"detail": "departure: IATA 'XYZ' not found."
}π€ MCP Integration
Supported MCP Clients
Claude Desktop: Native integration
VS Code Continue: Plugin support
Custom Clients: Standard MCP protocol
Available Tools
Tool | Description | Parameters |
| Find airports by IATA or city |
|
| Complete flight planning |
|
| Great-circle distance |
|
| Performance estimates |
|
| ISA atmosphere conditions |
|
| Wind profile calculation |
|
| Coordinate transformations |
|
| Lat/lon to ECEF conversion |
|
| ECEF to lat/lon conversion |
|
| Wing aerodynamics analysis (VLM) |
|
| Airfoil polar generation |
|
| Stability derivatives calculation |
|
| Propeller performance (BEMT) |
|
| UAV endurance and energy analysis |
|
| Available airfoil coefficients | None |
| Available propeller data | None |
| 3DOF rocket trajectory simulation |
|
| Rocket sizing for mission requirements |
|
| Launch angle optimization |
|
| Thrust profile optimization |
|
| Parameter sensitivity analysis |
|
| System health and capabilities | None |
| Convert orbital elements to state vector |
|
| Convert state vector to orbital elements |
|
| Propagate orbit with J2 perturbations |
|
| Calculate satellite ground track |
|
| Calculate Hohmann transfer orbit |
|
| Plan orbital rendezvous maneuvers |
|
| Trajectory optimization using GA |
|
| Trajectory optimization using PSO |
|
| Monte Carlo trajectory uncertainty analysis |
|
| Generate porkchop plot for interplanetary transfers |
|
| Search for tools by name, description, or functionality |
|
| List all available tool categories with counts | None |
| Solve Lambert's problem for orbital transfers |
|
| Calculate density altitude from pressure altitude and temperature |
|
| Convert between IAS/CAS/EAS/TAS/Mach |
|
| Calculate stall speeds for different configurations |
|
| Calculate aircraft weight and CG position |
|
| Calculate takeoff distances and V-speeds |
|
| Calculate landing distances and approach speeds |
|
| Calculate required fuel reserves per regulations |
|
| State estimation using Kalman filter |
|
| Design LQR optimal controller |
|
Claude Desktop Setup
Open Claude Desktop Settings
Add server configuration:
{
"mcpServers": {
"aerospace-mcp": {
"command": "uv",
"args": ["run", "aerospace-mcp"],
"cwd": "/path/to/aerospace-mcp"
}
}
}Restart Claude Desktop
Test with: "Search for airports in Tokyo"
Tool Discovery
With 44+ aerospace tools available, the MCP server includes a tool search tool following Anthropic's guide for dynamic tool discovery:
# Search by natural language
search_aerospace_tools("atmospheric pressure altitude")
# Returns: get_atmosphere_profile, wind_model_simple, ...
# Search by regex pattern
search_aerospace_tools("(?i)orbit", search_type="regex")
# Returns: propagate_orbit_j2, elements_to_state_vector, hohmann_transfer, ...
# Filter by category
search_aerospace_tools("calculate", category="orbits")
# Returns only orbital mechanics tools matching "calculate"
# List all categories
list_tool_categories()
# Returns: core, atmosphere, frames, aerodynamics, propellers, rockets, orbits, gnc, performance, optimization, agentsAvailable categories:
core: Flight planning, airports, distance, aircraft performance
atmosphere: ISA profiles, wind modeling
frames: Coordinate transformations (ECEF, ECI, geodetic)
aerodynamics: Wing analysis, airfoil polars, stability derivatives
propellers: BEMT analysis, UAV energy estimation
rockets: 3DOF trajectory, sizing, launch optimization
orbits: Orbital elements, propagation, transfers, rendezvous, Lambert solver
optimization: GA, PSO, Monte Carlo, porkchop plots
gnc: Kalman filter state estimation, LQR controller design
performance: Density altitude, airspeed conversion, stall speeds, W&B, takeoff/landing
agents: LLM-powered tool selection and data formatting
Deferred Tool Loading
For applications with many tools, aerospace-mcp supports deferred tool loading to keep context windows efficient. When using the Anthropic API with MCP, configure your mcp_toolset to defer loading of all tools except the discovery tools:
{
"tools": [
{
"type": "tool_search_tool_regex_20251119",
"name": "tool_search_tool_regex"
},
{
"type": "mcp_toolset",
"mcp_server_name": "aerospace-mcp",
"default_config": {
"defer_loading": true
},
"configs": {
"search_aerospace_tools": { "defer_loading": false },
"list_tool_categories": { "defer_loading": false }
}
}
]
}This configuration:
Loads discovery tools immediately (
search_aerospace_tools,list_tool_categories)Defers all other tools until Claude searches for them
Automatically expands
tool_referenceblocks from search results into full definitions
When Claude needs a specific tool, it uses search_aerospace_tools which returns tool_reference blocks:
{
"tool_references": [
{ "type": "tool_reference", "tool_name": "hohmann_transfer" },
{ "type": "tool_reference", "tool_name": "propagate_orbit_j2" }
]
}The API automatically expands these references into full tool definitions, keeping context efficient while providing access to all 44+ tools.
VS Code Continue Setup
Add to your config.json:
{
"mcpServers": [
{
"name": "aerospace-mcp",
"command": "uv",
"args": ["run", "aerospace-mcp"],
"workingDirectory": "/path/to/aerospace-mcp"
}
]
}π οΈ Development
Development Setup
# Clone and setup
git clone https://github.com/cheesejaguar/aerospace-mcp.git
cd aerospace-mcp
# Create development environment
uv venv
source .venv/bin/activate
uv add --dev pytest httpx black isort mypy pre-commit
# Install pre-commit hooks
pre-commit install
# Run development server
uvicorn main:app --reload --log-level debugTesting
# Run all tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html
# Run specific test file
pytest tests/test_main.py -v
# Performance testing
pytest tests/test_performance.py -vCode Quality
# Format code
black . && isort .
# Type checking
mypy main.py aerospace_mcp/
# Linting
ruff check .
# Pre-commit (runs all checks)
pre-commit run --all-filesProject Structure
aerospace-mcp/
βββ main.py # FastAPI application
βββ aerospace_mcp/ # MCP server implementation
β βββ __init__.py
β βββ server.py # Legacy MCP server (deprecated)
β βββ fastmcp_server.py # FastMCP server entry point (primary)
β βββ core.py # Shared business logic
β βββ tools/ # MCP tool definitions
β β βββ core.py # Flight planning tools
β β βββ atmosphere.py # Atmospheric modeling tools
β β βββ aerodynamics.py # Wing & airfoil analysis
β β βββ frames.py # Coordinate transformations
β β βββ rockets.py # Rocket trajectory tools
β β βββ orbits.py # Orbital mechanics tools
β β βββ propellers.py # Propeller analysis tools
β β βββ optimization.py # Trajectory optimization
β β βββ gnc.py # GNC tools (Kalman filter, LQR)
β β βββ performance.py # Aircraft performance tools
β β βββ agents.py # LLM-powered agent tools
β β βββ tool_search.py # Tool discovery and search
β βββ integrations/ # Backend computation modules
β βββ _array_backend.py # NumPy/CuPy abstraction (GPU support)
β βββ atmosphere.py # Vectorized ISA calculations
β βββ aero.py # Vectorized aerodynamics
β βββ frames.py # Vectorized coordinate transforms
β βββ rockets.py # Vectorized trajectory integration
β βββ orbits.py # Orbital mechanics computations
β βββ propellers.py # Propeller BEMT analysis
βββ app/ # Alternative FastAPI structure
β βββ __init__.py
β βββ main.py
βββ tests/ # Test suite (412 tests)
β βββ conftest.py
β βββ test_main.py
β βββ test_airports.py
β βββ test_plan.py
β βββ test_mcp.py
β βββ test_integrations_*.py # Integration module tests
β βββ tools/ # Tool-specific tests
β βββ test_tools_performance.py # Performance tools tests
β βββ test_tools_gnc.py # GNC tools tests
β βββ test_tools_lambert.py # Lambert solver tests
βββ docs/ # Documentation
β βββ API.md
β βββ ARCHITECTURE.md
β βββ INTEGRATION.md
β βββ QUICKSTART.md
β βββ DEPLOYMENT.md
β βββ MCP_INTEGRATION.md
βββ pyproject.toml # Project configuration
βββ requirements.txt # Dependencies
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Multi-service setup
βββ README.md # This fileπ€ Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.
Quick Contributing Guide
Fork & Clone
git clone https://github.com/yourusername/aerospace-mcp.git cd aerospace-mcpSetup Development Environment
uv venv && source .venv/bin/activate uv add --dev pytest httpx black isort mypyMake Changes
Add features or fix bugs
Write tests for new functionality
Update documentation as needed
Test & Format
pytest black . && isort . mypy main.pySubmit Pull Request
Clear title and description
Reference any related issues
Ensure CI/CD checks pass
Areas for Contribution
New Aircraft Support: Add more aircraft types to OpenAP
Weather Integration: Add weather data sources
Route Optimization: Implement waypoint optimization
UI/Frontend: Web interface for flight planning
Database Backend: PostgreSQL/MongoDB integration
Performance: Optimization and caching improvements
GPU Optimization: Extend CuPy support to additional modules
Vectorization: Improve NumPy vectorization coverage
π Documentation
Complete Documentation
Quick Start Guide - Get up and running in 5 minutes
API Reference - Complete REST API documentation
MCP Integration - Model Context Protocol setup
Architecture Guide - System design and components
Deployment Guide - Production deployment strategies
Contributing Guide - Development and contribution guidelines
Integration Guide - Client integration examples
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Third-Party Acknowledgments
OpenAP: Aircraft performance modeling - TU Delft
AirportsData: Airport database - mborsetti
GeographicLib: Geodesic calculations - Charles Karney
FastAPI: Modern web framework - SebastiΓ‘n RamΓrez
π Support & Community
Getting Help
GitHub Issues: Bug reports and feature requests
GitHub Discussions: Questions and community support
Documentation: Comprehensive guides in
/docsExamples: Code examples and tutorials
Community
Discord: WIP for real-time chat
Professional Support
For enterprise support, consulting, or custom development:
Email: hello@aeroastro.org
Website: https://aeroastro.org
β Star this repository if you find it useful!
Built with β€οΈ for the aviation and software development communities.