inspirehep-mcp

InspireHEP MCP Server - integrate high-energy physics literature with LLMs.

InspireHEP MCP Server

An MCP server that integrates InspireHEP high-energy physics literature with LLMs. Search papers, explore citations, retrieve author metrics, and generate formatted references.

Installation

# Using pip
pip install inspirehep-mcp

# Or run directly with uvx (no install needed)
uvx inspirehep-mcp
Install from source
git clone https://github.com/MohamedElashri/inspirehep-mcp.git
cd inspirehep-mcp
uv sync
uv run inspirehep-mcp

Integration

Claude Desktop / Cursor / Windsurf

Add to your MCP client config:

{
  "mcpServers": {
    "inspirehep": {
      "command": "uvx",
      "args": ["inspirehep-mcp"]
    }
  }
}

Claude Code

Option A: Using the CLI

# Global scope (available across all projects)
claude mcp add --scope user inspirehep -- uvx inspirehep-mcp

# Project scope (shared via .mcp.json, checked into source control)
claude mcp add --scope project inspirehep -- uvx inspirehep-mcp

Option B: Manual configuration

For global scope, add to ~/.claude.json:

{
  "mcpServers": {
    "inspirehep": {
      "command": "uvx",
      "args": ["inspirehep-mcp"]
    }
  }
}

For project scope, create .mcp.json in your project root:

{
  "mcpServers": {
    "inspirehep": {
      "command": "uvx",
      "args": ["inspirehep-mcp"]
    }
  }
}

Gemini CLI

Option A: Using the CLI

# Project scope (default)
gemini mcp add inspirehep uvx inspirehep-mcp

# User/global scope
gemini mcp add -s user inspirehep uvx inspirehep-mcp

Option B: Manual configuration

Add to ~/.gemini/settings.json (user scope) or .gemini/settings.json (project scope):

{
  "mcpServers": {
    "inspirehep": {
      "command": "uvx",
      "args": ["inspirehep-mcp"]
    }
  }
}

Tools

ToolDescription
search_papersSearch papers by topic, author, collaboration, or free text
get_paper_detailsGet full metadata for a paper by Inspire ID, arXiv ID, or DOI
get_author_papersRetrieve an author's publications and citation metrics
get_citationsExplore citation graph — who cites a paper, or what it cites
search_by_collaborationFind publications from ATLAS, CMS, LHCb, etc.
get_paper_figuresRetrieve figures and download URLs for a paper
get_referencesGenerate BibTeX, LaTeX, or JSON reference lists
get_bibtexRetrieve BibTeX citation entry by DOI, arXiv ID, or Inspire ID
server_statsMonitor cache hit rates and API performance

Configuration

All settings via environment variables (prefix INSPIREHEP_):

VariableDefaultDescription
INSPIREHEP_REQUESTS_PER_SECOND1.5API rate limit
INSPIREHEP_CACHE_TTL86400Cache TTL in seconds (24h)
INSPIREHEP_CACHE_MAX_SIZE512Max cached entries
INSPIREHEP_CACHE_PERSISTENTfalseEnable SQLite persistent cache
INSPIREHEP_CACHE_DB_PATHinspirehep_cache.dbSQLite cache file path
INSPIREHEP_API_TIMEOUT30HTTP request timeout (seconds)
INSPIREHEP_LOG_LEVELINFOLogging level

Development

# Run tests
uv run pytest tests/ -v

# Run with coverage
uv run pytest tests/ --cov=inspirehep_mcp --cov-report=term-missing

# Unit tests only (no network)
uv run pytest tests/test_utils.py tests/test_cache.py tests/test_errors.py tests/test_config.py

LICENCE

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.

Máy chủ liên quan

NotebookLM Web Importer

Nhập trang web và video YouTube vào NotebookLM chỉ với một cú nhấp. Được tin dùng bởi hơn 200.000 người dùng.

Cài đặt tiện ích Chrome