Model Context Protocol (MCP) server providing cosmology analysis tools for LLM agents.
An MCP server that exposes 20+ tools for cosmological analysis:
- Domain Tools: Load data, compute power spectra, create visualizations
- Agent Tools: AI-powered workflows for complex multi-step analysis
- DESIGN.md: Architecture, design rationale, and technical details
- CONTRIBUTING.md: Guide for adding new tools
# Install
pip install -e .
# Run server (for testing)
python mcp_server.pyData & Models
load_observational_data- Load eBOSS observational dataget_lcdm_params,get_nu_mass_params,get_wcdm_params- Cosmology model parameter setscreate_theory_k_grid- Generate k-value grid for theory predictions
Analysis
compute_power_spectrum- Compute P(k) for given parameters using CLASScompute_all_models- Compute P(k) for all standard modelscompute_suppression_ratios- Calculate P(k)/P_ref(k) ratios
Visualization
plot_power_spectra- Plot P(k) vs observationsplot_suppression_ratios- Plot suppression ratios
Helpers
save_array,load_array,save_dict,load_dict,list_agent_files
Require OpenAI-compatible LLM API (Anthropic, Google Gemini, OpenAI, etc.)
power_spectrum_agent (DISABLED - requires litellm)
- Commented out in
agent_tools/__init__.py - Use individual tools (
compute_power_spectrum,compute_all_models) directly instead End-to-end power spectrum analysis workflowOrchestrates: data agent → modeling agent → visualization agent- Example (if re-enabled):
result = power_spectrum_agent( query="Compare ΛCDM and wCDM models with eBOSS data", api_key="your-key", llm_url="https://api.anthropic.com", model_id="claude-3-5-sonnet-20241022" )
arxiv_agent
- Search arXiv, download papers, extract and analyze content
- Example:
result = arxiv_agent( query="Find recent papers on galaxy mass estimation methods", api_key="your-key", llm_url="https://api.anthropic.com", model_id="claude-3-5-sonnet-20241022" )
# Unit tests (no API key needed)
pytest
# Integration tests (requires GOOGLE_API_KEY)
export GOOGLE_API_KEY="your-key"
pytest tests/test_agent_tools.py -vSee CONTRIBUTING.md
MIT License