Skip to content

Documentation / @interstellar-tools/mcp

@interstellar-tools/mcp ​

@interstellar-tools/mcp MCP server – quality and maintenance score on Glama

A Model Context Protocol (MCP) server that gives AI assistants deterministic, unit-explicit orbital mechanics calculations and celestial body datasets, backed by @interstellar-tools/equations, @interstellar-tools/constants and @interstellar-tools/temporal.

Documentation ​

The full documentation lives at phun-ky.net/interstellar-tools:

Installation ​

  • Node.js version 22.12.0 or higher
  • ES modules; require() needs Node 22.12 or later

Add it to any MCP client that launches stdio servers, for example:

json
{
  "mcpServers": {
    "interstellar-tools": {
      "command": "npx",
      "args": ["-y", "@interstellar-tools/mcp"]
    }
  }
}

Or with Claude Code:

shell
claude mcp add interstellar-tools -- npx -y @interstellar-tools/mcp

Remote (HTTP) ​

Web assistants such as claude.ai, ChatGPT and Mistral Le Chat connect to remote servers only. Serve Streamable HTTP and put it behind HTTPS (a tunnel such as cloudflared tunnel --url http://localhost:3000 --http-host-header localhost:3000 is enough for testing):

shell
npx -y @interstellar-tools/mcp --http --port 3000
# → http://127.0.0.1:3000/mcp

The server is stateless and binds to 127.0.0.1 unless you pass --host 0.0.0.0. On loopback it only answers requests addressed to localhost, 127.0.0.1 or [::1], which protects it from DNS rebinding; pass --allowed-hosts with your public host name when you serve it elsewhere. Bound anywhere else without --allowed-hosts, it checks no host name, and says so with a warning on stderr. Step-by-step setup for each assistant is in the MCP guide.

Units ​

Every input and output field name ends with its unit: r_m (metres), m0_kg (kilograms), v_m_s (m/s), mu_m3_s2 (m³/s²), T_s / T_d (seconds / days). Angles are passed as { "value": 28.5, "unit": "deg" } (or "rad") and returned as { "rad": …, "deg": … }.

Tools ​

ToolWhat it computes
gravitational_parameterμ = G·(M + m) from masses
circular_speedCircular orbit speed at radius r
escape_speedEscape speed at radius r
vis_viva_speedSpeed at radius r on an orbit with semi-major axis a
kepler_periodOrbital period from semi-major axis
peri_apoapsis_radiiPeriapsis and apoapsis radii from a and e
sphere_of_influence_radiusLaplace sphere of influence
state_to_elementsOrbital elements from a position and velocity
elements_to_statePosition and velocity from orbital elements
hohmann_transferBoth burns, total Δv and transfer time
rocket_delta_vTsiolkovsky rocket equation from Isp and masses
plane_change_delta_vΔv for a pure inclination change
solve_lambertVelocities for a transfer between two positions in a given time
hyperbolic_departureΔv, C3 and eccentricity to leave or be captured with a given v∞
solve_keplerEccentric anomaly from mean anomaly and eccentricity
convert_anomalyMean ↔ eccentric ↔ true anomaly (elliptic orbits)
convert_timeDuration between units, attoseconds to gigayears
convert_distanceDistance between units, metres to gigaparsecs
great_circle_distanceDistance and central angle between two points on a body
horizon_distanceHow far an observer at a height can see
geodetic_to_body_fixedBody-fixed x, y, z from latitude, longitude and height
body_fixed_to_geodeticLatitude, longitude and height from body-fixed x, y, z
project_pointMap x and y of a point in one of seven projections
unproject_pointLatitude and longitude of a map x and y, in the same projections
tile_for_pointWeb map tile and quadkey that holds a point, and its pixel in it
tile_infoEdges of a web map tile, XYZ ↔ quadkey, and where a pixel is
camera_ground_resolutionPixel field of view, ground sample distance and swath width
illumination_geometryIncidence, emission and phase angles, and surface brightness
landing_stabilityTip-over angle and whether a lander on a slope stays up
terrain_at_cellSlope, aspect, curvature, roughness and hillshade at one DEM cell
terrain_layerOne terrain quantity, slope to flow accumulation, over a whole DEM
contour_linesContour lines of a DEM, at an interval or at given heights
safe_landing_mapSafe, unsafe and unknown landing cells of a DEM
satellite_positionPoint below a satellite, its height and TEME state, from TLE or OMM
look_anglesAzimuth, elevation, range and Doppler shift from a ground observer
satellite_passesRise, highest point and set over an observer, and visibility
probe_positionWhere a deep-space probe is, from the bundled ephemerides
lagrange_pointsL1 to L5 of two bodies, Trojan stability and the Hill sphere
find_bodyLook up planets, moons, stars, comets, … by name or id

The geodesy and map tools take the shape of the body as a body id from find_body, such as "mars", or as radii in metres. For GPS coordinates on Earth, the ellipsoid tools also take "wgs84".

The terrain tools take an elevation grid (DEM) as rows of heights in metres, row 0 the northernmost and each row west to east, with the cell size in metres; null or a no_data value marks a missing cell. A grid is at most 32 × 32 cells, so a whole layer fits in the assistant's context: crop or resample a larger DEM first.

The satellite tools take orbital elements as a two-line element set (tle), an OMM record from CelesTrak (omm) or the id of a satellite in the bundled snapshot (satellite), and times as ISO 8601 UTC strings. The server fetches nothing: the assistant passes fresh elements in. Each result says how old the elements are, in elements_age_d; they go stale within days.

All tools are pure and offline: no network access, no side effects.

Resources ​

Each dataset in @interstellar-tools/constants is available as a JSON resource at interstellar://datasets/{name}, where name is one of planets, moons, stars, comets, asteroids, asteroid-belts, interstellar-objects, galaxies or systems.

The snapshots in @interstellar-tools/tracking are resources too: interstellar://tracking/satellites, twelve satellites' OMM records dated 4 November 2026, and interstellar://tracking/probes, thirteen space probes and the span of their ephemerides.

Programmatic use ​

ts
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

import { createServer, startHttpServer } from '@interstellar-tools/mcp';

// stdio
await createServer().connect(new StdioServerTransport());

// or Streamable HTTP on http://127.0.0.1:3000/mcp
await startHttpServer({ port: 3000 });

MCP server exposing interstellar-tools equations and datasets.

Interfaces ​

InterfaceDescription
HttpServerOptionsInterface-

Variables ​

VariableDescription
SERVER_NAME-
SERVER_VERSIONThe published package version, read from package.json so it never drifts.

Functions ​

FunctionDescription
createServerCreate an MCP server with every interstellar-tools tool and resource registered. Connect it to a transport of your choice.
isLoopbackWhether host is a loopback address, which only this machine can reach.
parsePortA TCP port from the command line or $PORT: a whole number in [0, 65535], where 0 picks a free one.
startHttpServerServe the MCP server over Streamable HTTP, for clients that only accept remote servers. Runs stateless: every request gets a fresh server, which is cheap because every tool is a pure calculation.