astronomy-mcp-server

v0.4.0 pre-1.0

What's in the sky, computed offline — planet and moon positions, rise/set, phases, eclipses, and seasons for any place and time via MCP. STDIO or Streamable HTTP.

astronomy.caseyjhand.com/mcp
claude mcp add --transport http astronomy-mcp-server https://astronomy.caseyjhand.com/mcp
codex mcp add astronomy-mcp-server --url https://astronomy.caseyjhand.com/mcp
{
  "mcpServers": {
    "astronomy-mcp-server": {
      "url": "https://astronomy.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http astronomy-mcp-server https://astronomy.caseyjhand.com/mcp
{
  "mcpServers": {
    "astronomy-mcp-server": {
      "command": "bunx",
      "args": [
        "mcp-remote",
        "https://astronomy.caseyjhand.com/mcp"
      ]
    }
  }
}
{
  "mcpServers": {
    "astronomy-mcp-server": {
      "type": "http",
      "url": "https://astronomy.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://astronomy.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

7

astronomy_get_sky_position

Compute the apparent topocentric position of one solar-system body (sun, moon, mercury through neptune, pluto) or a named bright star for an observer location and instant. Returns equatorial (RA/Dec), refraction-corrected horizontal (altitude/azimuth), and ecliptic coordinates, plus distance, apparent magnitude, angular diameter, phase angle, illuminated fraction, angular distance from the Sun, and the constellation it falls in. For a solar-system body it also returns that body card — classification, mean radius, naked-eye visibility — the same values served at astronomy://body/{body}, so a client without resource support does not need a second surface to reach them; a catalog star has no card and the field is absent. Positions are parallax- and aberration-corrected for the given observer; default elevation is 0 m and the default time is now. Supply `star` (e.g. "Sirius", "Polaris") instead of `body` to target a catalog star; `body` is ignored when `star` is set. Pass an IANA `timezone` to also receive the observer-local time. This server does not geocode — resolve a place name to latitude/longitude upstream first.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_get_sky_position",
    "arguments": {
      "latitude": "<latitude>",
      "longitude": "<longitude>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "body": {
      "description": "Solar-system body to locate. Omit when targeting a named star via `star`.",
      "type": "string",
      "enum": [
        "sun",
        "moon",
        "mercury",
        "venus",
        "mars",
        "jupiter",
        "saturn",
        "uranus",
        "neptune",
        "pluto"
      ]
    },
    "star": {
      "description": "Named star to locate, from a bundled catalog of 32 stars — about 30 of the brightest naked-eye stars plus Polaris, not an arbitrary star. Accepts a common name or Bayer designation, with the Greek letter spelled out or as a symbol and the constellation as its genitive or IAU abbreviation (e.g. \"Sirius\", \"Alpha Centauri\", \"α CMa\"). A name outside the catalog fails with the full list of catalog stars. Takes precedence over `body`.",
      "type": "string"
    },
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Observer latitude in decimal degrees, north positive."
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Observer longitude in decimal degrees, east positive."
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "time": {
      "description": "Instant of observation as an ISO 8601 UTC string, e.g. \"2024-04-08T18:00:00Z\". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "timezone": {
      "description": "IANA timezone for localized output, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    }
  },
  "required": [
    "latitude",
    "longitude",
    "elevation"
  ],
  "additionalProperties": false
}
view source ↗

astronomy_get_rise_set

Compute rise, set, and culmination (transit) times for a body at an observer location, plus the maximum altitude at culmination. For the Sun, also returns the three twilight pairs (civil −6°, nautical −12°, astronomical −18°) so a single call answers "when does the sun set and when is it truly dark." Each pair covers the night after the cycle's set — dusk that evening, dawn the next morning — so the dawn listed beside a sunrise is the following day's; for the dawn before a sunrise, read the previous cycle or start a day earlier. Searches forward from `start` (default today) and returns the next `count` cycles (default 1). When the body is already above the horizon at `start`, the first cycle is the interval in progress: its `set` is the imminent one and its `rise` is null, since that rise precedes the search — so a set is never reported earlier than the rise beside it. Circumpolar or never-rises situations are reported as null rise/set fields with an explanatory note rather than an error — the fact is the answer. Default elevation is 0 m; pass an IANA `timezone` for observer-local times. This server does not geocode — resolve coordinates upstream first.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_get_rise_set",
    "arguments": {
      "body": "<body>",
      "latitude": "<latitude>",
      "longitude": "<longitude>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "body": {
      "type": "string",
      "enum": [
        "sun",
        "moon",
        "mercury",
        "venus",
        "mars",
        "jupiter",
        "saturn",
        "uranus",
        "neptune",
        "pluto"
      ],
      "description": "The body to compute rise/set for. Twilight is included only when this is \"sun\"."
    },
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Observer latitude in decimal degrees, north positive."
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Observer longitude in decimal degrees, east positive."
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "start": {
      "description": "Search start as an ISO 8601 UTC string, e.g. \"2024-06-21T00:00:00Z\". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "count": {
      "default": 1,
      "description": "Number of forward rise/set cycles to return. Default 1, max 31.",
      "type": "integer",
      "minimum": 1,
      "maximum": 31
    },
    "timezone": {
      "description": "IANA timezone for localized output, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    }
  },
  "required": [
    "body",
    "latitude",
    "longitude",
    "elevation",
    "count"
  ],
  "additionalProperties": false
}
view source ↗

astronomy_get_moon_phase

Report the Moon phase for an instant: illuminated fraction, phase name, synodic age in days since the new moon, phase longitude (the Moon–Sun ecliptic-longitude difference, 180° at full), and the next four quarter phases (new, first quarter, full, last quarter) with timestamps. Answers "what is the moon phase tonight" and "when is the next full moon" in one call without iteration. The time defaults to now; pass an IANA `timezone` to also receive observer-local timestamps. The phase is geocentric — no observer location is needed.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_get_moon_phase",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "time": {
      "description": "Instant to evaluate as an ISO 8601 UTC string, e.g. \"2024-12-15T00:00:00Z\". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "timezone": {
      "description": "IANA timezone for localized output, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    }
  },
  "additionalProperties": false
}
view source ↗

astronomy_find_events

Search forward from a start time for the next occurrences of one sky-event class, selected by the `event` enum: solar_eclipse, lunar_eclipse, equinox, solstice, moon_quarter, opposition, conjunction, max_elongation, or perigee_apogee. Both eclipse classes take an optional observer (latitude and longitude together). solar_eclipse without one returns global eclipses — kind, peak time, obscuration, and for a total or annular eclipse the latitude/longitude where it is greatest; with one it returns only eclipses visible from that point, with local contact times, `local_visible`, and the Sun's altitude at each contact. lunar_eclipse returns geocentric contact times, the same instants everywhere on Earth; an observer adds `local_visible` and the Moon's altitude at each contact. Every other class is geocentric and ignores a location. The body-relative events (opposition, conjunction, max_elongation, perigee_apogee) require a `body`: opposition applies to the superior planets (mars through pluto), conjunction to any planet, max_elongation to mercury and venus, and perigee_apogee to the moon (perigee/apogee), earth, or a planet (perihelion/aphelion). Returns the next `count` occurrences (default 1). Searches stop at the end of 2100, the close of the supported span; when that leaves fewer than `count`, a notice says so. Start defaults to now; pass an IANA `timezone` for observer-local timestamps.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_find_events",
    "arguments": {
      "event": "<event>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "enum": [
        "solar_eclipse",
        "lunar_eclipse",
        "equinox",
        "solstice",
        "moon_quarter",
        "opposition",
        "conjunction",
        "max_elongation",
        "perigee_apogee"
      ],
      "description": "Which class of event to search for."
    },
    "start": {
      "description": "Search start as an ISO 8601 UTC string, e.g. \"2024-01-01T00:00:00Z\". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "count": {
      "default": 1,
      "description": "Number of forward occurrences to return. Default 1, max 20.",
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    },
    "body": {
      "description": "Target body — required for opposition, conjunction, max_elongation, and perigee_apogee; ignored otherwise. \"earth\" is accepted only for perigee_apogee, which returns its perihelion and aphelion.",
      "type": "string",
      "enum": [
        "sun",
        "moon",
        "mercury",
        "venus",
        "mars",
        "jupiter",
        "saturn",
        "uranus",
        "neptune",
        "pluto",
        "earth"
      ]
    },
    "latitude": {
      "description": "Observer latitude in decimal degrees, supplied together with longitude. Optional for solar_eclipse and lunar_eclipse, where it adds local circumstances; omit both for a global solar search. Ignored by every other event.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "description": "Observer longitude in decimal degrees, supplied together with latitude. Optional for solar_eclipse and lunar_eclipse; ignored by every other event.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "timezone": {
      "description": "IANA timezone for localized output, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    }
  },
  "required": [
    "event",
    "count",
    "elevation"
  ],
  "additionalProperties": false
}
view source ↗

astronomy_list_visible

The one-call "what is up right now" answer. For an observer location and instant, iterate every naked-eye solar-system body (and, with include_stars, the bundled bright stars), compute altitude and azimuth, keep those above the horizon, rank them brightest-and-highest first, and attach a plain-language visibility note to each, along with its angular distance from the Sun. The whole sky is gated by the Sun's altitude into daylight / civil / nautical / astronomical twilight / dark, returned alongside the list, and each note says when daylight, civil twilight, or the Sun's glare hides or dims that body. `time` is a single evaluation instant, not a window — for "tonight" pass a time after astronomical dusk (use astronomy_get_rise_set on the sun to find it). Default elevation 0 m; use min_altitude to skip objects grazing the horizon. This server does not geocode — resolve coordinates upstream first; pass an IANA timezone for observer-local times on each body.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_list_visible",
    "arguments": {
      "latitude": "<latitude>",
      "longitude": "<longitude>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Observer latitude in decimal degrees, north positive."
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Observer longitude in decimal degrees, east positive."
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "time": {
      "description": "Evaluation instant as an ISO 8601 UTC string, e.g. \"2024-08-12T05:00:00Z\". Defaults to now. A single instant, not a window. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "timezone": {
      "description": "IANA timezone for localized output, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    },
    "min_altitude": {
      "default": 0,
      "description": "Minimum altitude in degrees to include a body. Default 0 (above the horizon); use e.g. 5 to require clearance.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "include_stars": {
      "default": false,
      "description": "Include the bundled bright stars alongside planets. Default false.",
      "type": "boolean"
    }
  },
  "required": [
    "latitude",
    "longitude",
    "elevation",
    "min_altitude",
    "include_stars"
  ],
  "additionalProperties": false
}
view source ↗

astronomy_get_ephemeris

open-world

Fetch a time-series ephemeris for a small body (asteroid or comet) or spacecraft from JPL Horizons — RA/Dec, distance, and apparent magnitude over a span, optionally with observer-relative altitude/azimuth. This covers objects the in-process major-body set cannot. The designation is passed to Horizons verbatim, so it must be in a form Horizons resolves to a single record: a numbered asteroid takes a trailing-semicolon record lookup (e.g. "433;" for Eros, "1;" for Ceres), and a periodic comet takes the DES + closest-apparition form (e.g. "DES=1P;CAP" for Halley). Spacecraft take their negative SPK-ID. Anything else goes through the Horizons name search: a bare name matching nothing (e.g. "433 Eros") or several records (e.g. "1P/Halley") is rejected, but one matching a single object succeeds even when that object is not the one meant — "Eros" resolves to Kerberos, a moon of Pluto — so compare `target_name`, the object Horizons resolved, with the one intended. `start` and `stop` are ISO 8601 UTC and `stop` must be after `start`; `step` is a count plus a unit of m, h, d, mo, or y, such as "1d", "1h", or "10m". Supplying observer latitude/longitude yields topocentric coordinates and adds alt/az — supply both or neither. This is a gated, network-backed extension (JPL Horizons is keyless but rate-limited and best-effort); large spans truncate inline at 200 rows, and the truncation notice names the exact `start` to resume from — one step past the last row returned, because Horizons includes the start instant in its output — so re-calling from there continues the series without repeating a sample. Splitting the range into smaller adjacent spans works too; keep the same step either way so no sample is lost.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_get_ephemeris",
    "arguments": {
      "designation": "<designation>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "designation": {
      "type": "string",
      "minLength": 1,
      "description": "JPL Horizons target, passed verbatim — use a form that resolves to one record. Numbered asteroid: trailing-semicolon record lookup, e.g. \"433;\" (Eros), \"1;\" (Ceres). Periodic comet: DES + closest-apparition flag, e.g. \"DES=1P;CAP\" (Halley), \"DES=2P;CAP\" (Encke). Spacecraft: negative SPK-ID, e.g. \"-48\" (Hubble). A bare name like \"433 Eros\" (no match) or \"1P/Halley\" (several records) is rejected, but one matching a single object succeeds even when it is not the object meant — check `target_name` in the result. Look up designations at ssd.jpl.nasa.gov/tools/sbdb_lookup.html."
    },
    "latitude": {
      "description": "Observer latitude in decimal degrees — supply together with longitude for topocentric coordinates and alt/az. Supplying one without the other is rejected.",
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "description": "Observer longitude in decimal degrees. Supply together with latitude; one without the other is rejected.",
      "type": "number",
      "minimum": -180,
      "maximum": 180
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "start": {
      "description": "Ephemeris start as an ISO 8601 UTC string, e.g. \"2024-01-01T00:00:00Z\". Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "stop": {
      "description": "Ephemeris stop as an ISO 8601 UTC string, and must be later than start. Defaults to 24 hours after start. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "step": {
      "default": "1h",
      "description": "Step size as a positive count plus a unit of m (minutes), h (hours), d (days), mo (months), or y (years), e.g. \"10m\", \"1h\", \"1d\". Default \"1h\".",
      "type": "string"
    }
  },
  "required": [
    "designation",
    "elevation",
    "step"
  ],
  "additionalProperties": false
}
view source ↗

