spectra-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@spectra-mcp-serverCompute the LCDM power spectrum and plot it with eBOSS data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
spectra-mcp-server
Part 1 of the client-server agent tutorial. An MCP server that exposes science tools — CLASS matter power spectra compared against eBOSS DR14 Lyman-α forest data — to any LLM agent.
Part 2, the multi-agent client that drives this server, lives in
multiagent-client-demo.
Setup instructions for both repos are in that repo's
prep.md.
The one idea this repo teaches
The science code stays in usual Python. The MCP wrapper only publishes it.
tools/is an ordinary science package. It never imports MCP. The power-spectrum example lives intools/spectra_tools.py.mcp_server/is a ~70-line generic wrapper. It reads one line of config frompyproject.toml, imports the science package, and registers every function listed in its__all__as an MCP tool.
[tool.mcp-server]
tool_modules = ["tools"]Your type hints, Pydantic Field constraints, and docstrings become the tool
schema agents see. To build your own server: drop your modules into tools/
(or point that one config line at your own package), list the public functions
in __all__, done.
Related MCP server: skyportal-mcp
Layout
data/DR14_pm3d_19kbins.txt eBOSS DR14 Ly-α P(k): 19 bins of (k, P, σ)
tools/
cosmology.py CLASS parameter sets (Planck 2018) + run_class()
spectra_tools.py the 4 tool functions + ArtifactResult contract
__init__.py __all__ — ONLY these names become tools
mcp_server/ generic drop-in wrapper (FastMCP)
notebooks/01_manual_pipeline.ipynb a walkthrough: science → tools → server
tests/test_tools.py tools tested as plain Python, no MCP neededAbout the data file
DR14_pm3d_19kbins.txt is taken from
marius311/mpk_compilation
(Chabanier, Millea & Palanque-Delabrouille 2019,
arXiv:1905.08103): the z = 0 linear
matter power spectrum inferred from the eBOSS DR14 Ly-α forest. Mind the
file's mixed units — k is in 1/Mpc while P(k), σ are in (Mpc/h)³ (the
source notebook plots errorbar(k/h, Pk)). tools/spectra_tools.py does the
k/h conversion once, on load; read the file any other way and the data
appears offset from theory by a factor ~2.
Tools
tool | what it does |
| return the 19 observed (k, P(k), σ) bins |
| valid model names ( |
| run CLASS, write |
| two-panel figure: P(k) + data, ratio panel |
Two conventions worth copying into any science MCP server:
Every tool returns
{status, files, message, metadata}(ArtifactResult).Arrays move between tools as file paths, never through the agent's context window.
Install
conda create -n spectra-tutorial python=3.12 -y
conda activate spectra-tutorial
pip install -e ".[dev]" # classy compiles from source; see prep.md if it fails
pytest # 7 tests, no server or API key neededRun the server
Streamable HTTP — the server is a visible process with a URL:
python -m mcp_server --transport streamable-http --port 8000Clients connect to http://127.0.0.1:8000/mcp. Stop the server with
Ctrl+C (Ctrl+Z only suspends it, leaving the port taken — if that
happens, just start the server again: it detects a leftover mcp_server
holding the port and clears it automatically).
Start with the notebook
notebooks/01_manual_pipeline.ipynb builds everything up in order: the data,
the science by hand, the same science as tools, then the server. Committed
outputs let you read it without running anything.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server and CLI tool that allow LLMs to interact with CERN ROOT files.93MIT
- AlicenseAqualityDmaintenanceA local MCP server for SkyPortal and Fritz that exposes astronomical transient data (photometry, spectra, classifications, observability) as tools for AI coding assistants.23BSD 3-Clause
- Alicense-qualityDmaintenanceMCP server for ATLAS Open Data that enables LLMs to discover, query, and retrieve public datasets and metadata from the ATLAS experiment at CERN.2Apache 2.0
- Alicense-qualityDmaintenanceMCP server that provides tools to query 17+ astronomical databases (e.g., SIMBAD, VizieR, Gaia) via HTTP/TAP APIs, enabling AI applications to access astronomical data through natural language.222BSD 3-Clause
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HEP-KE/spectra-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server