{"_id":"@bachstudio/nasa-mcp-server","name":"@bachstudio/nasa-mcp-server","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bachstudio/nasa-mcp-server","version":"1.0.0","description":"Model Context Protocol (MCP) server for NASA APIs","main":"dist/index.js","bin":{"nasa-mcp-server":"dist/index.js"},"scripts":{"build":"npm install && tsc && shx chmod +x dist/*.js","start":"node dist/index.js","start:sse":"node dist/sse-server.js","dev":"tsx watch src/index.ts","dev:sse":"tsx watch src/sse-server.ts","lint":"eslint .","test":"jest","direct-test":"ts-node src/tests/direct-api-test.ts","custom-test":"ts-node src/tests/custom-client/nasa-mcp-test.ts","simple-test":"ts-node src/tests/custom-client/simple-test.ts"},"keywords":["nasa","api","mcp","typescript"],"author":{"name":"bachstudio"},"license":"ISC","publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"repository":{"type":"git","url":"git+https://github.com/BACH-AI-Tools/NASA-MCP-server.git"},"dependencies":{"@anthropic-ai/sdk":"","@modelcontextprotocol/sdk":"^1.9.0","axios":"","cors":"","dotenv":"","express":"","zod":""},"devDependencies":{"@types/cors":"","@types/express":"","@types/jest":"","@types/node":"","@typescript-eslint/eslint-plugin":"^7.18.0","@typescript-eslint/parser":"^7.18.0","cross-env":"^7.0.3","eslint":"^8.57.1","jest":"","shx":"^0.4.0","ts-jest":"","ts-node":"","typed-rpc":"^6.1.1","typescript":""},"gitHead":"7ee4cf5b73a79b2c97f6cd12990996b1ed555d04","bugs":{"url":"https://github.com/BACH-AI-Tools/NASA-MCP-server/issues"},"homepage":"https://github.com/BACH-AI-Tools/NASA-MCP-server#readme","_id":"@bachstudio/nasa-mcp-server@1.0.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vn1bu0niiIUx2o8EMvYMSueH3eEI2eOSau/UZQeya5zOc0I2SqYryrLbTKqWhYQWnQmD2ntBWynnbiVT3U0n9Q==","shasum":"ea2f7f60fcd799cec0420ae142e2ed676598b145","tarball":"https://registry.npmjs.org/@bachstudio/nasa-mcp-server/-/nasa-mcp-server-1.0.0.tgz","fileCount":37,"unpackedSize":269526,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDelrJw/6Ev7Rtam9JADZvMUM/VdM5YpIZx0t7WXZ081gIgIm+qO31oR6gwIRRs4zbV7Z5gfOS4hWEfW5Z2I72yhPo="}]},"_npmUser":{"name":"bachstudio","email":"bach_mcp_studio@bach.team"},"directories":{},"maintainers":[{"name":"bachstudio","email":"bach_mcp_studio@bach.team"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nasa-mcp-server_1.0.0_1763631427153_0.0064238044124551585"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-20T09:37:07.058Z","1.0.0":"2025-11-20T09:37:07.396Z","modified":"2025-11-20T09:37:07.748Z"},"maintainers":[{"name":"bachstudio","email":"bach_mcp_studio@bach.team"}],"description":"Model Context Protocol (MCP) server for NASA APIs","homepage":"https://github.com/BACH-AI-Tools/NASA-MCP-server#readme","keywords":["nasa","api","mcp","typescript"],"repository":{"type":"git","url":"git+https://github.com/BACH-AI-Tools/NASA-MCP-server.git"},"author":{"name":"bachstudio"},"bugs":{"url":"https://github.com/BACH-AI-Tools/NASA-MCP-server/issues"},"license":"ISC","readme":"[![NPM Version](https://img.shields.io/npm/v/%40bachstudio%2Fnasa-mcp-server?link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40bachstudio%2Fnasa-mcp-server)](https://www.npmjs.com/package/@bachstudio/nasa-mcp-server)\n\n# NASA MCP Server\n\nA Model Context Protocol (MCP) server for NASA APIs, providing a standardized interface for AI models to interact with NASA's vast array of data sources. This server implements the official Model Context Protocol specification.\n\nBig thanks to the MCP community for their support and guidance!\n\n## Features\n\n* Access to 20+ NASA data sources through a single, consistent interface\n* Standardized data formats optimized for AI consumption\n* Automatic parameter validation and error handling\n* Rate limit management for NASA API keys\n* Comprehensive documentation and examples\n* Support for various NASA imagery formats\n* Data conversion and formatting for LLM compatibility\n* Cross-platform support (Windows, macOS, Linux)\n\n## Disclaimer\n\n**This project is not affiliated with, endorsed by, or related to NASA (National Aeronautics and Space Administration) or any of its subsidiaries or its affiliates.** It is an independent implementation that accesses NASA's publicly available APIs. All NASA data used is publicly available and subject to NASA's data usage policies.\n\n## Installation\n\n### Running with npx\n\n```bash\nenv NASA_API_KEY=YOUR_API_KEY npx -y @bachstudio/nasa-mcp-server@latest\n```\n\nYou can also pass the API key as a command line argument:\n\n```bash\nnpx -y @bachstudio/nasa-mcp-server@latest --nasa-api-key=YOUR_API_KEY\n```\n\n### Using SuperGateway for Server-Sent Events (SSE)\n\nYou can use [SuperGateway](https://github.com/supercorp-ai/supergateway) for Server-Sent Events (SSE).\n\n**The developers of NASA-MCP-server DO NOT ENDORSE the SuperGateway repository. This information is provided for those who wish to implement SSE functionality at their own discretion.**\n\n### Manual Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/BACH-AI-Tools/NASA-MCP-server.git\n\n# Install dependencies\ncd NASA-MCP-server\nnpm install\n\n# Run with your API key\nNASA_API_KEY=YOUR_API_KEY npm start\n```\n\n### Running on Cursor\n\nConfiguring Cursor 🖥️ Note: Requires Cursor version 0.45.6+\n\nTo configure NASA MCP Server in Cursor:\n\nCreate or edit an `mcp.json` file in your Cursor configuration directory with the following content:\n\n```json\n{\n  \"mcpServers\": {\n    \"nasa-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@bachstudio/nasa-mcp-server@latest\"],\n      \"env\": {\n        \"NASA_API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\nReplace `your-api-key` with your NASA API key from https://api.nasa.gov/.\n\nAfter adding the configuration, restart Cursor to see the new NASA tools. The Composer Agent will automatically use NASA MCP when appropriate for space-related queries.\n\n## Environment Variables\n\nThe server can be configured with the following environment variables:\n\n| Variable | Description |\n|----------|-------------|\n| `NASA_API_KEY` | Your NASA API key (get at api.nasa.gov) |\n\n## Included NASA APIs\n\nThis MCP server integrates the following NASA APIs:\n\n1. **NASA Open API** (api.nasa.gov):\n   - APOD (Astronomy Picture of the Day)\n   - EPIC (Earth Polychromatic Imaging Camera)\n   - DONKI (Space Weather Database Of Notifications, Knowledge, Information)\n   - Insight (Mars Weather Service)\n   - Mars Rover Photos\n   - NEO (Near Earth Object Web Service)\n   - EONET (Earth Observatory Natural Event Tracker)\n   - TLE (Two-Line Element)\n   - NASA Image and Video Library\n   - Exoplanet Archive\n   - NASA Sounds API (Beta)\n   - POWER (Prediction Of Worldwide Energy Resources)\n\n2. **JPL Solar System Dynamics API** (ssd-api.jpl.nasa.gov):\n   - SBDB (Small-Body DataBase)\n   - SBDB Close-Approach Data\n   - Fireball Data\n   - Scout API\n\n3. **Earth Data APIs**:\n   - GIBS (Global Imagery Browse Services)\n   - CMR (Common Metadata Repository) - Enhanced with advanced search capabilities\n   - EPIC (Earth Polychromatic Imaging Camera)\n   - FIRMS (Fire Information for Resource Management System)\n\n## API Methods\n\nEach NASA API is exposed through standardized MCP methods:\n\n### APOD (Astronomy Picture of the Day)\n\n```json\n{\n  \"method\": \"nasa/apod\",\n  \"params\": {\n    \"date\": \"2023-01-01\", // Optional: YYYY-MM-DD format\n    \"count\": 5, // Optional: Return a specified number of random images\n    \"thumbs\": true // Optional: Return URL of video thumbnail\n  }\n}\n```\n\n### Mars Rover Photos\n\n```json\n{\n  \"method\": \"nasa/mars-rover\",\n  \"params\": {\n    \"rover\": \"curiosity\", // Required: \"curiosity\", \"opportunity\", or \"spirit\"\n    \"sol\": 1000, // Either sol or earth_date is required\n    \"earth_date\": \"2023-01-01\", // YYYY-MM-DD format\n    \"camera\": \"FHAZ\" // Optional: Filter by camera type\n  }\n}\n```\n\n### Near Earth Objects\n\n```json\n{\n  \"method\": \"nasa/neo\",\n  \"params\": {\n    \"start_date\": \"2023-01-01\", // Required: YYYY-MM-DD format\n    \"end_date\": \"2023-01-07\" // Required: YYYY-MM-DD format (max 7 days from start)\n  }\n}\n```\n\n### GIBS (Global Imagery Browse Services)\n\n```json\n{\n  \"method\": \"nasa/gibs\",\n  \"params\": {\n    \"layer\": \"MODIS_Terra_CorrectedReflectance_TrueColor\", // Required: Layer ID\n    \"date\": \"2023-01-01\", // Required: YYYY-MM-DD format\n    \"format\": \"png\" // Optional: \"png\" or \"jpg\"\n  }\n}\n```\n\n### POWER (Prediction Of Worldwide Energy Resources)\n\n```json\n{\n  \"method\": \"nasa/power\",\n  \"params\": {\n    \"parameters\": \"T2M,PRECTOTCORR,WS10M\", // Required: Comma-separated list\n    \"community\": \"re\", // Required: Community identifier\n    \"latitude\": 40.7128, // Required: Latitude\n    \"longitude\": -74.0060, // Required: Longitude\n    \"start\": \"20220101\", // Required: Start date (YYYYMMDD)\n    \"end\": \"20220107\" // Required: End date (YYYYMMDD)\n  }\n}\n```\n\nFor complete documentation of all available methods and parameters, see the API reference in the `/docs` directory.\n\n## Logging System\n\nThe server includes comprehensive logging:\n\n* Operation status and progress\n* Performance metrics\n* Rate limit tracking\n* Error conditions\n* Request validation\n\nExample log messages:\n\n```\n[INFO] NASA MCP Server initialized successfully\n[INFO] Processing APOD request for date: 2023-01-01\n[INFO] Fetching Mars Rover data for Curiosity, sol 1000\n[WARNING] Rate limit threshold reached (80%)\n[ERROR] Invalid parameter: 'date' must be in YYYY-MM-DD format\n```\n\n## Security Considerations\n\nThis MCP server implements security best practices following the Model Context Protocol specifications:\n\n* Input validation and sanitization using Zod schemas\n* No execution of arbitrary code\n* Protection against command injection\n* Proper error handling to prevent information leakage\n* Rate limiting and timeout controls for API requests\n* No persistent state that could be exploited across sessions\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/BACH-AI-Tools/NASA-MCP-server.git\n\n# Install dependencies\nnpm install\n\n# Copy the example environment file and update with your API keys\ncp .env.example .env\n\n# Build the TypeScript code\nnpm run build\n\n# Start the development server\nnpm run dev\n\n# Run tests\nnpm test\n```\n\n## Testing with MCP Inspector\n\nThe NASA MCP Server includes a script to help you test the APIs using the MCP Inspector:\n\n```bash\n# Run the provided test script\n./scripts/test-with-inspector.sh\n```\n\nThis will:\n1. Build the project to ensure the latest changes are included\n2. Start the MCP Inspector with the NASA MCP server running\n3. Allow you to interactively test all the NASA APIs\n\n### Example Test Requests\n\nThe repository includes example test requests for each API that you can copy and paste into the MCP Inspector:\n\n```bash\n# View the example test requests\ncat docs/inspector-test-examples.md\n```\n\nFor detailed examples, see the [Inspector Test Examples](docs/inspector-test-examples.md) document.\n\n## MCP Client Usage\n\nThis server follows the official Model Context Protocol. Here's an example of how to use it with the MCP SDK:\n\n```typescript\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { HttpClientTransport } from \"@modelcontextprotocol/sdk/client/http.js\";\n\nconst transport = new HttpClientTransport({\n  url: \"http://localhost:3000\",\n});\n\nconst client = new Client({\n  name: \"mcp-client\",\n  version: \"1.0.0\",\n});\n\nawait client.connect(transport);\n\n// Example: Get today's Astronomy Picture of the Day\nconst apodResult = await client.request({\n  method: \"nasa/apod\", \n  params: {}\n});\n\n// Example: Get Mars Rover photos\nconst marsRoverResult = await client.request({\n  method: \"nasa/mars-rover\",\n  params: { rover: \"curiosity\", sol: 1000 }\n});\n\n// Example: Search for Near Earth Objects\nconst neoResults = await client.request({\n  method: \"nasa/neo\",\n  params: {\n    start_date: '2023-01-01',\n    end_date: '2023-01-07'\n  }\n});\n\n// Example: Get satellite imagery from GIBS\nconst satelliteImage = await client.request({\n  method: \"nasa/gibs\",\n  params: {\n    layer: 'MODIS_Terra_CorrectedReflectance_TrueColor',\n    date: '2023-01-01'\n  }\n});\n\n// Example: Use the new POWER API\nconst powerData = await client.request({\n  method: \"nasa/power\",\n  params: {\n    parameters: \"T2M,PRECTOTCORR,WS10M\",\n    community: \"re\",\n    latitude: 40.7128,\n    longitude: -74.0060,\n    start: \"20220101\",\n    end: \"20220107\"\n  }\n});\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Run tests: `npm test`\n4. Submit a pull request\n\n## License\n\nISC License - see LICENSE file for details \n","readmeFilename":"README.md","_rev":"1-2f08bc4eaa67c842ce4d2008d9627b36"}