Skip to main content
Glama
nasa-exoplanet-mcp

nasa-exoplanet-mcp

by saikrmet

NASA Exoplanet Archive MCP Server

An MCP server that gives AI assistants direct access to NASA's Exoplanet Archive — the authoritative database of every confirmed exoplanet, candidate planet, and host star. Built on the archive's TAP (Table Access Protocol) service with full ADQL query support.

What can you do with it?

Once connected, you can ask your AI assistant questions like:

  • "Find rocky planets in the habitable zone within 50 parsecs of Earth"

  • "What do we know about the TRAPPIST-1 system?"

  • "How many exoplanets has TESS discovered? Break it down by year."

  • "Show me planets with atmospheric spectroscopy data available"

  • "Compare the orbital parameters of all planets around Kepler-90"

  • "What's the mass-radius distribution of transiting planets discovered after 2020?"

Here's a short video of it in action:

https://github.com/user-attachments/assets/ee4d6823-08fc-4c32-802f-c88d34032d3d

Related MCP server: Jilebi

Available Tools

Tool

Description

search_planets

Search confirmed exoplanets with flexible filters (radius, mass, temperature, distance, discovery method, facility, year, and more). The primary tool for most questions.

get_planet

Get comprehensive details for a single planet — orbital, physical, stellar, and discovery properties with uncertainties.

resolve_name

Translate any name or catalog ID (TIC, KOI, Gaia, 2MASS, HD, HIP) to the canonical archive name. Handles common issues like missing spaces in planet names.

list_tables

Discover all 40+ tables in the archive — confirmed planets, TESS candidates, Kepler KOIs, transit spectroscopy, microlensing, time series, and more.

list_columns

Explore the 300+ available columns for any table, filterable by category (orbital, physical, stellar, discovery, system, photometry).

run_query

Execute raw ADQL queries for full flexibility — aggregations, JOINs, spatial/cone searches, or querying any table in the archive.

Quick Start

Prerequisites

  • Python 3.10+

  • uv (recommended) or pip

Install

git clone https://github.com/saikrmet/nasa-exoplanet-mcp.git
cd nasa-exoplanet-mcp
uv venv && uv pip install -e .

Run

Local (stdio) — for Claude Desktop, Claude Code, or any local MCP client:

nasa-exoplanet-mcp

Remote (HTTP) — for hosted deployments or remote MCP clients:

nasa-exoplanet-mcp serve
nasa-exoplanet-mcp serve --port 9000
nasa-exoplanet-mcp serve --host 127.0.0.1 --port 9000

The server will be available at http://your-host:8000/mcp.

Adding to your MCP client

Requires uv to be installed.

Claude Desktop

Open your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "nasa-exoplanet": {
      "command": "uvx",
      "args": ["nasa-exoplanet-mcp"]
    }
  }
}

Restart Claude Desktop — the 6 exoplanet tools appear automatically.

Claude Code

claude mcp add nasa-exoplanet -- uvx nasa-exoplanet-mcp

Other MCP clients (Cursor, Windsurf, etc.)

Any client that supports stdio MCP servers works. Use uvx as the command and ["nasa-exoplanet-mcp"] as the args.

Remote deployment

If you're hosting the server (e.g. as a web app), start it with the serve subcommand:

nasa-exoplanet-mcp serve
nasa-exoplanet-mcp serve --host 0.0.0.0 --port 8000

Then point your MCP client at the URL:

{
  "mcpServers": {
    "nasa-exoplanet": {
      "url": "http://your-host:8000/mcp"
    }
  }
}

Tool Details

search_planets

The primary tool for most exoplanet questions. All parameters are optional and combinable.

Parameter

Type

Description

name

string

Planet name (partial match)

hostname

string

Host star name — returns all planets in the system

discovery_method

string

Transit, Radial Velocity, Microlensing, Imaging, etc.

facility

string

Discovery facility (TESS, Kepler, etc., partial match)

min_radius / max_radius

float

Planet radius in Earth radii (Earth=1.0, Jupiter~11.2)

