Skip to content

Documentation / @interstellar-tools/mcp

@interstellar-tools/mcp ​

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 ​

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. 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
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_keplerEccentric anomaly from mean anomaly and eccentricity
convert_anomalyMean ↔ eccentric ↔ true anomaly (elliptic orbits)
convert_timeDuration between units, attoseconds to gigayears
find_bodyLook up planets, moons, stars, comets, … by name or id

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, galaxies or systems.

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.
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.