MCP TypeScript NASA Server
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 events, and Earth imagery.
README
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
🚀 Quick Start
Run with NPX (Recommended - No Installation Required)
npx mcp-ts-stdio-nasa
This command downloads and runs the latest version directly from npm.
Install Globally
npm install -g mcp-ts-stdio-nasa
mcp-ts-stdio-nasa
Install 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 dev
Scripts
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:inspect
This 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。