Space Rocks MCP
An MCP server I built for NASA's meteor and asteroid data, running on AWS. AI agents like Claude can use it as a tool. The panel below calls it live, the same way they do.
What's an MCP server?
MCP, the Model Context Protocol, is an open standard for connecting AI apps to tools and data. Instead of building a separate integration for every AI app, you build one server. Any app that speaks MCP can discover its tools, read their descriptions, and call them when a question needs them.
Mine has three tools. Each one returns trimmed, labeled data instead of NASA's raw JSON, so a model doesn't have to guess what a field means.
| Tool | Answers |
|---|---|
get_recent_fireballs | Which bright meteors hit Earth's atmosphere recently, where, and how much energy they released (NASA JPL CNEOS) |
get_asteroids_approaching | Which asteroids pass Earth in the next week, how close, how big and how fast (NASA NeoWs) |
get_asteroid_details | Everything about one asteroid, including its next close approaches |
How a request gets to NASA
- This pageAsks
/api/space-rocksfor one of two fixed questions. Visitors can't send their own arguments. - A Vercel functionTrades its Vercel identity token with AWS for credentials that last 15 minutes, then signs the MCP request with them. No AWS keys are stored anywhere.
- Amazon API GatewayChecks the signature. An unsigned request gets a 403 before any code runs.
- AWS LambdaRuns the MCP server (Python, MCP SDK). It identifies the caller, allows each caller 20 calls a minute (counted in DynamoDB), and logs every call.
- NASAThe server calls NeoWs or the JPL Fireball API. The NASA key lives in AWS Secrets Manager.
- Back to youThe answer comes back as structured data with units and descriptions, cached for 15 minutes.
Security, layer by layer
No stored keys
Vercel and AWS trust each other through OIDC federation. Every function run gets fresh, short-lived credentials.
One permission
The website's AWS role can call POST /mcp on this one API. Nothing else in the account.
Checked at the door
API Gateway verifies every request's signature before the server's code ever runs.
Every call attributed
The server logs who called which tool, with which arguments, and limits each caller separately.
Least privilege inside
The Lambda function can write its own logs, read one secret and update one table. That's all.
Built with
Data: NASA NeoWs and JPL CNEOS