
Nasa Images
io.github.kaitoy由 GitHub 帳號 kaitoy 發布v1.1.3更新於 Oct 24, 2026
MCP server with UI for NASA images
概覽
依關鍵字搜尋 NASA 圖片庫,並在互動式圖片檢視器中顯示結果,可逐張瀏覽符合的圖片。
- 可以做什麼
- 透過 NASA Images API 依關鍵字搜尋 NASA 圖片庫
- 在目前的搜尋結果中逐張切換檢視圖片
- 以資源形式提供目前顯示圖片的網址
- 在用戶端內呈現互動式 HTML 圖片檢視器介面
- 適用情境
- 適合讓助理尋找某個主題的 NASA 照片或任務影像並直接瀏覽結果,例如用於資料查詢、教學或簡報素材。
- 執行需求
- 以 Node.js 本機套件形式執行(需 Node.js 18 以上、npm 或 yarn),透過 stdio 通訊,也可作為 HTTP 伺服器執行於 3000 等連接埠。需在 NASA_API_KEY 環境變數提供 NASA API 金鑰(可於 NASA 免費申請),並需要連線至 NASA Images API 的對外 HTTPS 網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Nasa Images,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
NASA Images MCP Server
A project to search NASA's image library using an MCP server and display images in an interactive UI.
🌟 Features:
- Dual Transport Support: Supports both stdio and Streamable HTTP transport
- Image Search: Search by keywords using NASA's Images API
- Interactive UI: Beautiful image viewer using MCP Apps Pattern
- Image Navigation: Display search results sequentially
- Session Management: Stateful session management
Requirements
- Node.js 18 or higher
- npm or yarn
- NASA API Key (get free at nasa.gov/api)
Installation
- Clone the repository:
- Install dependencies:
- Set up environment variables:
Edit the .env file to configure your NASA API key:
- Build:
Getting a NASA API Key
- Visit https://api.nasa.gov/
- Enter your name and email address in the form
- The API key will be sent to your email immediately
- Add it to your
.envfile
Rate Limits:
- DEMO_KEY: 30 requests/hour, 50 requests/day
- Registered key: 1000 requests/hour
Usage
stdio Mode (Recommended for MCP Clients like Claude Desktop)
In stdio mode, the server communicates via stdin/stdout — no HTTP server is started. Logs are written to stderr.
Run with npx (no installation required)
Run from local build
Pass the --stdio flag to use stdio transport:
Claude Desktop Configuration
Using npx (recommended):
Using local build:
HTTP Server Mode
The server will start at http://localhost:3000.
Start on a Different Port
About Transports
stdio Transport
Suitable for local MCP clients (e.g., Claude Desktop) that launch the server as a subprocess.
- Communicates via stdin/stdout
- Single session per process
- No network configuration required
Streamable HTTP Transport
The latest MCP HTTP transport protocol, suitable for remote or multi-client scenarios.
Key Features:
- ✅ Stateful Sessions: Issues a unique session ID for each client
- ✅ SSE Support: Supports push notifications from the server via Server-Sent Events
- ✅ JSON-RPC over HTTP: Communication via standard HTTP request/response
- ✅ Session Management: Automatic session lifecycle management
Integration with MCP Clients
Connecting with MCP Inspector (HTTP mode)
You can test the server using MCP Inspector:
Connecting with MCP Inspector (stdio mode)
Using with Custom MCP Clients
Steps to connect from a custom client:
- Initialize Request (POST /mcp):
The response headers will include mcp-session-id.
- Subsequent Requests:
- SSE Stream (GET /mcp):
Endpoints
Available Tools
1. search_nasa_images
Search NASA's image library.
Parameters:
query(string, required): Search query (e.g., "apollo 11", "mars rover")
Usage Example (JSON-RPC):
2. get_next_image
Display the next image from the current search results.
Parameters: None
Usage Example (JSON-RPC):
Available Resources
nasa-image://current
Get the URL of the currently displayed image.
MIME Type: text/uri-list
ui://nasa-images/viewer
HTML UI resource for the image viewer.
MIME Type: text/html;profile=mcp-app
Architecture
stdio Mode
HTTP Mode
Main Components
- src/index.ts: Express server and transport management
- src/mcp-server.ts: MCP server logic (tool and resource registration)
- src/session-manager.ts: Session management (search state persistence)
- src/nasa-api.ts: NASA API client
- src/types.ts: TypeScript type definitions
Development
Watch Mode
Automatically rebuilds when files change.
Development Mode
Builds and immediately starts the server.
Troubleshooting
Port Already in Use
Solution: Specify a different port:
"Cannot find module" Error
Run:
to compile TypeScript.
API Rate Limit Error
- If using
DEMO_KEY, obtain your own API key from api.nasa.gov - Limited to 30 requests per hour
"Not Acceptable" Error
The client must accept both MIME types:
application/jsontext/event-stream
Session Not Found
Save the mcp-session-id header returned after the initialization request and send it as the mcp-session-id header in subsequent requests.
Security Notes
- This server has CORS enabled (for development)
- In production, implement proper CORS settings and rate limiting
- Manage NASA API keys via environment variables; do not hardcode them
License
MIT
References
- Model Context Protocol Specification
- MCP TypeScript SDK
- MCP Apps Extension
- Streamable HTTP Transport
- NASA Images API
- NASA Open APIs
Contributing
Pull requests are welcome! Bug reports and feature requests are accepted via Issues.
Support
If you encounter issues, please create an Issue or refer to the NASA API support page.
來源:README.md,提交 cda5828
工具
0版本歷史
1- v1.1.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分