
cern-inspire-mcp-server
io.github.cyanheadsv0.1.1更新於 Oct 1, 2026
Search INSPIRE-HEP papers, authors, experiments, HEPData records; get citation metrics and BibTeX.
概覽
讓助理檢索 INSPIRE-HEP 高能物理論文、作者、實驗與 HEPData 紀錄,並計算引用指標或匯出 BibTeX。
- 功能
- 八個工具查詢公開的 INSPIRE-HEP API:以 INSPIRE 語法或自由文字檢索文獻,依 recid、arXiv ID 或 DOI 取得論文完整紀錄,查詢作者檔案、實驗與合作組,以及檢索 HEPData 量測紀錄。也可計算某位作者或某個查詢的 h 指數與引用分布,匯出 BibTeX 或 LaTeX 引用條目,並解說查詢語法與識別碼格式。結果帶有可串接的識別碼,例如 recid 與現成的 literatureQuery。
- 適用情境
- 適合需要高能物理文獻、作者或合作組資料、引用數與 h 指數,或某批論文 BibTeX 條目的情境。可用於文獻回顧、引用分析,以及找出論文數值表格對應的 HEPData 紀錄。
- 執行需求
- 以本機 stdio 程序執行,透過 npm 套件 @cyanheads/cern-inspire-mcp-server 使用,需要 Node.js v24+ 或 Bun v1.4.0+,也可用 Docker;另支援 HTTP 傳輸。不需要 API 金鑰或帳號。選用環境變數涵蓋傳輸方式、HTTP 主機、連接埠與端點路徑、日誌層級與驗證模式(none、jwt、oauth)。需要連線至 INSPIRE-HEP 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 cern-inspire-mcp-server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@cyanheads/cern-inspire-mcp-server
Search INSPIRE-HEP papers, authors, experiments, HEPData records; get citation metrics and BibTeX via MCP. STDIO or Streamable HTTP.
Overview
High-energy-physics literature from INSPIRE-HEP, including its index of HEPData measurement records. Search papers, authors, and experiments, read a paper's full record, compute citation summaries and h-indices, export BibTeX or LaTeX entries, and find the HEPData record that holds a paper's numerical tables. Runs as a stdio process or a local Streamable HTTP server.
Tools
Resources
The same record is reachable through cern_inspire_get_paper for clients that don't surface resources.
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 of which must hold), andyear_from/year_to;size1–100 (default 10), paged bypage - Only the first 10,000 results of a query are reachable:
page × sizebeyond that fails asbeyond_result_window, and a reversed year range asinvalid_year_range - Hits carry
recid, title, first author, date, citation counts, arXiv ID, DOI, publication, and a 300-character abstract snippet;totalCount,nextPage, andappliedFilterscome back with the page, and anoticeflags any query matching over 100,000 records
cern_inspire_get_paper tool
papertakes a recid, arXiv ID, DOI, inspirehep.net literature URL, or HEPDatains<recid>/ hepdata.net record URL;resolvedAsnames the form that matched, and a miss fails aspaper_not_foundmax_authors0–500 (default 25) caps the author list;authorCountalways gives the full numberhepdata.statusisavailable,none, orlookup_failed, withrecordDoi,latestVersion,tableCount, andhepdataUrlwhen available;citingQueryandreferencesQueryfeedcern_inspire_search_literature
cern_inspire_export_citations tool
- Any literature query (
recid:451647 or arxiv:1207.7214for named papers);formatisbibtex(default),latex-eu, orlatex-us;size1–50 (default 10) - Entries arrive verbatim from INSPIRE, each with its
texkey;truncatedis set when more papers matched thansize
cern_inspire_search_authors tool
- A name or one identifier (BAI, ORCID, INSPIRE ID, author recid);
limit1–25 (default 5) matchedAsreports the route:orcid,inspire_id,bai, andrecidmatch exactly, whilenameruns a free-text search whose ranked candidates are returned for the caller to choose from- Profiles carry
recid,bai, ORCID, positions, 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); otherwisemissing_target, and a name passed asauthorfails asauthor_not_identifier document_types,subjects, andyear_from/year_tonarrow every figure;exclude_self_citationsrecounts without self-citations- 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
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);limit1–25 (default 5) - 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;size1–50 (default 10), within the same 10,000-result window - Records carry
paperRecids, collaborations, keywords (reactions, observables, centre-of-mass energies),recordDoi,latestVersion,tableCount, andhepdataUrl; table values are not returned
cern_inspire_list_reference tool
topic:search_syntax,identifiers,document_types,subjects,citation_buckets, orhepdata- Static
term/meaning/exampleentries with no upstream call
inspire://literature/{recid} resource
- The
cern_inspire_get_paperdossier for one recid asapplication/json, listing the first 25 authors - Takes a recid only; use the tool for arXiv IDs, DOIs, or a higher author cap
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:
- One process-wide pacer under INSPIRE's published 15 requests per 5 s: 12 request starts per 5 s, at most 4 in flight, and a shared cooldown after a 429 that starts at 5 s and doubles on each consecutive 429, up to 30 s
- One 55 s budget per tool call covers queue wait, up to 2 retries, and every request the call makes; a request that can't start in time fails at once as
pacer_shedwith aretryAfter - JSON requests select only the fields a tool returns, under an 8 MiB response ceiling and a strict query-parameter allowlist, since INSPIRE silently ignores parameters it doesn't know; author email addresses are never requested
- Forgiving inputs: paper identifiers accept an
arXiv:ordoi:prefix, a version suffix, an arxiv.org, doi.org, or inspirehep.net URL, and HEPData'sins<recid>; author identifiers accept an orcid.org URL;document_typesandsubjectstake an array or a comma-joined string in any case
Agent-friendly output:
- Chainable identifiers: hits carry
recid, author profiles and experiments carry a readyliteratureQuery, andcern_inspire_get_paperreturnscitingQueryandreferencesQuery, so the next call needs no query building - 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, and 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"; upstream strings are escaped in the text output and kept verbatim in
structuredContent
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. - INSPIRE allows 15 requests per 5 seconds per address, and the server paces its own requests under that limit.
- 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 tools that read hepdata.net directly are deferred.
cern_inspire_get_paperandcern_inspire_search_hepdatareturn the record DOI and the hepdata.net page where the values are read. - Malformed INSPIRE syntax doesn't fail. An unparsed operator widens or empties the match instead; zero hits or a very large
totalCountusually means a syntax slip (cern_inspire_list_referencetopicsearch_syntax). - 10,000-result window. Only the first 10,000 results of a query are reachable; narrow the query to reach the rest.
- One request queue per process, one rate limit per address. Every caller of a server process shares one queue under INSPIRE's 15 requests per 5 s, so on a shared deployment one client's burst can delay or shed everyone else's calls with a retryable rate-limit error. A hosted deployment needs a per-client rate limit in front of
/mcp, and should run one replica per egress IP, since INSPIRE counts requests per address; a per-caller share inside the server waits on the framework (cyanheads/mcp-ts-core#618).
Getting started
Add the following to your MCP client configuration file. No API key is needed.
Or with npx (no Bun required):
Or with Docker:
For Streamable HTTP, set the transport and start the server:
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- Nothing else: INSPIRE-HEP's API is public and keyless.
Installation
- Clone the repository:
- Navigate into the directory:
- Install dependencies:
- Configure environment (optional):
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.
See .env.example for the full list of framework overrides.
Running the server
Local development
-
Build and run the production version:
-
Run checks and tests:
Project structure
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:
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
來源:README.md,提交 9740298
工具
0版本歷史
1- v0.1.1最新Oct 1, 2026