search_objectsLABSCO SUMMARY
The file registry is what makes it usable twice.
Anything you search is written out with a descriptive filename and provenance metadata, so the second question — 'convert that to FITS', 'show me the structure' — works on the same artefact rather than re-running the query. The dependency install is the part that decides whether it works: a bare requirements.txt install leaves the astronomy libraries out, and the archive tools then fail at query time rather than at startup.
What it is
An astronomy data server that puts one interface over DESI spectra and the astroquery ecosystem — SIMBAD, VizieR, SDSS, Gaia, MAST and the rest. Results are saved to disk with metadata and can be converted to FITS, so a search turns into a file you can hand to your own analysis code.
What you get
search_objectsfinds objects in DESI by position, type and redshiftget_spectrum_by_idretrieves full spectral data for a DESI objectastroquery_queryis the single door to the other archives, taking aservice_nameplus object name, coordinates and radius, or raw SQLlist_astroquery_services,get_astroquery_service_detailsandsearch_astroquery_servicesanswer which archives are available before you query oneconvert_to_fitsturns a saved catalog, spectrum or image into FITSpreview_data,list_filesandfile_statisticsinspect what has already been downloaded, with afile_registry.jsonunder~/astro_mcp_data/- DESI coverage spans EDR and DR1, at 360-980 nm
Requirements
Python 3.11 or newer, run from a dedicated environment. The documented setup is to clone the repository, create a conda environment, install from requirements.txt, then add the astronomy libraries — sparclclient, datalab, astropy, astroquery. Point your client's command at that environment's Python and its args at server.py, with cwd set to the checkout. No account or API key is mentioned for the DESI and astroquery paths. h5py is optional and adds HDF5 support.
Setup effort
Build from source — git clone https://github.com/SandyYuan/astro_mcp.git
USE CASES
Finding galaxies in a patch of sky
Give a position and a search radius and get matching objects back, saved rather than printed.
Looking up one named object's coordinates
Query SIMBAD by object name without learning its Python client first.
Pulling a spectrum for a specific DESI object
Fetch the spectral data by ID and keep it on disk for later analysis.
Handing results to code that expects FITS
Convert a saved catalog or spectrum into FITS instead of writing a conversion script.
Working out which archive can answer a question
Browse or search the available services and read what each one covers before querying.
10 tools
Listed in project docs. Your client may show a different list.
astroquery_queryget_spectrum_by_idlist_astroquery_servicesget_astroquery_service_detailssearch_astroquery_servicespreview_datalist_filesfile_statisticsconvert_to_fitsBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
- Python 3.11+
- mcp>=1.0.0 - Model Context Protocol framework
- astroquery>=0.4.6 - Universal astronomical database access
- astropy>=5.0.0 - FITS files and astronomical calculations
- sparclclient>=1.0.0 - DESI SPARCL access
- datalab>=2.20.0 - NOAO Data Lab queries
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
# Clone the repository
git clone https://github.com/SandyYuan/astro_mcp.git
cd astro_mcp
# Create a dedicated conda environment with Python 3.11+
conda create -n mcp python=3.11
conda activate mcp
# Install dependencies
pip install -r requirements.txt
# Install astronomical libraries for full functionality
pip install sparclclient datalab astropy astroqueryMCP Clients
Cursor, Claude Desktop
{
"mcpServers": {
"astro-mcp": {
"command": "<YOUR_PATH_TO_CONDA_ENVS_MCP_BIN>",
"args": [
"<YOUR_PATH_TO_ASTRO_MCP>/server.py"
],
"cwd": "<YOUR_PATH_TO_ASTRO_MCP>",
"env": {}
}
}
}