MCP TypeScript NASA Server
Provides access to NASA's public APIs including Astronomy Picture of the Day (APOD), Mars rover photos, Near-Earth Objects tracking, DONKI space weather events, and EPIC Earth imagery from the DSCOVR satellite.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP TypeScript NASA Server show me today's astronomy picture of the day"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP TypeScript NASA Server
A TypeScript-based MCP (Model Context Protocol) server that provides seamless integration with NASA's public APIs, enabling AI assistants to access space and astronomy data including APOD, Mars rover photos, Near-Earth Objects, space weather, and Earth imagery.
π Features
π 5 NASA API Tools: APOD, Mars Rovers, NEO Feed, DONKI Space Weather, EPIC Earth Imagery
π Resources Support: Access NASA data via URI-based resources (static & dynamic)
π¬ Prompts Templates: Pre-built prompts for education and analysis
π¦ NPX Ready: Run instantly with
npx mcp-ts-stdio-nasaπ§ Type-Safe: Full TypeScript implementation with Zod validation
π― MCP Compliant: Full Model Context Protocol specification support
β‘ Easy Setup: Works with Claude Desktop and other MCP clients
π API Key Support: Use your own NASA API key or the demo key
Related MCP server: NASA API Desktop Extension
π Quick Start
Run with NPX (Recommended - No Installation Required)
npx mcp-ts-stdio-nasaThis command downloads and runs the latest version directly from npm.
Install Globally
npm install -g mcp-ts-stdio-nasa
mcp-ts-stdio-nasaInstall as Dependency
npm install mcp-ts-stdio-nasaπ§ Configuration
Claude Desktop Setup
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nasa": {
"command": "npx",
"args": ["mcp-ts-stdio-nasa"],
"env": {
"NASA_API_KEY": "your_api_key_here"
}
}
}
}Environment Variables
Create a .env file in your project root:
# NASA API Configuration
NASA_API_KEY=your_api_key_here # Get from https://api.nasa.gov/
# Use "DEMO_KEY" for testing with rate limits
# Optional
DEBUG=false # Enable debug loggingπ οΈ Available Tools
1. nasa_apod - Astronomy Picture of the Day
Get NASA's daily featured astronomy image with detailed explanation.
Parameters:
date(optional): Date in YYYY-MM-DD format
Example Query:
"Show me NASA's astronomy picture from January 1, 2024"2. nasa_mars_rover_photos - Mars Rover Photography
Fetch photos from Mars rovers including Curiosity, Opportunity, Spirit, and Perseverance.
Parameters:
rover: Rover name (curiosity, opportunity, spirit, perseverance)sol(optional): Martian dayearth_date(optional): Earth date in YYYY-MM-DDcamera(optional): Camera type (FHAZ, RHAZ, NAVCAM, etc.)limit: Maximum photos to return (1-25)
Example Query:
"Get recent photos from Perseverance rover's navigation camera"3. nasa_neo_feed - Near Earth Objects
Track asteroids and comets passing near Earth.
Parameters:
start_date(optional): Start date in YYYY-MM-DDend_date(optional): End date in YYYY-MM-DD
Example Query:
"Show me potentially hazardous asteroids passing Earth this week"4. nasa_donki_space_weather - Space Weather Events
Monitor solar flares, coronal mass ejections, and other space weather phenomena.
Parameters:
event_type: Event type (FLR, SEP, CME, IPS, MPC, GST, RBE)start_date(optional): Start dateend_date(optional): End date
Event Types:
FLR: Solar FlareSEP: Solar Energetic ParticleCME: Coronal Mass EjectionIPS: Interplanetary ShockMPC: Magnetopause CrossingGST: Geomagnetic StormRBE: Radiation Belt Enhancement
Example Query:
"Check for solar flares in the last week"5. nasa_epic_earth_imagery - Earth Polychromatic Imaging
Get full-disc Earth images from the DSCOVR satellite.
Parameters:
image_type: natural or enhanceddate(optional): Date in YYYY-MM-DDlimit: Maximum images (1-20)
Example Query:
"Show me recent full Earth images from space"π Resources
Resources provide direct access to NASA data via URIs:
Static Resources
nasa://config- NASA API configuration and statusnasa://missions/current- List of current NASA missionsnasa://neo/today- Today's Near-Earth Objects
Dynamic Resources (with URI templates)
nasa://apod/{date}- APOD for specific date (e.g.,nasa://apod/2024-01-15)nasa://rover/{rover}/latest- Latest photos from Mars rovers
Example Usage:
"Read the resource nasa://apod/2024-12-25"
"Show me nasa://rover/perseverance/latest"π¬ Prompts
Pre-configured prompts for common NASA data queries:
1. explain-apod - Educational APOD Explanation
Parameters:
date(optional): YYYY-MM-DD formataudience(optional): child, student, or expert
Example:
"Use the explain-apod prompt for today with audience set to child"2. space-weather-report - Space Weather Analysis
Parameters:
days(optional): 1-7 days to analyzefocus(optional): solar-flares, cme, geomagnetic, or all
Example:
"Generate a space-weather-report for the last 3 days focusing on solar flares"3. asteroid-analysis - NEO Risk Assessment
Parameters:
timeframe(optional): today, week, or monthhazardous_only(optional): true/false
Example:
"Run asteroid-analysis for this week with hazardous_only true"π Status
β Published and Working - The package has been successfully published to npm and tested with Claude Desktop.
Latest Version: 0.2.0
npm Package: mcp-ts-stdio-nasa
Installation: Works via npx, global install, or as a dependency
π» Development
Setup
# Clone the repository
git clone https://github.com/jezweb/mcp-ts-stdio-nasa.git
cd mcp-ts-stdio-nasa
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run devScripts
npm run build- Build TypeScript to JavaScriptnpm run clean- Clean build artifactsnpm run dev- Watch mode for developmentnpm run lint- Run ESLintnpm run format- Format with Prettiernpm run mcp:inspect- Test with MCP Inspector
Testing with MCP Inspector
npm run build
npm run mcp:inspectThis opens the MCP Inspector for interactive testing of all tools.
π Project Structure
mcp-ts-stdio-nasa/
βββ src/
β βββ index.ts # Main server entry point
β βββ tools/ # NASA API tool implementations
β β βββ apod.tool.ts
β β βββ mars-rover.tool.ts
β β βββ neo.tool.ts
β β βββ donki.tool.ts
β β βββ epic.tool.ts
β βββ services/ # NASA API service layer
β β βββ nasa.service.ts
β βββ types/ # TypeScript type definitions
β β βββ nasa.ts
β βββ utils/ # Utility functions
β βββ config.ts
β βββ logger.ts
βββ dist/ # Compiled JavaScript
βββ docs/ # Documentation
βββ package.json
βββ tsconfig.jsonπ NASA API Information
This server uses NASA's public APIs. You can:
Use
DEMO_KEYfor testing (limited rate)Get a free API key at https://api.nasa.gov/
Most endpoints allow 1000 requests/hour with an API key
API Documentation
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
NASA for providing public APIs
Anthropic for the MCP specification
Model Context Protocol community
π§ Contact
Author: Jez (Jeremy Dawes)
Email: jeremy@jezweb.net
Website: www.jezweb.com.au
π Links
Made with β€οΈ for the space and AI communities
Available Tools
5 toolsnasa_apodC
Get NASA Astronomy Picture of the Day with detailed explanation
Inputs: date.
nasa_donki_space_weatherB
Get space weather events from NASA DONKI (Database Of Notifications, Knowledge, Information)
Inputs: event_type, start_date, end_date.
nasa_epic_earth_imageryB
Get full disc imagery of Earth from DSCOVR's Earth Polychromatic Imaging Camera
Inputs: image_type, date, limit.
nasa_mars_rover_photosC
Get photos from Mars rovers (Curiosity, Opportunity, Spirit, Perseverance)
Inputs: rover, sol, earth_date, camera, +1 more.
nasa_neo_feedB
Get Near Earth Objects (asteroids) passing near Earth within a date range
Inputs: start_date, end_date.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose targeting different NASA data sources: APOD, space weather, Earth imagery, Mars rover photos, and near-Earth objects. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent 'nasa_' prefix and descriptive snake_case naming pattern (e.g., nasa_apod, nasa_donki_space_weather). This predictability aids in understanding and usage across the toolset.
With 5 tools, the server is well-scoped for providing access to various NASA APIs. Each tool serves a distinct data source, making the count appropriate and manageable for the domain without being overwhelming or insufficient.
The toolset covers a broad range of NASA data sources, but there are minor gaps such as missing tools for other NASA APIs (e.g., NASA Image and Video Library, planetary data). However, the included tools provide solid coverage for common use cases without major dead ends.
Maintenance
Related MCP Connectors
NASA MCP β wraps NASA Open APIs (api.nasa.gov)
Live space data for AI agents - rocket launches, ISS passes, launch news. Free, no auth.
NASA astronomy photo of the day + imagery. $0.01/query. Be born in one call β free testnet funds.
NASA data: near-Earth objects, space weather, and astronomy pictures
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA feature-rich NASA data query tool that supports various NASA API services including astronomy pictures, Mars rover photos, Earth satellite images, near-Earth objects data, and space weather information through natural language queries.4 npm2MIT
- AlicenseBqualityDmaintenanceEnables access to NASA space data and images through Claude Desktop, providing features like astronomy picture of the day, Mars rover photos, near-Earth object information, NASA image search, and Earth satellite imagery.5MIT
- AlicenseBqualityDmaintenanceProvides standardized access to 20+ NASA data sources including astronomy pictures, Mars rover photos, near-Earth objects, satellite imagery, space weather, and planetary data through a unified interface optimized for AI consumption.2313 npmISC
- AlicenseNot gradedqualityDmaintenanceProvides 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.24 PyPI5MIT