inspire-mcp
# inspire-mcp
[](https://github.com/JacopoTorasso/inspire-mcp/actions/workflows/ci.yml)
[](https://github.com/JacopoTorasso/inspire-mcp/actions/workflows/eval.yml)
[](https://pypi.org/project/inspire-mcp/)
[](https://pypi.org/project/inspire-mcp/)
[](LICENSE)
**Ask your AI assistant about high energy physics literature, in plain language.**
inspire-mcp connects assistants such as Claude to [INSPIRE-HEP](https://inspirehep.net), the database
of high energy physics papers, authors, conferences and jobs. Describe the paper you are looking for
in your own words. On 40 random papers set aside before any measurement, the server puts the right one
first 60% of the time on its own and 85% when Claude drives it, against 12% for the same question typed
into INSPIRE's search box ([how this is measured](docs/evaluation.md)).
## What you can ask
* *"Find the paper that introduced GANs for calorimeter shower simulation, and who cites it lately"*
* *"What are Michela Paganini's most cited papers outside large collaborations? What is her h-index?"*
* *"Which neutrino conferences are coming up, and where?"*
* *"Are there open postdoc positions in lattice QCD in Europe?"*
* *"Show me the figures of arXiv:1705.02355 and give me its BibTeX"*
* *"Papers similar to the Randall–Sundrum paper"*
* *"Recent LHCb papers on pentaquarks"*
Every answer comes with INSPIRE links, so you can check the sources.
## Try it in one minute
You need [uv](https://docs.astral.sh/uv/), a small Python tool runner:
```bash
# macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
Then search straight from the terminal, no AI client needed:
```console
$ uvx --from "inspire-mcp[semantic]" inspire-mcp search "neural networks to speed up calorimeter shower simulation"
1. Quantum Invertible Neural Networks for Fast Calorimetry as Quantum Generative Model with high
interpretability at Future Colliders
Corchia, Federico 2026 · 0 citations · https://inspirehep.net/literature/3221332
2. CaloShowerGAN, a generative adversarial network model for fast calorimeter shower simulation
Faucci Giannelli, Michele 2024 · 33 citations · https://inspirehep.net/literature/2697185
3. On the use of neural networks for energy reconstruction in high-granularity calorimeters
Akchurin, N. 2021 · 38 citations · https://inspirehep.net/literature/1889423
...
ranked by cross-encoder:ms-marco-MiniLM-L-6-v2 from 50 INSPIRE candidates in 2.7s
```
The first run downloads the package and a small ranking model (about 100 MB); later runs start in
seconds. Other commands: `inspire-mcp paper 1705.02355` shows one paper, `inspire-mcp doctor` checks
your setup.
## Use it with your AI assistant
**Claude Code**, one command:
```bash
claude mcp add inspire -- uvx --from "inspire-mcp[semantic]" inspire-mcp
```
**Claude Desktop**: open *Settings → Developer → Edit Config* (the file is
`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS and
`%APPDATA%\Claude\claude_desktop_config.json` on Windows), add the server and restart Claude:
```json
{
"mcpServers": {
"inspire": {
"command": "uvx",
"args": ["--from", "inspire-mcp[semantic]", "inspire-mcp"]
}
}
}
```
**Cursor, VS Code, and other MCP clients** use the same `command` and `args`. Run
`inspire-mcp config` to print the snippets.
## Tools
The assistant picks the right tool by itself; this is what it has available.
| | Tool | What it does |
|---|---|---|
| **Papers** | `semantic_search` | finds papers from a description in plain language |
| | `search_literature` | precise search in INSPIRE syntax (`t higgs and cn atlas and date > 2020`) |
| | `get_paper` | full record: abstract, authors, journal, keywords, arXiv PDF, open-access full text |
| | `find_similar_papers` | papers on the same subject as a given one |
| | `get_citing_papers` | who cites a paper, newest or most cited first |
| | `get_references` | what a paper cites |
| | `get_paper_figures` | figures with captions and download links |
| | `export_citations` | BibTeX or LaTeX (`\bibitem`, EU or US style) entries |
| | `search_collaboration` | papers of ATLAS, CMS, LHCb, ALICE, Belle II... |
| **People** | `search_authors` | find an author profile |
| | `get_author_profile` | papers, citations, h-index, citation distribution |
| | `get_author_papers` | an author's papers, optionally only those written in small teams |
| **Community** | `search_conferences` | upcoming (or past) conferences and workshops |
| | `search_seminars` | upcoming seminars and online talks, with link to join |
| | `search_jobs` | open positions: postdocs, faculty, PhD, staff |
| | `search_institutions` | research institutions, location and output |
| | `search_experiments` | experiments: accelerator, dates, number of papers |
| | `ping` | checks the server is up |
Lists are paginated and can return compact results to save the assistant's context. Also included:
a resource, `inspire://literature/{recid}`, and a prompt, `literature_review`, that writes a short cited
overview of a topic.
## How good is the search?
Measured on papers with 20 to 200 citations picked at random from INSPIRE, each described by a
question that does not repeat its title. Two sets of 40: the **development** set guided every design
choice; the **held-out** set was frozen beforehand and used only to confirm, so it is the honest estimate.
| Approach | Right paper first, development | Right paper first, held out |
|---|---|---|
| Question typed into INSPIRE's search | 7% | 12% |
| Keywords of the question, INSPIRE's ranking | 38% | 40% |
| **inspire-mcp semantic search**, one call | **70%** | **60%** |
| Claude Sonnet 5.5 searching INSPIRE by itself | 60% | 62% |
| **Claude Sonnet 5.5 with inspire-mcp** | **85%** | **85%** |
| Claude Haiku 5.5 searching INSPIRE by itself | 55% | 53% |
| **Claude Haiku 5.5 with inspire-mcp** | **80%** | **82%** |
With the server, an assistant finds the paper far more often and with fewer searches: Claude Sonnet 5.5
needs 1.3 to 1.5 searches per question instead of 5 to 6, and the small Claude Haiku 5.5 with the
server does better than Claude Sonnet 5.5 without it.
A second benchmark of 60 famous papers, the significance tests and the design choices that were
tried and rejected are in [docs/evaluation.md](docs/evaluation.md).
## How it works
```mermaid
flowchart LR
Q[your question] --> K["keywords joined with OR<br/>(INSPIRE needs all words to match otherwise)"]
K --> P[(50 candidate papers<br/>from live INSPIRE)]
P --> R["cross-encoder reads the question<br/>with each title and abstract"]
R --> A[best matches, with links<br/>and how they were found]
```
Nothing is copied or indexed: every search runs against the live INSPIRE database, and only the
ranking happens locally, on CPU. For questions about foundational work the assistant can ask for
highly cited candidates (`prefer_influential`), which helps find famous papers buried under their
follow-ups.
<details>
<summary><b>Run it as a service</b> (Docker, Kubernetes, configuration)</summary>
```bash
docker build --build-arg EXTRAS=semantic -t inspire-mcp:semantic . # models included, no download at runtime
docker run -p 8000:8000 -e INSPIRE_MCP_ALLOWED_HOSTS=mcp.example.org inspire-mcp:semantic
kubectl apply -f deploy/k8s/deployment.yaml # non-root, read-only filesystem, probes
```
Release tags publish `ghcr.io/jacopotorasso/inspire-mcp:<version>` (no models, 364 MB) and
`:<version>-semantic` (about 1 GB).
| Endpoint | Purpose |
|---|---|
| `/mcp` | MCP over Streamable HTTP, rate limited per client |
| `/healthz` | liveness |
| `/readyz` | readiness: 503 until the ranking model is loaded |
| `/metrics` | Prometheus: calls by tool and outcome, latency histogram, readiness |
Every option is a flag or an environment variable:
| Variable | Default | |
|---|---|---|
| `INSPIRE_MCP_TRANSPORT` | `stdio` | `streamable-http` to serve over HTTP |
| `INSPIRE_MCP_HOST`, `INSPIRE_MCP_PORT` | `127.0.0.1`, `8000` | also honours `PORT` |
| `INSPIRE_MCP_ALLOWED_HOSTS` | | public host names (DNS rebinding protection when binding to `0.0.0.0`) |
| `INSPIRE_MCP_RATE_LIMIT` | `120` | MCP requests per minute per client, `0` disables |
| `INSPIRE_MCP_TRUST_PROXY` | `false` | identify clients by `X-Forwarded-For` behind a trusted proxy |
| `INSPIRE_MCP_RERANKER` | `auto` | `cross-encoder`, `dense` or `bm25` |
| `INSPIRE_MCP_CACHE_TTL` | `300` | seconds INSPIRE answers stay cached in memory |
| `INSPIRE_MCP_MIN_INTERVAL` | `0.35` | seconds between requests to INSPIRE |
| `INSPIRE_MCP_CACHE` | `~/.cache/inspire-mcp` | embedding cache |
| `INSPIRE_MCP_LOG_FORMAT`, `INSPIRE_MCP_LOG_LEVEL` | `text`, `INFO` | `json` for log aggregation |
The HTTP endpoint has no authentication; see [SECURITY.md](SECURITY.md).
</details>
<details>
<summary><b>Troubleshooting</b></summary>
* **`uvx: command not found`**: install uv (above) and open a new terminal.
* **The first search is slow**: the ranking model is downloaded once (about 100 MB).
* **The assistant does not see the tools**: restart the client after editing its configuration, then
run `inspire-mcp doctor` in a terminal.
* **Behind a corporate proxy**: set `HTTPS_PROXY`; the server needs to reach `https://inspirehep.net`.
* **Lighter install**: `uvx inspire-mcp` (without `[semantic]`) skips the models and ranks with BM25,
which is noticeably less accurate.
</details>
## Development
```bash
uv sync --extra semantic
uv run pytest # 68 tests, offline, about 90% coverage
uv run ruff check . && uv run mypy
uv run --extra eval python eval/run_eval.py # benchmark against live INSPIRE
```
CI runs lint, types, tests, both container images with a health probe and Kubernetes manifest
validation; the benchmark runs weekly to catch regressions. See [CONTRIBUTING.md](CONTRIBUTING.md)
and [CHANGELOG.md](CHANGELOG.md).
## License
MIT. Data comes from [INSPIRE-HEP](https://inspirehep.net) under its terms of use. This is an
independent project, not affiliated with CERN or INSPIRE.
TDQS
Scored across 18 tools
Each tool targets a distinct resource and action: keyword search vs. natural-language semantic search, similar papers vs. citing papers vs. references, and author lookup vs. profile vs. paper list are all clearly separated by their descriptions. The only mild overlaps are search_literature (which can filter by collaboration via `cn`) against search_collaboration, and search_experiments against search_collaboration, but the descriptions resolve them.
Nearly every tool follows a verb_noun pattern (search_literature, get_citing_papers, get_author_profile, search_conferences, export_citations), with predictable `search_*` vs `get_*` semantics. Deviations are minimal: semantic_search uses noun_verb order and ping is a bare utility verb, both defensible.
18 tools is on the heavier side but justified by the breadth of the INSPIRE domain (papers, authors, collaborations, conferences, seminars, jobs, institutions, experiments). Each tool maps to a real query type rather than duplicating another, so none feel padded.
The surface covers the full read-only lifecycle: discovery (keyword, semantic, similar), retrieval (get_paper, figures), graph traversal (citations, references), export, and the adjacent entity types (authors, collaborations, conferences, seminars, jobs, institutions, experiments). Minor gaps remain, such as no single-record lookup for institutions/conferences/experiments by id and no author-level paper-search filtering beyond the paper list.