min_mass / max_mass

float

Planet mass in Earth masses (Earth=1.0, Jupiter~317.8)

min_period / max_period

float

Orbital period in days

min_temperature / max_temperature

float

Equilibrium temperature in K (habitable zone ~200-320K)

min_distance / max_distance

float

Distance in parsecs (1 pc ~ 3.26 light-years)

year_min / year_max

int

Discovery year

min_planets_in_system

int

For multi-planet systems (use 2+)

columns

list

Columns to return (defaults to curated set of 12)

order_by

string

Sort column, prefix with - for descending (e.g., sy_dist nearest, -pl_eqt hottest, -pl_bmasse most massive)

limit

int

Max results, 1-500 (default 25)

offset

int

Skip N results for pagination

get_planet

Returns comprehensive data for a single planet, organized into categories:

  • Identity: name, host star, catalog IDs (TIC, Gaia, HD, HIP)

  • Orbital: period, semi-major axis, eccentricity, inclination (with uncertainties)

  • Physical: radius, mass, density, equilibrium temperature, insolation flux

  • Transit: depth, duration, midpoint, impact parameter

  • Stellar: spectral type, temperature, mass, radius, metallicity, age

  • Discovery: method, year, facility, telescope, instrument

  • System: number of planets/stars, distance, coordinates

  • Data availability: counts of available spectra and observations

run_query

For queries that need full ADQL power. Examples:

-- Discovery statistics by year
SELECT disc_year, COUNT(*) AS n FROM pscomppars
WHERE disc_year IS NOT NULL GROUP BY disc_year ORDER BY disc_year DESC

-- Cone search: planets within 5 degrees of coordinates
SELECT pl_name, hostname, ra, dec, sy_dist FROM pscomppars
WHERE CONTAINS(POINT('ICRS',ra,dec), CIRCLE('ICRS',291.0,48.0,5.0))=1

-- TESS candidates with specific disposition
SELECT * FROM toi WHERE tfopwg_disp = 'PC' ORDER BY toi

-- Transit spectroscopy data for a planet
SELECT * FROM transitspec WHERE plntname = 'WASP-39 b'

-- Planets with both mass and radius measurements (for density studies)
SELECT pl_name, pl_rade, pl_bmasse, pl_dens FROM pscomppars
WHERE pl_rade IS NOT NULL AND pl_bmasse IS NOT NULL AND pl_dens IS NOT NULL

Data Source

This server queries the NASA Exoplanet Archive operated by IPAC at Caltech, under contract with NASA as part of the Exoplanet Exploration Program. The archive is the official NASA repository for exoplanet data and is updated weekly.

No API key is required. The archive is free and open to everyone.

Key tables accessible through this server:

Table

Contents

Rows

pscomppars

Confirmed planets (composite best values)

~6,300

ps

All published measurements (multiple per planet)

~39,900

stellarhosts

Host star properties

~47,600

toi

TESS candidate planets

~7,900

cumulative

Kepler Objects of Interest

~9,600

k2pandc

K2 planets and candidates

~4,000

ml

Microlensing planets

~880

transitspec

Transit spectroscopy (atmospheric)

~5,900

emissionspec

Emission spectroscopy

~2,400

Debugging

Use the MCP Inspector to test the server interactively:

npx @modelcontextprotocol/inspector uvx nasa-exoplanet-mcp

Server logs are written to stderr and won't interfere with the stdio transport.

Development

git clone https://github.com/saikrmet/nasa-exoplanet-mcp.git
cd nasa-exoplanet-mcp
uv venv && uv pip install -e ".[dev]"

# Run the server locally
nasa-exoplanet-mcp

# Open FastMCP dev inspector
mcp dev src/server.py:mcp

# Run tests
uv run pytest

# Lint
uv run ruff check src/

Testing

This project has three layers of tests:

Layer

Command

What it tests

Unit

pytest tests/test_unit.py

Query building, error parsing, validation. No network. Fast (<1s).

Integration

pytest tests/test_integration.py

Live calls to the NASA Exoplanet Archive. Verifies real data. ~2 min.

LLM scenarios

pytest -m llm

End-to-end: an LLM agent reads tool descriptions, picks tools, returns answers. ~7 min, opt-in.

The first two run without any setup. The LLM layer requires an API key.

Running the LLM scenario suite

These tests spin up an LLM agent that reads only the MCP tool descriptions, then verifies it correctly chooses tools and returns factually correct answers for 44 natural-language scenarios spanning 8 categories (simple lookup, filtered search, aggregation, multi-step queries, name resolution, error recovery, ambiguous questions, out-of-scope questions).

Install the LLM test dependencies:

uv pip install -e ".[llm]"

Configure your provider by creating a .env file at the project root (see .env.example). Supported providers:

# OpenAI
TEST_MODEL=openai:gpt-4o-mini
OPENAI_API_KEY=sk-...

# Anthropic
TEST_MODEL=anthropic:claude-haiku-4-5
ANTHROPIC_API_KEY=sk-ant-...

# Google Gemini
TEST_MODEL=google-gla:gemini-2.5-flash
GOOGLE_API_KEY=...

# Azure OpenAI
TEST_MODEL=azure:<your-deployment-name>
AZURE_OPENAI_API_KEY=...
AZURE_OPENAI_ENDPOINT=https://<resource>.cognitiveservices.azure.com
AZURE_OPENAI_API_VERSION=2025-04-01-preview

Run the suite:

pytest -m llm -v

If TEST_MODEL is not set, all LLM tests auto-skip — pytest still runs cleanly without them.

Adding new scenarios is straightforward — append a Scenario(...) entry to tests/llm/scenarios.py.

Project Structure

src/
  server.py            # FastMCP server instance and entry point
  client.py            # Async HTTP client for TAP and Alias APIs
  config.py            # Default columns, table metadata, valid enums
  errors.py            # Error types and TAP XML error parser
  tools/
    search.py          # search_planets
    planet.py          # get_planet
    names.py           # resolve_name
    schema.py          # list_tables, list_columns
    query.py           # run_query

License

MIT

Available Tools

6 tools
get_planetA
Read-onlyIdempotent

Get comprehensive details for a single confirmed exoplanet by exact name. Returns all available properties organized into categories: orbital parameters, physical properties, stellar host properties, discovery information, system properties, and counts of available follow-up data.

Use this after search_planets to get full details on a specific result, or when the user asks about a specific known planet. The planet name must be exact (e.g., 'Kepler-22 b', not 'Kepler-22b'). If unsure of the exact name, use resolve_name first to find the canonical archive name.

Returns data from the Planetary Systems Composite Parameters table (best-available values across all published measurements).

Inputs: planet_name (required). Returns: result

list_columnsA
Read-onlyIdempotent

List available columns for a table in the NASA Exoplanet Archive, with data types, descriptions, and units. Use this to discover what data fields exist before selecting specific columns in search_planets or writing ADQL queries with run_query.

The main planet table (pscomppars) has 300+ columns. Use the category filter to narrow results to a manageable set. You do not need this for basic queries — search_planets returns a useful default column set. Use this when the user asks about specific properties that may not be in the defaults, or before formulating a run_query call.

Inputs: table, category. Returns: result

list_tablesA
Read-onlyIdempotent

List all available tables in the NASA Exoplanet Archive with descriptions. Returns table names, descriptions, approximate row counts, and guidance on what each table is used for.

Use this to discover what data is available before writing queries with run_query. The most commonly used tables are: pscomppars (one row per confirmed planet, used by search_planets and get_planet), ps (all published measurements with multiple rows per planet), stellarhosts (host star properties), and toi (TESS candidate planets not yet confirmed).

This tool returns a curated list of the most important tables. The archive has 40+ tables in total. To discover all of them, use run_query with: SELECT table_name, description FROM TAP_SCHEMA.tables ORDER BY table_name

You do not need this tool for basic planet searches — search_planets already queries the right table. Use this when you need to query specialized tables like transit spectroscopy, microlensing, Kepler KOIs, or time series data via run_query.