astronomy_get_satellite_passes

open-world

Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Identify the satellite by exactly one of `norad_id` or `name` — supplying both, or neither, is rejected. A few well-known common names resolve directly to their catalog numbers, ignoring case: ISS or International Space Station (25544), Hubble, Hubble Space Telescope, or HST (20580), and Tiangong, CSS, or Chinese Space Station (48274). Any other `name` is matched as a case-insensitive substring of CelesTrak's catalog names, so it resolves only when it picks out a single object: a broader query comes back with the matching objects and their catalog numbers to choose from. Either way the result echoes the query that resolved it as `resolved_from_name`. Fetches the object's current GP element set from CelesTrak, propagates it with SGP4 in-process, and returns each pass's rise, peak, and set times with azimuths and the peak elevation. Only passes that are naked-eye-plausible are returned — the satellite must be sunlit at peak while the observer's sky is dark. Every returned pass rises within the requested window: a pass already underway at `start` is omitted rather than reported with `start` as its rise, so back up `start` to see it, while a pass still up when the window ends is reported through its actual set. A `start` further than about a month from the element set's epoch is rejected as out of range on that distance alone, and an element set that will not propagate to a window inside that horizon is rejected as a reentry — so an empty `passes` means only that nothing was visible. CelesTrak publishes only current element sets, so in practice `start` must be within about a month of today. NORAD catalog numbers and catalog names are found at celestrak.org or heavens-above.com. This is a gated, network-backed extension (CelesTrak is keyless but rate-limited; element sets are cached briefly). Default elevation 0 m; pass an IANA timezone for observer-local pass times.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "astronomy_get_satellite_passes",
    "arguments": {
      "norad_id": "<norad_id>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "norad_id": {
      "description": "NORAD catalog number of the satellite, e.g. 25544 for the ISS. Found at celestrak.org or heavens-above.com. Mutually exclusive with `name` — supply exactly one.",
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "name": {
      "description": "Satellite name to resolve, e.g. \"ISS (ZARYA)\". The common names ISS, International Space Station, Hubble, Hubble Space Telescope, HST, Tiangong, CSS, and Chinese Space Station resolve directly to their catalog numbers, ignoring case and surrounding whitespace. Any other name is matched against CelesTrak as a case-insensitive substring of the catalog name, so give the fullest name you have — a short one matches many objects and is rejected as ambiguous. Mutually exclusive with `norad_id` — supply exactly one.",
      "type": "string"
    },
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Observer latitude in decimal degrees, north positive."
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180,
      "description": "Observer longitude in decimal degrees, east positive."
    },
    "elevation": {
      "default": 0,
      "description": "Observer elevation in meters above sea level. Default 0.",
      "type": "number"
    },
    "days": {
      "default": 7,
      "description": "Number of days ahead to search for passes. Default 7, max 10.",
      "type": "integer",
      "minimum": 1,
      "maximum": 10
    },
    "start": {
      "description": "Search start as an ISO 8601 UTC string, within about a month of the current element set's epoch — for a tracked object that epoch is hours old, so in practice within about a month of today. A start further out is rejected rather than answered from elements that no longer describe the orbit. Defaults to now. A value with no zone designator is read as UTC, not the local zone of the server process.",
      "type": "string"
    },
    "timezone": {
      "description": "IANA timezone for localized pass times, e.g. \"America/Los_Angeles\". When omitted, output is UTC-only.",
      "type": "string"
    }
  },
  "required": [
    "latitude",
    "longitude",
    "elevation",
    "days"
  ],
  "additionalProperties": false,
  "oneOf": [
    {
      "type": "object",
      "required": [
        "norad_id"
      ],
      "not": {
        "required": [
          "name"
        ]
      }
    },
    {
      "type": "object",
      "required": [
        "name"
      ],
      "not": {
        "required": [
          "norad_id"
        ]
      }
    }
  ]
}
view source ↗

Resources

1

Static reference card for a solar-system body: canonical name, type (star/planet/moon/dwarf), mean radius in kilometers, and whether it is naked-eye visible. `{body}` must be one of the closed enum values (sun, moon, mercury … pluto).

uri astronomy://body/{body} mime application/json

Prompts

1

Structure a "plan tonight's stargazing from <place>" workflow: resolve coordinates, find the dark-sky window, check the moon, list what is up, and fold in cloud cover. Emits a message that chains the astronomy tools in order and names the cross-server steps the astronomy server does not cover (geocoding, weather).

  • locationrequired — The place to stargaze from, e.g. "Mount Rainier" or "Seattle, WA".
  • date — Target date as an ISO date (YYYY-MM-DD). Defaults to tonight when omitted.