cern-inspire-mcp-server
Search INSPIRE-HEP papers, authors, experiments, HEPData records; get citation metrics and BibTeX.
Que pouvez-vous faire avec cern-inspire-mcp-server ?
- Paces requests to 12 per 5 s, under INSPIRE's limit of 15, with a cooldown after a 429; a call that can't start in time fails as
pacer_shedwith aretryAfter - 55 s budget per tool call, including queue wait and up to 2 retries
- Requests select only the fields a tool returns; author email addresses are never requested
- Forgiving inputs: paper identifiers accept
arXiv:/doi:prefixes, version suffixes, and arxiv.org, doi.org, or inspirehep.net URLs; author identifiers accept an orcid.org URL - Positive integer result budgets above the ceiling succeed with a notice stating requested and effective values: literature 100, HEPData and citation export 50, author and experiment search 25. Defaults stay unchanged; zero, negative, and fractional budgets ...
- Chainable identifiers: hits carry
recid, author profiles and experiments carry a readyliteratureQuery, andcern_inspire_get_paperreturnscitingQueryandreferencesQuery - Query echo and paging state:
totalCount,truncated/shown/cap,nextPage,appliedFilters, andeffectiveQuery, plus anoticewith next-step text on empty, capped, or suspiciously broad results - Discriminated fields:
hepdata.status,resolvedAs,matchedAs, andtarget.kindlet callers branch on data; typed failure reasons (paper_not_found,author_not_found,beyond_result_window,inspire_rate_limited) each carry a recovery hint
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
claude mcp add --transport http cern-inspire-mcp-server 'https://cern-inspire.caseyjhand.com/mcp'
{
"mcpServers": {
"cern-inspire-mcp-server": {
"type": "http",
"url": "https://cern-inspire.caseyjhand.com/mcp"
}
}
}
@cyanheads/cern-inspire-mcp-serverclaude mcp add cern-inspire-mcp-server -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/cern-inspire-mcp-server@0.2.0
{
"mcpServers": {
"cern-inspire-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/cern-inspire-mcp-server@0.2.0"
],
"env": {
"MCP_LOG_LEVEL": "info"
}
}
}
}
Variables d'environnement
MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
@cyanheads/cern-inspire-mcp-serverclaude mcp add cern-inspire-mcp-server -e 'MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE>' -e 'MCP_HTTP_HOST=127.0.0.1' -e 'MCP_HTTP_PORT=3010' -e 'MCP_HTTP_ENDPOINT_PATH=/mcp' -e 'MCP_AUTH_MODE=none' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/cern-inspire-mcp-server@0.2.0
{
"mcpServers": {
"cern-inspire-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/cern-inspire-mcp-server@0.2.0"
],
"env": {
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_HTTP_PORT": "3010",
"MCP_HTTP_ENDPOINT_PATH": "/mcp",
"MCP_AUTH_MODE": "none",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Variables d'environnement
MCP_TRANSPORT_TYPESelects the HTTP transport.MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
@cyanheads/cern-inspire-mcp-server
Search INSPIRE-HEP papers, authors, experiments, HEPData records; get citation metrics and BibTeX via MCP. STDIO or Streamable HTTP.
8 Tools • 1 Literature Resource Template • 1 Agent Skill
Public Hosted Server: https://cern-inspire.caseyjhand.com/mcp
Overview
High-energy-physics literature from INSPIRE-HEP and the HEPData tables behind it. Search papers, authors, and experiments, compute citation summaries and h-indices, export BibTeX or LaTeX, and find the record holding a paper's numerical data.
Tools
| Tool | Description |
|---|---|
cern_inspire_search_literature | Search papers with INSPIRE query syntax or free text, filtered by document type, subject, and year |
cern_inspire_get_paper | Fetch one paper's full record by recid, arXiv ID, or DOI, with its HEPData availability |
cern_inspire_export_citations | Export INSPIRE's BibTeX or LaTeX \bibitem entries for the papers a query selects |
cern_inspire_search_authors | Find physicist profiles by name, BAI, ORCID, INSPIRE ID, or author recid |
cern_inspire_get_citation_summary | h-index, citation totals, citation buckets, and citations per year for one author or any literature query |
cern_inspire_search_experiments | Find experiments, collaborations, and facilities, with a query that selects their papers |
cern_inspire_search_hepdata | Find HEPData measurement records by process, observable, energy, or collaboration |
cern_inspire_list_reference | Decode query syntax, identifier forms, filter values, citation buckets, and HEPData DOIs |
Resources
| Resource | Description |
|---|---|
inspire://literature/{recid} | One literature record as the cern_inspire_get_paper dossier in JSON |
The same record is reachable through cern_inspire_get_paper for clients that don't surface resources.
Agent skill
cern-inspire-guide covers identifier routing, query syntax, and research workflows. Plugin installs, npm, Docker, and the Claude Desktop bundle include it. MCP clients can discover it through skills/list or read skill://cern-inspire-guide/SKILL.md from resources/list.
Capability reference
cern_inspire_search_literature tool
- INSPIRE query syntax or free text, with
sort(relevance,mostrecent,mostcited),document_typesandsubjects(up to 4 values each, all must hold), andyear_from/year_to; positive integersize(default 10, clamped to 100), paged bypage - Only the first 10,000 results of a query are reachable:
page × effective sizebeyond that fails asbeyond_result_window; a reversed year range fails asinvalid_year_range - Hits carry
recid, title, first author, date, citation counts, arXiv ID, DOI, publication, and a 300-character abstract snippet; the page also returnstotalCount,nextPage, andappliedFilters, and anoticeflags queries matching over 100,000 records
cern_inspire_get_paper tool
papertakes a recid, arXiv ID, DOI, inspirehep.net literature URL, or HEPDatains<recid>/ hepdata.netrecord/ins<recid>URL;resolvedAsnames the form that matched, and a miss fails aspaper_not_found. A merged recid returns the surviving record, withmergedFromnaming the recid asked formax_authors(default 25, capped at 500) andauthor_offset(default 0) page through contributors; passnextAuthorOffsetto continue. Entries retain recordedroles(such as editor or supervisor); an absent role stays unknown.authorCountretains INSPIRE's count, falling back to the available contributor-list lengthdocumentslists public attached-document URLs with recorded filename, description, material, and full-text status; hidden and URL-less entries are omitted. Files are not downloaded. Externalurlsremain separate;citingQueryandreferencesQueryfeedcern_inspire_search_literaturehepdata.statusisavailable,none, orlookup_failed, withrecordDoi,latestVersion,tableCount, andhepdataUrlwhen available; extra HEPData records appear inhepdata.otherRecords
cern_inspire_export_citations tool
- Any literature query (
recid:451647 or arxiv:1207.7214for named papers), with the samedocument_types,subjects,year_from,year_to, andsortas search; reversed years fail asinvalid_year_range formatisbibtex(default),latex-eu, orlatex-us; positive integersize(default 10, clamped to 50), paged bypagewithin the first 10,000 matches (beyond that,beyond_result_window)- Entries arrive verbatim from INSPIRE, each with its
texkey;truncatedandnextPagesignal more results, andappliedFiltersechoes the selection
cern_inspire_search_authors tool
- A name or one identifier (BAI, ORCID, INSPIRE ID, author recid); positive integer
limit(default 5, clamped to 25) matchedAsisorcid,inspire_id,bai, orrecid(exact match), orname(free-text search returning ranked candidates to choose from)- Profiles carry
recid,bai, ORCID, positions (with aninstitutionRecidthataffid:Ntakes for the institution's papers), advisors, arXiv categories, awards, and aliteratureQueryselecting the person's papers
cern_inspire_get_citation_summary tool
- Exactly one of
author(BAI, ORCID, INSPIRE ID, or author recid) orquery(any literature query, such asaffid:902725for an institution's papers); otherwisemissing_target, and a name passed asauthorfails asauthor_not_identifier - Narrow with
document_types,subjects,year_from,year_to, andexclude_self_citations - Returns h-index, citation totals and averages, and paper counts in the buckets
0,1–9,10–49,50–99,100–249,250–499,500+, each for all citeable and for published papers citationsByYearis omitted, with a notice, whenyear_from,year_to, orexclude_self_citationsis set, when INSPIRE does not return it, or for queries matching more than about 150,000 records
cern_inspire_search_experiments tool
- An experiment, collaboration, accelerator, or facility name, an INSPIRE legacy name (
CERN-LHC-CMS), or an experiment recid (digits only); positive integerlimit(default 5, clamped to 25) - Records carry the accelerator, host institutions, collaboration, lifecycle dates,
ongoing(omitted when INSPIRE records neither state), INSPIRE's paper count, and aliteratureQueryforcern_inspire_search_literatureorcern_inspire_get_citation_summary
cern_inspire_search_hepdata tool
- Free text or INSPIRE syntax over HEPData submissions (
collaborations.value:LHCb,literature.control_number:<recid>);sortisrelevanceormostrecent; positive integersize(default 10, clamped to 50), within the same 10,000-result window - Records carry
paperRecids, collaborations, keywords (reactions, observables, centre-of-mass energies),recordDoi,latestVersion,tableCount, andhepdataUrl(each record's own hepdata.net page); table values are not returned
cern_inspire_list_reference tool
topic:search_syntax,identifiers,document_types,subjects,citation_buckets, orhepdata- Static
term/meaning/exampleentries; no upstream call
inspire://literature/{recid} resource
- The
cern_inspire_get_paperdossier asapplication/json, with the first 25 contributors, their recorded roles, and public attached-document links - Takes a recid only; use the tool for arXiv IDs, DOIs, or further contributor pages. A merged recid serves the surviving record, with
mergedFrom
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
INSPIRE-specific:
- Paces requests to 12 per 5 s, under INSPIRE's limit of 15, with a cooldown after a 429; a call that can't start in time fails as
pacer_shedwith aretryAfter - 55 s budget per tool call, including queue wait and up to 2 retries
- Requests select only the fields a tool returns; author email addresses are never requested
- Forgiving inputs: paper identifiers accept
arXiv:/doi:prefixes, version suffixes, and arxiv.org, doi.org, or inspirehep.net URLs; author identifiers accept an orcid.org URL
Agent-friendly output:
- Positive integer result budgets above the ceiling succeed with a notice stating requested and effective values: literature 100, HEPData and citation export 50, author and experiment search 25. Defaults stay unchanged; zero, negative, and fractional budgets fail. Paging and the 10,000-result window use the effective size
- Chainable identifiers: hits carry
recid, author profiles and experiments carry a readyliteratureQuery, andcern_inspire_get_paperreturnscitingQueryandreferencesQuery - Query echo and paging state:
totalCount,truncated/shown/cap,nextPage,appliedFilters, andeffectiveQuery, plus anoticewith next-step text on empty, capped, or suspiciously broad results - Discriminated fields:
hepdata.status,resolvedAs,matchedAs, andtarget.kindlet callers branch on data; typed failure reasons (paper_not_found,author_not_found,beyond_result_window,inspire_rate_limited) each carry a recovery hint - No fabrication: a field INSPIRE leaves out stays absent and prints as "Not available" or "not recorded"
- Titles and abstracts as text: publisher HTML, JATS, and MathML become plain text (
σ_γ,^{23}Na(n,γ)), with LaTeX left as published and citation export entries verbatim
Data and licensing
- INSPIRE-HEP metadata is mostly CC0 under INSPIRE's terms of use; credit INSPIRE when you reuse it.
- HEPData records are CC0; cite the HEPData record DOI (
recordDoi) when you reuse the data. - This is an independent project, not affiliated with or endorsed by INSPIRE-HEP, HEPData, or CERN.
Known limitations
- No HEPData table values. hepdata.net's bot challenge refuses the server's User-Agent, so the server never calls it.
cern_inspire_get_paperandcern_inspire_search_hepdatareturn the record DOI and the hepdata.net page where the values are read. - Malformed INSPIRE syntax mostly doesn't fail. Literature search, citation summaries, and citation export reject empty recognized field clauses (
a:,a: not, ora:"", including whitespace-only quoted values) asinvalid_query; give each field a value (a Witten). Otherwise an unparsed operator widens or empties the match; zero hits or a very largetotalCountusually means a syntax slip (cern_inspire_list_referencetopicsearch_syntax). - Selection checks cost an extra request. Literature search verifies filtered selections and later pages; export verifies filtered first pages and all later pages. This prevents INSPIRE's reference fallback from bypassing filters or repeating exhausted results. A required verification failure fails the call; unfiltered first pages keep one request
- 10,000-result window. Only the first 10,000 results of a query are reachable; narrow the query to reach the rest.
- Shared request queue. All callers of one server process share one queue under INSPIRE's 15 requests per 5 s per address, so a burst can delay or shed other calls with a retryable rate-limit error.
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http cern-inspire-mcp-server https://cern-inspire.caseyjhand.com/mcp
Every caller of the hosted instance shares one INSPIRE request budget of 12 request starts per 5 seconds. For sustained use, run your own instance:
claude mcp add cern-inspire-mcp-server -- npx -y @cyanheads/cern-inspire-mcp-server
For other clients, add this to the MCP config file:
{
"mcpServers": {
"cern-inspire-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/cern-inspire-mcp-server"]
}
}
}
No API key is needed. For Docker or a source build, see Running the server.
Configuration
The server has no settings of its own: INSPIRE needs no key, and the request pacing is fixed in code. These framework variables cover most deployments.
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport: stdio or http. | stdio |
MCP_HTTP_PORT | HTTP server port. | 3010 |
MCP_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. .env.example and the Docker image set stateless. | auto |
MCP_AUTH_MODE | Authentication: none, jwt, or oauth. | none |
MCP_LOG_LEVEL | Log level (debug, info, notice, warning, error, etc.). The Docker image sets info. | debug |
LOGS_DIR | Directory for log files (Node.js only). | <app-root>/logs |
STORAGE_PROVIDER_TYPE | Storage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1. | in-memory |
OTEL_ENABLED | Enable OpenTelemetry. | false |
See .env.example for the full list of framework overrides.
Running the server
Local development
Requires Bun v1.4.0 or higher (or Node.js v24+). INSPIRE-HEP's API is public and keyless.
git clone https://github.com/cyanheads/cern-inspire-mcp-server.git
cd cern-inspire-mcp-server && bun install
cp .env.example .env
# Optional: change transport, logging, or session settings in .env
- Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdio - Run checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker run --rm -p 3010:3010 ghcr.io/cyanheads/cern-inspire-mcp-server:latest
The image defaults to HTTP transport, stateless sessions, and logs at /var/log/cern-inspire-mcp-server. For an MCP client using stdio, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/cern-inspire-mcp-server:latest"]. Build locally with docker build -t cern-inspire-mcp-server .; add --build-arg OTEL_ENABLED=false to omit the OpenTelemetry peers.
Project structure
| Directory | Purpose |
|---|---|
src/index.ts | createApp() entry point: registers tools and resource, sets server instructions, starts and disposes the INSPIRE service. |
src/mcp-server/tools | Tool definitions (*.tool.ts) and shared input schemas (inputs.ts). |
src/mcp-server/resources | The literature record resource. |
src/services/inspire | INSPIRE service: pacer, per-call budget, retries, identifier routing, normalization, controlled vocabularies. |
src/services/http | Bounded fetch: per-attempt timeout and response byte ceiling. |
src/utils | Escaping for upstream text in tool output and error messages (render.ts). |
skills/ | Published cern-inspire-guide for agents calling the server. |
tests/ | Vitest suites with INSPIRE response fixtures. |
docs/design.md | Tool surface, verified INSPIRE behavior, design decisions, and the deferred HEPData-direct tools. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Every INSPIRE request goes through
InspireService, with the call opened bybeginCall(ctx); handlers neverfetchdirectly - Register new tools and resources in the barrels at
src/mcp-server/tools/definitions/index.tsandsrc/mcp-server/resources/definitions/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Questions fréquentes
Qu'est-ce que cern-inspire-mcp-server ?
Search INSPIRE-HEP papers, authors, experiments, HEPData records; get citation metrics and BibTeX.
Comment installer cern-inspire-mcp-server ?
Il fonctionne comme serveur distant. Dans Claude Code : claude mcp add --transport http cern-inspire-mcp-server 'https://cern-inspire.caseyjhand.com/mcp'. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour cern-inspire-mcp-server ?
Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.
cern-inspire-mcp-server est-il open source ?
Oui. Son code est sur GitHub sous licence Apache-2.0.
Qui maintient cern-inspire-mcp-server ?
Il est publié par cyanheads. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.