Skip to main content
Glama

pterasim-mcp - UVLM + surrogate aerodynamics for MCP agents

TL;DR: Expose PteraSoftware's analytical/UVLM solvers through MCP so agents can request aerodynamic coefficients with provenance metadata.

Table of contents

  1. What it provides

  2. Quickstart

  3. Run as a service

  4. Agent playbook

  5. Stretch ideas

  6. Accessibility & upkeep

  7. Contributing

Related MCP server: OpenVSP MCP Server

What it provides

Scenario

Value

Surrogate aerodynamics

Evaluate lightweight rigid-vortex-lattice models without a GUI, returning aerodynamic coefficients as structured data.

High-fidelity UVLM

When PteraSoftware is installed, the service switches to its UVLM solver and records provenance metadata.

Controller integration

Provide consistent outputs that downstream MCP tools (e.g., ctrltest-mcp) can ingest for control and evidence pipelines.

Quickstart

1. Install

uv pip install "git+https://github.com/Three-Little-Birds/pterasim-mcp.git"

2. Run an analytic solve

from pterasim_mcp import PterasimInput, simulate_pterasim

request = PterasimInput(
    span_m=0.8,
    mean_chord_m=0.12,
    stroke_frequency_hz=12.0,
    stroke_amplitude_rad=0.55,
    cruise_velocity_m_s=6.0,
    air_density_kg_m3=1.225,
    cl_alpha_per_rad=6.2,
    cd0=0.03,
    planform_area_m2=0.18,
)
response = simulate_pterasim(request)
print(response.metadata["solver"])            # "analytic" or "pterasoftware_uvlm"
print(response.thrust_N, response.lift_N, response.torque_Nm)

Typical metadata payload:

```json
{
  "solver": "pterasoftware_uvlm",
  "thrust_delta_pct_vs_analytic": -4.1,
  "lift_delta_pct_vs_analytic": -2.7
}

If a Python 3.13 environment with `PteraSoftware` (≥3.2) is available, the wrapper will prefer UVLM and note the solver in the metadata. Install it inside a dedicated environment:

```bash
uv python install 3.13
uv venv .venv-pterasim --python 3.13
source .venv-pterasim/bin/activate
pip install pterasoftware==3.2.0
uv pip install "git+https://github.com/Three-Little-Birds/pterasim-mcp.git"

If the UVLM solve fails for any reason (missing binaries, convergence issues, or the current PteraSoftware regression that removes geometry.airfoil), the wrapper logs a warning and falls back to the analytic surrogate—you will see solver: "analytic" in the metadata and no delta fields. UVLM runs with thousands of timesteps can take minutes; batch analytic sweeps first and promote only promising cases to the high-fidelity environment. Analytic-only mode works on Python 3.11 without PteraSoftware. Until the UVLM API stabilizes upstream, treat the analytic path as the supported/default mode.

Run as a service

CLI (STDIO / Streamable HTTP)

uvx pterasim-mcp  # runs the MCP over stdio
# or python -m pterasim_mcp
python -m pterasim_mcp --transport streamable-http --host 0.0.0.0 --port 8000 --path /mcp

Use python -m pterasim_mcp --describe to emit metadata without starting the server.

FastAPI (REST)

uv run uvicorn pterasim_mcp.fastapi_app:create_app --factory --port 8003

python-sdk tool (STDIO / MCP)

from mcp.server.fastmcp import FastMCP
from pterasim_mcp.tool import build_tool

mcp = FastMCP("pterasim-mcp", "Wing UVLM & surrogate solver")
build_tool(mcp)

if __name__ == "__main__":
    mcp.run()

ToolHive smoke test

uvx --with 'mcp==1.20.0' python scripts/integration/run_pterasim.py
# ToolHive 2025+ defaults to Streamable HTTP; match that transport when registering
# the workload manually so IDE clients avoid the SSE 502 bug.

Agent playbook

  • Scenario sweeps - vary span, frequency, or flapping amplitude and log derivatives for control studies.

  • Solver comparison - leverage metadata to benchmark surrogate vs UVLM deltas and store the comparisons for regression dashboards.

  • Design flows - combine with openvsp-mcp to generate geometry + aerodynamics pipelines.

Stretch ideas

  1. Generate JSONL experiment logs that feed directly into ctrltest-mcp or reinforcement-learning agents.

  2. Use the metadata to route results into Grafana dashboards for solver provenance.

  3. Auto-promote surrogate runs to UVLM once a high-fidelity environment is detected.

Accessibility & upkeep

  • Tests simulate solver responses; run uv run pytest before pushing.

  • Keep .venv-pterasim aligned with the PteraSoftware version you report in metadata.

Contributing

  1. uv pip install --system -e .[dev]

  2. Run uv run ruff check . and uv run pytest

  3. Include sample metadata/CSV artefacts in PRs so reviewers can confirm provenance handling.

MIT license - see LICENSE.

Available Tools

1 tool
pterasim.simulateB

Generate aerodynamic coefficients with UVLM fallback. Supply wing geometry, flapping schedule, and timestep count. Returns forces, torques, and solver metadata. Example: {"span_m":0.8,"chord_m":0.12,"num_timesteps":180}

Inputs: request (required). Returns: lift_N, metadata, thrust_N, torque_Nm

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion or overlap between tools. The tool has a clear, singular purpose focused on aerodynamic simulation with specific inputs and outputs.

    Naming Consistency5/5

    Since there is only one tool, naming consistency is inherently perfect. The tool name 'pterasim.simulate' follows a clear and logical pattern that would be consistent if more tools existed.

    Tool Count2/5

    A single tool is too few for a server named 'Pterasim MCP Server', which suggests a broader aerodynamic simulation domain. This minimal toolset limits functionality and likely leaves significant gaps in coverage.

    Completeness2/5

    The server appears to focus on aerodynamic simulation, but with only a simulate tool, there are obvious gaps. Missing operations might include geometry creation, parameter analysis, result visualization, or data export, making the surface incomplete for typical simulation workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers