Labsco
adamzacharia logo

Clearview Politics

from adamzacharia

Real-time U.S. political news API for AI agents โ€” structured JSON, bias-audited, 26+ sources across 5 categories.

๐Ÿ”ฅ๐Ÿ”ฅFreeQuick setup

ALMA MCP Server - Astronomical Data Access via Natural Language

A Model Context Protocol (MCP) server that provides comprehensive access to the ALMA (Atacama Large Millimeter/submillimeter Array) archive through a clean, extensible architecture.

Vision

This MCP server transforms ALMA archive queries from a software engineering problem into a natural language conversation. Instead of learning TAP/ADQL syntax and archive APIs, researchers simply ask for what they need and get clean, analysis-ready results.

The result: AI assistants that can seamlessly search ALMA data by target, position, frequency, resolution, or any custom criteria

Using with Other LLMs and Frameworks

LangChain Integration

You can use this MCP server with LangChain using the langchain-mcp-adapters package:

pip install langchain-mcp-adapters
from langchain_mcp_adapters.client import MCPClient
from langchain_openai import ChatOpenAI

# Connect to the MCP server
client = MCPClient(
    command="python",
    args=["path/to/ALMA_MCP/server.py"]
)

# Get tools from MCP server
tools = client.get_tools()

# Use with any LangChain-compatible LLM
llm = ChatOpenAI(model="gpt-4")
llm_with_tools = llm.bind_tools(tools)

Open Source LLMs

For open source LLMs (Ollama, LMStudio, etc.), you can:

  1. Use MCP-compatible clients: Some open source projects like MCP CLI support connecting MCP servers to local LLMs.

  2. Direct function calling: Import the server functions directly in your Python code:

from server import search_alma_by_target, search_alma_by_position, get_alma_info

# Use tools directly
result = search_alma_by_target("M87", search_radius_arcmin=5.0)
print(result)

# Get ALMA reference info
info = get_alma_info()
print(info)
  1. Build a REST API: Wrap the MCP tools in a FastAPI/Flask server for any LLM that supports function calling via HTTP.

Architecture

ALMA_MCP/
โ”œโ”€โ”€ server.py           # Main MCP server with 16 tools
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ”œโ”€โ”€ test_server.py      # Test suite
โ””โ”€โ”€ README.md           # This file

Features

ALMA Archive Access

  • Target Search: Resolve object names via SIMBAD and search ALMA
  • Position Search: Cone search by RA/Dec coordinates
  • Proposal Search: Find by PI name, proposal ID, or science category
  • Frequency Search: Query by frequency range (GHz)
  • Resolution Search: Filter by angular resolution (arcsec)
  • Custom SQL: Run any ADQL query against ALMA TAP

Core Query Tools (8 original)

ToolDescription
search_alma_by_targetSearch by astronomical object name (SIMBAD resolution)
search_alma_by_positionCone search by RA/Dec coordinates
search_alma_by_proposalSearch by PI name or proposal ID
search_alma_by_frequencySearch by frequency range (GHz)
search_alma_by_resolutionSearch by angular resolution (arcsec)
check_alma_line_coverageCheck spectral line coverage with redshift
get_alma_infoALMA bands, lines, and capabilities reference
run_alma_tap_queryCustom SQL/ADQL queries against TAP

Extended Query Tools (8 new - from ALMA notebooks)

ToolDescription
search_alma_by_source_nameSearch by PI-specified target name (exact or partial)
search_alma_by_bibliographySearch by bibcode, journal, author, or publication year
search_alma_by_member_ousSearch by Member OUS dataset identifier
search_alma_by_data_typeSearch for cubes (spectral) vs images (continuum)
search_alma_by_science_keywordSearch by ALMA science keywords
search_alma_by_abstractFull-text search in proposal/publication abstracts
search_alma_by_sensitivitySearch by continuum or line sensitivity (mJy/beam)
query_alma_multiple_sourcesBatch query for multiple sources at once

Multi-Backend Support

  • alminer: Advanced ALMA queries with spectral line tools
  • pyvo: Direct TAP/ADQL access to ALMA archive
  • astroquery: SIMBAD name resolution

Dependencies

Core Requirements

fastmcp>=2.0.0      # MCP framework
pandas>=1.5.0       # Data manipulation

Astronomical Libraries

alminer>=0.2.0      # Advanced ALMA queries
pyvo>=1.4.0         # TAP/ADQL access
astroquery>=0.4.0   # SIMBAD, VizieR, etc.
astropy>=5.0.0      # Astronomical utilities

Roadmap

Current (v1.0) โœ…

  • ALMA target name search with SIMBAD resolution
  • Position-based cone search
  • Frequency range search
  • Angular resolution filtering
  • Proposal/PI search
  • Spectral line coverage check
  • Custom SQL/TAP queries
  • ALMA info and band reference
  • Source name search (PI-specified names, exact/partial)
  • Bibliography/publication search (bibcode, journal, author, year)
  • Member OUS ID search (dataset identifier)
  • Data type filtering (cubes vs images)
  • Science keyword search with filters
  • Abstract full-text search (proposal and publication)
  • Sensitivity-based search (continuum or line)
  • Batch multi-source queries

Planned (v2.0)

  • VLA archive integration
  • GBT archive integration
  • Result caching for faster queries
  • FITS file download support
  • Cross-archive object matching (ALMA + VLA + optical)
  • Visualization tools (sky plots, spectra)
  • Data download workflow

Moving to Standalone Location

This folder is designed to be portable. To move it:

  1. Copy the entire ALMA_MCP/ folder to your desired location
  2. Update the path in config.json
  3. Restart Claude Desktop

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/vla-support)
  3. Add your data source following existing patterns
  4. Write tests for new functionality
  5. Submit a pull request

Authors

  • Adam Zacharia Anil - Lead Developer
  • Adele Plunkett - Scientific Advisor

Acknowledgments

Special thanks to:

  • Adele Plunkett - For valuable guidance and advice throughout this project
  • NRAO (National Radio Astronomy Observatory) - For supporting astronomical research and data access
  • Brian Mason - For technical expertise and support
  • Cosmic AI / Stella Offner - For inspiration in applying AI to astronomical research

License

MIT License - See LICENSE for details.


Citation

If you use this software in your research, please cite:

@software{alma_mcp,
  title={ALMA MCP Server: Astronomical Data Access for AI Agents},
  author={Adam Zacharia Anil and Adele Plunkett},
  year={2025},
  url={https://github.com/adamzacharia/ALMA_MCP}
}

Support