Token导航 LogoToken导航TokenDH.com
Pubmed MCP Advanced logo
运维云端stdio官方级别未说明来源级核验

Pubmed MCP Advanced

MCP Server

提供PubMed和PubMed Central研究文献的智能API服务,支持LLM应用的生物医学文献访问。

工具数

16

提示词数

0

GitHub Stars

8

资源数

0
API集成PythonClaudeLLM应用Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

SuyashEkhande

提供方

SuyashEkhande

最后核验

2026/5/17 20:23

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

🧬 PubMed高级MCP服务器

![Python 3.10+](https://www.python.org/downloads/) ![FastMCP](https://github.com/jlowin/fastmcp) ![License: MIT](https://opensource.org/licenses/MIT) ![NCBI E-utilities](https://www.ncbi.nlm.nih.gov/books/NBK25501/)

一个全面的模型上下文协议(MCP)服务器,将PubMed和PubMed Central研究文献API作为LLM应用程序的智能工具公开。

建于❤️ 通过 Suyash Ekhande

特性快速开始工具例子建筑

https://github.com/user-attachments/assets/892978f7-88d8-4b26-992e-41ba87c1b1cf

______________________________________________________________________

🌟 特性

  • 16智能工具 分为5类,用于全面的生物医学文献检索
  • 34M+PubMed文章 -搜索世界上最大的生物医学摘要数据库
  • 7M+PMC全文文章 -从PubMed Central访问完整的文章内容
  • 智能速率限制 -自动符合NCBI速率限制(3-10要求/秒)
  • 跨数据库链接 -将文章与基因、蛋白质、临床变异等联系起来
  • ID转换 -在PMID、PMCID、DOI和手稿ID之间无缝转换
  • BioC格式支持 -NLP和文本挖掘应用程序的预解析文本
  • 管道运营 -使用Entrez历史服务器构建复杂的多步骤查询
  • 批处理 -通过分块操作高效处理10K+文章

📦 安装

先决条件

  • Python 3.10或更高版本
  • pip或uv包管理器

从源代码安装

# Clone the repository
git clone https://github.com/yourusername/pubmed-advanced-mcp.git
cd pubmed-advanced-mcp

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Or install as package
pip install -e .

配置API密钥(推荐)

# Copy example environment file
cp .env.example .env

# Edit .env and add your NCBI API key
# Get one at: https://www.ncbi.nlm.nih.gov/account/
注: 如果没有API密钥,则每秒只能有3个请求。使用API密钥,每秒可以得到10个请求。

🚀 快速开始

运行MCP服务器

# Using Python directly (Streamable HTTP on port 8000)
python -m src.server

# With custom host/port
MCP_HOST=127.0.0.1 MCP_PORT=9000 python -m src.server
运输: 此服务器使用 可流式传输的HTTP 作为唯一的传输协议。它继续运行 http://0.0.0.0:8000/mcp 默认情况下。

使用Docker运行

# Build the image
docker build -t pubmed-mcp .

# Run the container
docker run -d -p 8000:8000 --name pubmed-mcp pubmed-mcp

# Run with NCBI API key for higher rate limits
docker run -d -p 8000:8000 -e NCBI_API_KEY=your-api-key pubmed-mcp

🛠 可用工具

类别1:搜索和发现(5个工具)

工具描述用例示例
pubmed_search搜索34M+PubMed摘要查找关于CAR-T疗法的评论
pmc_searchPMC中的全文搜索协议的搜索方法部分
mesh_term_searchMeSH控制词汇搜索查找所有癌症治疗文章
advanced_search多字段布尔查询复杂的作者+主题+日期搜索
global_search跨数据库点击数跨NCBI发现数据

第2类:文档检索(4种工具)

工具描述用例示例
fetch_article_summary获取文章元数据检索作者和摘要信息
fetch_full_article获取完整的文章内容下载完整的PMC文章
fetch_bioc_articleNLP的BioC格式文本挖掘和NER任务
batch_fetch_articles批量文章检索高效下载1000+篇文章

第3类:交叉引用和链接(3个工具)

工具描述用例示例
find_related_articles引文/相似性链接建立引文网络
link_to_databases与基因、蛋白质等的交联。查找文章中提到的基因
find_citations_by_authors作者发表历史跟踪研究人员输出

第4类:ID转换(2个工具)

工具描述用例示例
convert_article_ids批处理ID转换将DOI转换为PMID
resolve_article_identifier单ID解析按任何ID类型查找文章

第5类:高级操作(2个工具)

工具描述用例示例
build_search_pipeline多步骤查询流程复杂的研究工作流程
batch_process_articles大规模加工处理10K+件

📖 使用示例

基本搜索

User: Find recent reviews about CRISPR gene editing in cancer

AI uses: pubmed_search(
    query="CRISPR gene editing cancer",
    filters={"publication_types": ["Review"], "publication_date_start": "2023"},
    max_results=10
)

基于MeSH的搜索

User: Find all articles about breast cancer treatment using MeSH terms

AI uses: mesh_term_search(
    mesh_term="Breast Neoplasms",
    qualifiers=["therapy", "drug therapy"],
    explode=True,
    max_results=50
)

查找相关文章

User: What articles are similar to PMID 37000000?

AI uses: find_related_articles(
    pmid="37000000",
    relationship_type="similar",
    max_results=20
)

转换文章ID

User: Convert these DOIs to PMIDs: 10.1038/nature12373, 10.1126/science.1225829

AI uses: convert_article_ids(
    ids=["10.1038/nature12373", "10.1126/science.1225829"],
    from_type="auto"
)

建立研究管道

User: Find diabetes review articles that are linked to HLA genes

AI uses: build_search_pipeline(
    steps=[
        {"operation": "search", "database": "pubmed", 
         "parameters": {"query": "diabetes[mh] AND review[pt]"}},
        {"operation": "link", "database": "gene",
         "parameters": {"from_db": "pubmed"}}
    ]
)

批处理

User: Get metadata for these 500 PMIDs for my literature review

AI uses: batch_fetch_articles(
    pmids=["12345678", "23456789", ...],  # 500 IDs
    include_metadata=True,
    include_abstract=True,
    batch_size=100
)

🏗 建筑

┌─────────────────────────────────────────────────────────────────────────┐
│                         LLM / AI Agent Client                           │
└────────────────────────────────────┬────────────────────────────────────┘
                                     │
                        MCP Protocol (Streamable HTTP)
                                     │
┌────────────────────────────────────▼────────────────────────────────────┐
│                    FastMCP Server (Python)                              │
│                                                                          │
│  ┌────────────────────────────────────────────────────────────────────┐ │
│  │                    16 MCP Tools                                    │ │
│  │  Search │ Retrieval │ Linking │ ID Conversion │ Advanced Ops      │ │
│  └────────────────────────────────┬───────────────────────────────────┘ │
│                                   │                                      │
│  ┌────────────────────────────────▼───────────────────────────────────┐ │
│  │              API Clients (with Rate Limiting)                      │ │
│  │  E-Utilities │ BioC API │ ID Converter │ Session Manager           │ │
│  └────────────────────────────────┬───────────────────────────────────┘ │
└────────────────────────────────────┼────────────────────────────────────┘
                                     │
                        HTTP/REST API Calls
                                     │
        ┌────────────────────────────┼────────────────────────────┐
        ▼                            ▼                            ▼
┌─────────────────┐      ┌──────────────────┐      ┌──────────────────┐
│ NCBI E-Utilities│      │ BioC APIs        │      │ ID Converter     │
│ (34M+ articles) │      │ (29M+ articles)  │      │ (200 IDs/batch)  │
└─────────────────┘      └──────────────────┘      └──────────────────┘

📁 项目结构

pubmed-advanced-mcp/
├── src/
│   ├── __init__.py
│   ├── server.py                 # FastMCP server with all 16 tools
│   ├── config.py                 # Configuration management
│   │
│   ├── clients/                  # API client modules
│   │   ├── base.py              # Base HTTP client with rate limiting
│   │   ├── eutilities.py        # NCBI E-Utilities client
│   │   ├── bioc_api.py          # BioC text mining API
│   │   ├── id_converter.py      # PMC ID Converter
│   │   └── session_manager.py   # Entrez History management
│   │
│   ├── tools/                    # MCP Tool implementations
│   │   ├── search_tools.py      # 5 search tools
│   │   ├── retrieval_tools.py   # 4 retrieval tools
│   │   ├── linking_tools.py     # 3 linking tools
│   │   ├── id_conversion_tools.py # 2 ID tools
│   │   └── advanced_tools.py    # 2 advanced tools
│   │
│   ├── schemas/                  # Pydantic models
│   │   └── tool_schemas.py      # Input/output schemas
│   │
│   └── utils/                    # Utilities
│       ├── rate_limiter.py      # Token bucket rate limiter
│       ├── query_builder.py     # E-utilities query builder
│       └── error_handler.py     # Custom exceptions
│
├── docs/
│   ├── implementation/          # Implementation documentation
│   └── *.md                     # Original requirements
│
├── requirements.txt
├── pyproject.toml
├── .env.example
└── README.md

⚙️ 配置

环境变量

变量描述默认值
NCBI_API_KEY用于更高速率限制的NCBI API密钥无(3个请求/秒)
TOOL_NAMENCBI的工具标识符pubmed-mcp-server
TOOL_EMAIL联系电子邮件(NCBI要求)pubmed-mcp@example.com

速率限制

场景利率限制
没有API密钥3个请求/秒
使用API密钥10个请求/秒
违规IP被封锁24+小时

🔬 LLM提示示例

以下是可用于Claude或其他LLM客户端的示例提示:

文献综述

"Find all systematic reviews about COVID-19 vaccine efficacy published in 2023-2024. 
Include the abstracts and MeSH terms."

基因疾病研究

"Search for articles about TP53 mutations in breast cancer. Then link these articles 
to related gene records in NCBI Gene database."

分析

"Find all publications by Jennifer Doudna in the last 5 years and summarize 
her research focus areas."

ID转换

"I have these DOIs from my reference manager. Convert them to PMIDs so I can 
search for related articles: 10.1038/nature12373, 10.1126/science.1225829"

文本挖掘管道

"Get the full text of PMC7611378 in BioC format. I need it for named entity 
recognition to extract drug names and disease mentions."

🧪 测试

运行测试

# Install dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest

# Run with verbose output
pytest -v

# Run specific test file
pytest tests/test_search_tools.py

📚 API 文档

电子实用程序查询语法

服务器支持完整的电子实用程序查询语法:

# Basic search
cancer

# Field-specific search
cancer[ti]                    # Title
CRISPR[ab]                    # Abstract
"Zhang F"[au]                 # Author
Nature[ta]                    # Journal

# Boolean operators (MUST be uppercase)
cancer AND therapy
cancer OR tumor
cancer NOT lung

# Date ranges
cancer AND 2023[dp]           # Year
cancer AND 2020:2024[dp]      # Range

# MeSH terms
"Breast Neoplasms"[mh]        # MeSH heading
"Neoplasms/therapy"[mh]       # With qualifier

# Publication types
review[pt]
clinical trial[pt]

🤝 贡献

欢迎投稿!请随时提交拉取请求。

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/AmazingFeature)
  3. 提交您的更改(git commit -m 'Add some AmazingFeature')
  4. 推到分支(git push origin feature/AmazingFeature)
  5. 打开拉取请求

致谢

______________________________________________________________________

制作❤️ 生物医学研究界

由...建造 Suyash Ekhande

目录标签

目录标签

API集成PythonClaudeLLM应用生物医学文献本地部署API服务PubMedPubMedCentral

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

16

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP