aqc-mcp
# Astroquery MCP Server š
A Model Context Protocol (MCP) server for astroquery-cli, providing HTTP and SSE (Server-Sent Events) transport options.
---
## Overview āØ
The aqc-mcp server provides direct HTTP/TAP API access to 17+ astronomical databases as MCP tools, allowing AI applications and other services to query astronomical data through standardized MCP protocols. Supports both HTTP and SSE transports.
---
## Features š
- ā” **MCP Protocol**: Full implementation of MCP specification
- š **Multiple Transports**:
- HTTP (default)
- SSE (Server-Sent Events)
- Stdio (for Claude Desktop)
- š **17 Databases**: Direct TAP/REST API access to major astronomical archives
- š **Language Support**: Multi-language output (English, Chinese)
- š **Rich Output**: Formatted tables and structured results
- š **ADS API Token Support**: Environment variable injection for authenticated queries
- ā” **No Python Required**: Pure Node.js/TypeScript implementation
---
## Supported Modules š§©
Currently implemented tools (17 astronomical databases):
### General Astronomy
- **SIMBAD**: Query SIMBAD astronomical database
- **VizieR**: Query VizieR catalog database
- **NED**: NASA/IPAC Extragalactic Database
- **ADS**: NASA Astrophysics Data System queries (requires API token)
### Radio & Millimeter
- **ALMA**: Query ALMA observations archive
- **ESO**: European Southern Observatory science archive
### High Energy & X-ray
- **Fermi LAT**: Fermi Large Area Telescope gamma-ray source catalog
- **HEASARC**: High Energy Astrophysics Science Archive (multiple missions)
### Infrared & Submillimeter
- **IRSA**: NASA/IPAC Infrared Science Archive
### Space Observatories
- **MAST**: Barbara A. Mikulski Archive for Space Telescopes
- **ESASky**: Multi-mission all-sky archive
### Solar System
- **JPL Horizons**: Solar system body ephemerides and state vectors
- **JPL SBDB**: Small-Body Database for asteroids and comets
### Exoplanets & Stars
- **Exoplanet**: NASA Exoplanet Archive
- **AAVSO**: Variable Star Index (VSX catalog)
- **NIST**: Atomic Spectra Database for spectral lines
### Optical Surveys
- **Gaia**: Gaia DR3 catalog cone search and ADQL queries
- **SDSS**: Sloan Digital Sky Survey (DR18)
- **Splatalogue**: Spectral line database
### Total: 17 databases, 30+ tools
---
## Installation š ļø
### Quick Start
**Prerequisites:**
- Node.js ā„ 18.0.0
**No Python dependency required** - aqc-mcp uses direct HTTP/TAP APIs to astronomical services.
### MCP Server Configuration
Add to your Claude Desktop config file:
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"aqc-mcp": {
"command": "npx",
"args": ["-y", "aqc-mcp"],
"env": {
"ADS_API_KEY": "your-ads-api-token-here"
}
}
}
}
```
**Without ADS token:**
```json
{
"mcpServers": {
"aqc-mcp": {
"command": "npx",
"args": ["-y", "aqc-mcp"]
}
}
}
```
### Alternative: Global Install
```bash
npm install -g aqc-mcp
```
Then use in config:
```json
{
"mcpServers": {
"aqc-mcp": {
"command": "aqc-mcp"
}
}
}
```
---
## Usage š
### 1. Start Server
#### HTTP Mode (default)
```bash
npm start
# or
npm run dev
```
Server will start on `http://localhost:3000`
#### With ADS API Token
```bash
ADS_API_KEY="your-token" npm start
```
#### Custom Port
```bash
PORT=8080 npm start
```
#### SSE Mode
```bash
MCP_TRANSPORT=http npm start
```
#### Stdio Mode (for Claude Desktop)
```bash
MCP_TRANSPORT=stdio npm run dev
```
---
### 2. API Endpoints
#### Health Check
```bash
curl http://localhost:3000/health
```
#### Server Info
```bash
curl http://localhost:3000/
```
#### SSE Connection
```bash
curl http://localhost:3000/sse
```
---
## MCP Tools š§
### simbad_query
Query SIMBAD astronomical database.
**Parameters:**
- `object_name` (string, required): Object name (e.g., "M31", "NGC 1234")
- `lang` (string, optional): Output language ("en", "zh", "ja")
**Example:**
```json
{
"name": "simbad_query",
"arguments": {
"object_name": "M31",
"lang": "en"
}
}
```
---
### vizier_query
Query VizieR catalog database.
**Parameters:**
- `target` (string, required): Target name or coordinates
- `radius` (string, required): Search radius (e.g., "10arcsec", "0.5deg")
- `catalog` (string, optional): Specific catalog name
- `lang` (string, optional): Output language
**Example:**
```json
{
"name": "vizier_query",
"arguments": {
"target": "M31",
"radius": "10arcsec",
"catalog": "I/345/gaia2"
}
}
```
---
### alma_query
Query ALMA observations archive.
**Parameters:**
- `object_name` (string, required): Object name
- `lang` (string, optional): Output language
**Example:**
```json
{
"name": "alma_query",
"arguments": {
"object_name": "Orion KL"
}
}
```
---
### ads_query
Query NASA Astrophysics Data System.
**Parameters:**
- `query` (string, optional): Search query string
- `latest` (boolean, optional): Get latest papers
- `review` (boolean, optional): Get review articles only
- `lang` (string, optional): Output language
**Requirements:**
- Set `ADS_API_KEY` environment variable before starting the server
**Example:**
```json
{
"name": "ads_query",
"arguments": {
"latest": true,
"lang": "en"
}
}
```
---
### gaia_cone_search
Query Gaia archive via cone search.
**Parameters:**
- `target` (string, required): Target name or coordinates
- `radius` (string, optional): Search radius (default: "10arcsec")
- `lang` (string, optional): Output language
**Example:**
```json
{
"name": "gaia_cone_search",
"arguments": {
"target": "M31",
"radius": "1arcmin"
}
}
```
---
## HTTP API Examples š”
### Call a Single Tool
```bash
curl -X POST http://localhost:3000/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "simbad_query",
"arguments": {
"object_name": "M31"
}
}'
```
### Batch Call Multiple Tools
```bash
curl -X POST http://localhost:3000/tools/batch \
-H "Content-Type: application/json" \
-d '{
"tools": [
{
"name": "simbad_query",
"arguments": {"object_name": "M31"}
},
{
"name": "gaia_cone_search",
"arguments": {"target": "M31", "radius": "10arcsec"}
}
]
}'
```
---
## Claude Desktop Integration š„ļø
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
```json
{
"mcpServers": {
"astroquery": {
"command": "node",
"args": ["/path/to/astroquery-cli/astroquery-mcp/dist/index.js"],
"env": {
"MCP_TRANSPORT": "stdio",
"ADS_API_KEY": "your-ads-api-token-here"
}
}
}
}
```
---
## Development šØ
### Watch Mode
```bash
npm run watch
```
### Project Structure
```
aqc-mcp/
āāā src/
ā āāā index.ts # Main server entry
ā āāā tools/ # MCP tool definitions (17 databases)
ā ā āāā index.ts # Tool registration
ā ā āāā simbad.ts # SIMBAD queries
ā ā āāā vizier.ts # VizieR catalog queries
ā ā āāā alma.ts # ALMA archive queries
ā ā āāā ads.ts # ADS bibliographic queries
ā ā āāā gaia.ts # Gaia DR3 queries
ā ā āāā aavso.ts # AAVSO VSX variable stars
ā ā āāā fermi.ts # Fermi LAT gamma-ray sources
ā ā āāā heasarc.ts # HEASARC queries
ā ā āāā esasky.ts # ESASky multi-mission archive
ā ā āāā eso.ts # ESO science archive
ā ā āāā exoplanet.ts # NASA Exoplanet Archive
ā ā āāā irsa.ts # IRSA infrared archive
ā ā āāā jpl.ts # JPL Horizons & SBDB
ā ā āāā mast.ts # MAST space telescopes
ā ā āāā ned.ts # NED extragalactic DB
ā ā āāā nist.ts # NIST atomic spectra
ā ā āāā sdss.ts # SDSS optical survey
ā ā āāā splatalogue.ts # Spectral line database
ā āāā utils/
ā āāā http.ts # HTTP/TAP client utilities
āāā dist/ # Compiled JavaScript
āāā package.json
āāā tsconfig.json
```
---
## Environment Variables š§
| Variable | Description | Default | Required |
|----------|-------------|---------|----------|
| `MCP_TRANSPORT` | Transport mode (`http`, `stdio`) | `stdio` | No |
| `PORT` | HTTP server port | `3000` | No |
| `ADS_API_KEY` | NASA ADS API token | - | For ADS queries |
---
## Troubleshooting š
### ADS queries fail
Set the `ADS_API_KEY` environment variable:
```bash
export ADS_API_KEY="your-token"
npm start
```
### Port already in use
Change the port:
```bash
PORT=8080 npm start
```
### Query timeouts
Some astronomical databases (e.g., Fermi LAT, HEASARC) may take longer to respond. The server uses reasonable timeout values, but you can adjust them if needed by modifying the `timeout` parameter in the HTTP client.
---
## License š
BSD-3-Clause
---
## Contributing š¤
Contributions welcome! Please open an issue or PR.
---
## Links š
- [astrocli](https://github.com/inoribea/astrocli)
- [MCP Specification](https://modelcontextprotocol.io/)
- [NASA ADS API](https://ui.adsabs.harvard.edu/)
TDQS
Scored across 23 tools
Each tool maps to a distinct astronomy archive or service, so most are easily differentiated by target source. However, the IRSA pair (irsa_tap vs irsa_query) and the Gaia/Fermi ADQL vs cone/catalog pairs could cause slight confusion about which to pick for a given query.
Names consistently use snake_case and generally follow a service_query or service_action pattern. Some action suffixes vary (tap, adql, cone_search, horizons, sbdb, lines), but the pattern remains readable and domain-consistent.
At 23 tools, the set is heavy and includes multiple similar query endpoints for different archives. For a broad astronomy aggregator the breadth is defensible, but the count is above the typical well-scoped range and adds cognitive load.
The surface covers a wide range of major astronomical archives and services, with read-only queries appropriate for the domain. Minor gaps exist, such as no generic TAP discovery or data-product download, but core research workflows are well supported.