paperSearch

paperSearch

Enables AI coding agents to search academic papers, resolve biomedical entities, mine relations, and traverse citation graphs using Semantic Scholar and PubTator3, with local caching for reproducibility.

Category
访问服务器

README

paperSearch

中文文档

paperSearch is a local stdio MCP server that gives AI coding agents — Claude Code, OpenCode, and Codex — structured, citable access to academic literature. It wraps Semantic Scholar (paper search, citations, references, recommendations) and PubTator3 (biomedical entity normalization, entity relations, PMID evidence) into one cached, reproducible toolset.

Use cases: literature review automation, systematic review support, citation graph analysis, gene–drug–disease relation mining, biomedical evidence retrieval, paper recommendation, and research question answering inside your agent workflow.

Keywords: MCP server, academic search, paper search, Semantic Scholar, PubTator3, PubMed, citation graph, biomedical NLP, entity relation, literature review, bioinformatics, immuno-oncology, single-cell, immunotherapy, research assistant, AI agent tools.


What it does

  • Search academic papers across Semantic Scholar with filters for year, venue, citation count, open access, and sort order.
  • Resolve biomedical entities to canonical PubTator3 IDs: @GENE_JAK1, @CHEMICAL_Pembrolizumab, @DISEASE_Neoplasms.
  • Mine entity relations such as treat, inhibit, cause, associate, interact, with links back to PubMed evidence.
  • Traverse citation graphs (citations/references) and get paper recommendations from examples.
  • Cache everything locally in SQLite so repeated queries are fast and reproducible.

Features

Semantic Scholar tools

  • s2_search_papers – general paper search with year, venue, citation count, and sorting filters
  • s2_get_paper – single paper metadata (supports S2 paperId, DOI, PMID, arXiv)
  • s2_batch_get_papers – batch metadata lookup (max 100)
  • s2_get_citations / s2_get_references – citation graph traversal
  • s2_recommend_papers – recommendation from positive/negative examples

PubTator3 tools

  • pubtator_find_entity – normalize biomedical entities (@GENE_JAK1, @CHEMICAL_Pembrolizumab, …)
  • pubtator_find_relations – entity–entity relations with PMID evidence counts
  • pubtator_search – free-text or relation-query search

Composite helpers

  • biomed_relation_evidence – one-shot resolver from plain names to entity IDs, relations, and PMIDs
  • paper_enrich_with_pubtator – enrich a Semantic Scholar paper with PubTator annotations
  • research_query – unified literature search with optional PubTator enrichment

Quick Start

git clone <repo-url> ~/Publish/paperSearch
cd ~/Publish/paperSearch
uv sync --extra dev

Create your local config file:

mkdir -p ~/.config/paperSearch
cp config.example.json ~/.config/paperSearch/config.json
# edit ~/.config/paperSearch/config.json and add your Semantic Scholar API key

Run the smoke test:

uv run python scripts/smoke_test.py

Configuration

paperSearch reads a user-level JSON config file, then lets environment variables override it.

Config file (recommended)

Path: ~/.config/paperSearch/config.json

{
  "semantic_scholar_api_key": "YOUR_SEMANTIC_SCHOLAR_API_KEY",
  "cache_path": "/tmp/paper_search_cache.db"
}
Key Required Default Description
semantic_scholar_api_key recommended — See API tokens below
cache_path no /tmp/paper_search_cache.db Local SQLite cache file

Environment variables

These override the config file if set:

Variable Description
SEMANTIC_SCHOLAR_API_KEY Semantic Scholar API key
PAPER_SEARCH_CACHE SQLite cache file path

An .env.example template is included for users who prefer dotenv-style setup. Do not commit .env or config.json. Both are already ignored in .gitignore.


API Tokens

Semantic Scholar API Key

  • Purpose: Authenticates requests to the Semantic Scholar Academic Graph API. Using a key raises rate limits compared to anonymous access.
  • Source: https://www.semanticscholar.org/product/api
  • Required? No. The server works without a key, but you will hit stricter anonymous rate limits.
  • How to provide: Write it in ~/.config/paperSearch/config.json under semantic_scholar_api_key, or export SEMANTIC_SCHOLAR_API_KEY.

PubTator3

  • Purpose: NCBI PubTator3 provides biomedical entity normalization, relation mining, and article search.
  • Source: https://www.ncbi.nlm.nih.gov/research/pubtator3/
  • Required? No token is required; PubTator3 is a public NCBI service. Respect NCBI rate-limit guidelines.

Agent Setup

Claude Code

Edit ~/.claude/settings.json (global) or ~/.claude.json (project-level) and add an entry under mcpServers:

{
  "mcpServers": {
    "paperSearch": {
      "command": "uv",
      "args": [
        "--project",
        "/path/to/paperSearch",
        "run",
        "python",
        "-m",
        "paper_search.server"
      ],
      "env": {}
    }
  }
}

The API key is read from ~/.config/paperSearch/config.json, so you do not need to put it in the Claude config.

Codex

Edit ~/.codex/.mcp.json:

{
  "mcpServers": {
    "paperSearch": {
      "command": "uv",
      "args": [
        "--project",
        "/path/to/paperSearch",
        "run",
        "python",
        "-m",
        "paper_search.server"
      ],
      "env": {}
    }
  }
}

Or, if you use ~/.codex/config.toml:

[mcp_servers.paperSearch]
type = "stdio"
command = "uv"
args = ["--project", "/path/to/paperSearch", "run", "python", "-m", "paper_search.server"]

[mcp_servers.paperSearch.env]

OpenCode

Edit ~/.config/opencode/opencode.json (global) or create opencode.json in your project root:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "paperSearch": {
      "type": "local",
      "command": [
        "uv",
        "--project",
        "/path/to/paperSearch",
        "run",
        "python",
        "-m",
        "paper_search.server"
      ],
      "environment": {},
      "enabled": true
    }
  }
}

Tool Reference

All tools return a normalized envelope:

{
  "source": "semantic_scholar|pubtator3|composite",
  "query": ...,
  "retrieved_at": "2026-06-30T12:00:00Z",
  "cache_key": "sha256...",
  "from_cache": false,
  "raw_ids": [...],
  "items": [...],
  "warnings": []
}

Semantic Scholar

Tool Description
s2_search_papers General paper search
s2_get_paper Single paper details
s2_batch_get_papers Batch metadata lookup (max 100)
s2_get_citations Papers citing a given paper
s2_get_references Papers referenced by a given paper
s2_recommend_papers Recommendations from example papers

PubTator3

Tool Description
pubtator_find_entity Entity autocomplete/normalization
pubtator_find_relations Biomedical relations between entities
pubtator_search Article/PMID search

Composite

Tool Description
biomed_relation_evidence Resolve names → entity IDs → relations → PMIDs
paper_enrich_with_pubtator Enrich a paper with PubTator annotations
research_query Unified search with optional PubTator enrichment

Why paperSearch?

Most LLM literature searches are shallow web lookups. paperSearch gives agents:

  • Structured metadata: DOI, PMID, citation counts, venues, authors, open-access PDFs.
  • Entity-level reasoning: genes, chemicals, diseases, variants from PubTator3.
  • Citable evidence: every relation is backed by PubMed PMIDs.
  • Local caching: SQLite-backed TTL cache reduces API calls and keeps results reproducible.
  • Agent-native: stdio MCP means it works out of the box with Claude Code, OpenCode, Codex, and any other MCP client.

Development

uv sync --extra dev
uv run ruff check .
uv run pytest -q
uv run python scripts/smoke_test.py

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选