Labsco
Rkm1999 logo

CelestialMCP

โ˜… 1

from Rkm1999

Provides astronomical data such as celestial object positions, rise/set times, and visibility information.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

CelestialMCP

A Model Context Protocol (MCP) server designed for AI assistants like Claude. It provides tools to access astronomical data, such as celestial object positions, rise/set times, visibility, and catalog information.

Overview

CelestialMCP is built with the mcp-framework and leverages the astronomy-engine library to provide accurate astronomical calculations. It offers several tools for determining positions of celestial objects, calculating their rise and set times, and listing available objects from star and deep sky object catalogs.

Features

  • Real-time Celestial Data: Access current astronomical data for a variety of objects.
  • Comprehensive Object Details: Retrieve equatorial and horizontal (altitude/azimuth) coordinates, visibility status, rise/transit/set times.
  • Specialized Data: For relevant objects, get distance (solar system objects), phase illumination (Moon and planets), and upcoming lunar phases (Moon).
  • Extensive Catalogs: Utilizes local catalogs for:
    • Solar system objects (Sun, Moon, planets).
    • Stars (e.g., from HYG database).
    • Deep Sky Objects (DSOs) including Messier, NGC, and IC objects.
  • Configurable Observer: All calculations are based on a pre-configured observer location (default: Vancouver, Canada) and the current system time.
  • Easy Catalog Updates: Includes a script to download and update comprehensive astronomical catalogs.

Tools

The server provides three primary tools for the AI to use:

  1. getCelestialDetails: Retrieves detailed astronomical information for a specific celestial object.
  2. listCelestialObjects: Lists available celestial objects known to the system, filterable by category.
  3. getStarHoppingPath: Calculates a star hopping path from a bright start star to a target celestial object.

Using with Claude Desktop

To use CelestialMCP with Claude Desktop for local development, add the following configuration to your Claude Desktop config file:

# Install dependencies
npm install

# Fetch star and deep sky object catalogs (IMPORTANT!)
npm run fetch-catalogs

# Build the project
npm run build

# Start the server
npm start

Windows: %APPDATA%/Claude/claude_desktop_config.json MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "CelestialMCP": { "command": "node", // Or your node executable path "args":["/absolute/path/to/your/CelestialMCP/project/dist/index.js"] // Replace with the actual absolute path } } }

Catalog Data

The npm run fetch-catalogs script downloads:

  • hygdata_v41.csv: The HYG star database (approx. 120,000 stars).
  • ngc.csv: The OpenNGC catalog (approx. 14,000 deep sky objects).

These files are stored in the data/ directory. If these primary catalog files are not found, the application will attempt to load sample_stars.csv and sample_dso.csv if they exist in the data/ directory. For comprehensive data, running npm run fetch-catalogs is highly recommended.

Project Structure

CelestialMCP/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ tools/                      # MCP Tools provided to the AI
โ”‚   โ”‚   โ”œโ”€โ”€ CelestialDetailsTool.ts   # Tool to get detailed info for an object
โ”‚   โ”‚   โ”œโ”€โ”€ ListCelestialObjectsTool.ts # Tool to list available objects
โ”‚   โ”‚   โ””โ”€โ”€ StarHoppingTool.ts        # Tool to calculate star hopping paths
โ”‚   โ”œโ”€โ”€ utils/                      # Utility functions
โ”‚   โ”‚   โ””โ”€โ”€ astronomy.ts            # Core astronomy calculations and catalog loading
โ”‚   โ”œโ”€โ”€ config.ts                   # Observer's location and atmospheric conditions configuration
โ”‚   โ””โ”€โ”€ index.ts                    # MCP Server entry point
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ fetch-catalogs.js           # Script to download astronomical catalogs
โ”œโ”€โ”€ data/                           # Directory for catalog data files (e.g., hygdata_v41.csv, ngc.csv)
โ”‚   โ”œโ”€โ”€ README.md                   # Information about data files
โ”‚   โ”œโ”€โ”€ sample_dso.csv            # Sample DSO data if full catalog isn't downloaded
โ”‚   โ””โ”€โ”€ sample_stars.csv          # Sample star data if full catalog isn't downloaded
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json