Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copy to .env (never commit .env). Values here are placeholders.

# api.nasa.gov key for APOD, NEO, DONKI and Mars Rover Photos.
# api.nasa.gov key for APOD, NEO and DONKI.
# Get one at https://api.nasa.gov/ (DEMO_KEY works for light use).
NASA_API_KEY=YOUR_NASA_API_KEY

Expand Down
43 changes: 7 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The server can be configured with the following environment variables:

## Transport Modes

By default, the server runs over stdio for local MCP clients such as Cursor and Claude Desktop.
By default, the server runs over stdio for local MCP clients such as Cursor.

To run the optional Streamable HTTP transport:

Expand All @@ -105,13 +105,11 @@ This MCP server integrates the following NASA APIs:
- EPIC (Earth Polychromatic Imaging Camera)
- DONKI (Space Weather Database Of Notifications, Knowledge, Information)
- Insight (Mars Weather Service)
- Mars Rover Photos
- NEO (Near Earth Object Web Service)
- EONET (Earth Observatory Natural Event Tracker)
- TLE (Two-Line Element)
- NASA Image and Video Library
- Exoplanet Archive
- NASA Sounds API (Beta)
- POWER (Prediction Of Worldwide Energy Resources)

2. **JPL Solar System Dynamics API** (ssd-api.jpl.nasa.gov):
Expand Down Expand Up @@ -143,20 +141,6 @@ Each NASA API is exposed through standardized MCP methods:
}
```

### Mars Rover Photos

```json
{
"method": "nasa/mars-rover",
"params": {
"rover": "curiosity", // Required: "curiosity", "opportunity", or "spirit"
"sol": 1000, // Either sol or earth_date is required
"earth_date": "2023-01-01", // YYYY-MM-DD format
"camera": "FHAZ" // Optional: Filter by camera type
}
}
```

### Near Earth Objects

```json
Expand Down Expand Up @@ -254,7 +238,6 @@ Example log messages:
```
[INFO] NASA MCP Server initialized successfully
[INFO] Processing APOD request for date: 2023-01-01
[INFO] Fetching Mars Rover data for Curiosity, sol 1000
[WARNING] Rate limit threshold reached (80%)
[ERROR] Invalid parameter: 'date' must be in YYYY-MM-DD format
```
Expand Down Expand Up @@ -285,26 +268,23 @@ cp .env.example .env
# Build the TypeScript code
npm run build

# Start the development server
npm run dev
# Start the server
npm start

# Run tests
npm test
```

## Testing with MCP Inspector

The NASA MCP Server includes a script to help you test the APIs using the MCP Inspector:
To test the tools interactively, build the project and start the official [MCP Inspector](https://github.com/modelcontextprotocol/inspector) with the server:

```bash
# Run the provided test script
./scripts/test-with-inspector.sh
npm run build
npx @modelcontextprotocol/inspector node dist/index.js
```

This will:
1. Build the project to ensure the latest changes are included
2. Start the MCP Inspector with the NASA MCP server running
3. Allow you to interactively test all the NASA APIs
The server reads `NASA_API_KEY` and `FIRMS_MAP_KEY` from a `.env` file in the working directory (see Development above). The Inspector prints a local URL; open it to list and call the tools.

### Example Test Requests

Expand Down Expand Up @@ -346,15 +326,6 @@ const apodResult = await client.request({
}
}, CallToolResultSchema);

// Example: Get Mars Rover photos
const marsRoverResult = await client.request({
method: "tools/call",
params: {
name: "nasa/mars-rover",
arguments: { rover: "curiosity", sol: 1000 }
}
}, CallToolResultSchema);

// Example: Search for Near Earth Objects
const neoResults = await client.request({
method: "tools/call",
Expand Down
Loading