Skip to main content
Glama

Devstronomy MCP Server

An MCP server for Solar System planets and their moons.

As with the rest of Devstronomy, this project serves mainly for learning purposes - in this case, the MCP.

The data comes via devstronomy/nasa-data-scraper (see data/README.md).

Feature Set

Kind

Name

Description

Tool

get_planet(name)

One planet: structured data plus a text block with units

Tool

list_moons(planet)

A planet's moons. A planet with no moons gives an empty list.

Resource

devstronomy://planets

All planets as JSON

Resource template

devstronomy://planets/{name}

One planet as JSON

Prompt

compare_planets(a, b)

Asks the model to compare two planets using the tools above

Names are case-insensitive (earth = Earth). Pluto is included, as in the NASA fact sheet.

Related MCP server: mcp-meteors

Run

Requires Node 24 (nvm use).

npm install
npm run dev
npm run build && npm start

The server listens on http://127.0.0.1:3000/mcp. Set HOST and PORT to change that. GET /health returns {"status":"ok"}.

Connect a client

Claude Code:

claude mcp add --transport http devstronomy http://127.0.0.1:3000/mcp

MCP Inspector:

npx @modelcontextprotocol/inspector

Choose the "Streamable HTTP" transport and enter http://127.0.0.1:3000/mcp.

Raw JSON-RPC with curl

This shows the protocol with nothing in between. Every MCP message is a JSON-RPC 2.0 request sent with POST /mcp.

  • Clients must send Accept: application/json, text/event-stream, even though this server only answers with JSON.

  • After initialize, send the negotiated version in the MCP-Protocol-Version header.

1. Initialize (handshake: agree on the protocol version, exchange capabilities):

curl -s http://127.0.0.1:3000/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":"0"}}}'

2. List tools:

curl -s http://127.0.0.1:3000/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

3. Call a tool:

curl -s http://127.0.0.1:3000/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_planet","arguments":{"name":"mars"}}}'

Data notes

  • Units come from the Planetary Fact Sheet notes and the JPL satellite page. They're defined once in src/data.ts, and appear in the tool descriptions and text output. Structured values are plain numbers.

  • Satellite density is in g/cm³, while planet density is in kg/m³.

  • Some values are null: surfacePressure for the gas giants, and a few satellite values the source marks as unknown.

  • numberOfMoons (e.g. Jupiter 79) can be larger than the number of moons list_moons returns (Jupiter 67). JPL lists only moons with known physical parameters, and the data is from 2019.

License

MIT for the code. The data is courtesy of NASA/NSSDCA and NASA/JPL-Caltech (see data/README.md).

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides access to NASA's public APIs including Astronomy Picture of the Day, Mars Rover Images, and Near Earth Objects data, enabling users to query and retrieve space-related information through natural language.
      5
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server providing AI agents with access to NASA and space/astronomy data including APOD, Mars rover photos, near-Earth asteroids, exoplanets, Earth imagery, natural events, and space weather.
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Astrology MCP server that computes natal charts, transits, synastry, progressions, returns, eclipses, retrogrades, and moon phases from a real ephemeris, enabling AI agents to provide accurate astrological calculations without hallucination.
      12
      75 npm
      1
      MIT