Inputs: no named parameters. Returns: result

resolve_nameA
Read-onlyIdempotent

Resolve any planet or star name, alias, or catalog identifier to its canonical name in the NASA Exoplanet Archive. Returns all known aliases grouped by catalog (Gaia, TIC, KOI, 2MASS, HD, HIP, etc.) and lists all confirmed planets in the system.

Use this BEFORE get_planet or search_planets when the user provides a name that might not match the archive's naming convention. Common cases: missing spaces ('Kepler-22b' vs 'Kepler-22 b'), catalog IDs ('TIC 150428135'), alternate designations ('GJ 1214' vs 'Gliese 1214'), or informal names.

Also useful when the user wants to know all designations for a star or system.

Inputs: name (required). Returns: result

run_queryA
Read-onlyIdempotent

Execute a raw ADQL query against the NASA Exoplanet Archive TAP service. ADQL is an SQL-like language for astronomical databases. Use this for complex queries that search_planets cannot handle: GROUP BY aggregations, COUNT statistics, JOINs across tables, spatial/cone searches, queries against non-planet tables (toi, transitspec, emissionspec, ml, Kepler KOI tables), or any query needing full SQL-like flexibility.

Use list_tables and list_columns first to discover available tables and column names. Common tables: pscomppars (one row per confirmed planet), ps (all published solutions — filter with default_flag=1 for one per planet), stellarhosts (host stars), toi (TESS candidates), transitspec (atmospheric transit spectra), emissionspec (atmospheric emission spectra), ml (microlensing planets).

ADQL supports: SELECT, WHERE, ORDER BY, GROUP BY, COUNT, JOIN, LIKE, BETWEEN, IS NULL, IS NOT NULL, TOP, mathematical functions, and spatial functions (CONTAINS, POINT, CIRCLE for cone searches). Example cone search: WHERE CONTAINS(POINT('ICRS',ra,dec), CIRCLE('ICRS',291.0,48.0,5.0))=1

Inputs: query (required), limit. Returns: result

search_planetsA
Read-onlyIdempotent

Search for exoplanets in NASA's Exoplanet Archive with flexible filters. Returns matching planets from the Planetary Systems Composite Parameters table (one row per confirmed planet, best-available measurements).

This is the primary tool for most exoplanet questions. All filter parameters are optional and can be combined. If no filters are given, returns the most recently discovered planets.

For single-planet lookups by exact name, use get_planet instead. For complex queries needing GROUP BY, JOIN, spatial/cone searches, or querying tables other than the main planet catalog, use run_query instead.

If a name-based search returns no results, the name may need resolving — try resolve_name first to find the canonical archive name.

Inputs: name, limit, offset, columns, +17 more. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: exact lookup (get_planet), filtered search (search_planets), name resolution (resolve_name), metadata discovery (list_tables, list_columns), and raw ADQL access (run_query). The descriptions clearly delineate when to use each, with explicit cross-references to prevent confusion.

    Naming Consistency5/5

    All tool names follow the verb_noun convention: get_planet, search_planets, resolve_name, list_tables, list_columns, run_query. The naming is consistent, lowercase with underscores, and each verb clearly indicates the action.

    Tool Count5/5

    With 6 tools, the server is well-scoped for its purpose of accessing NASA's exoplanet archive. Each tool serves a distinct and necessary role, covering basic and advanced querying, name resolution, and metadata exploration without unnecessary redundancy.

    Completeness5/5

    The tool set provides comprehensive coverage of the exoplanet archive domain: searching, retrieving detailed planet data, resolving aliases, exploring available tables and columns, and executing arbitrary ADQL queries for advanced needs. No obvious gaps exist—raw query access fills any niche not covered by the higher-level tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables LLMs to query data from various NASA APIs, allowing access to astronomical data, space weather information, Earth imagery, and exoplanet information directly from compatible AI clients.
      21
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A plugin-based MCP server that enables AI assistants to interact with external systems through custom tools, resources, and prompts.
      4
      AGPL 3.0
    • 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