npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

giisp-entrez-mcp

v1.1.0

Published

MCP服务器用于访问NCBI Entrez编程工具的所有API接口

Readme

Giiisp NCBI Entrez MCP 服务器

npm version License: MIT Node.js Version

一个基于模型上下文协议(MCP)的服务器,用于访问NCBI Entrez编程工具的所有API接口。该包通过MCP协议为AI助手和研究工具提供无缝的生物信息学数据访问。

✨ 功能特性

  • 🔬 核心E-utilities支持 - 实现7个核心NCBI E-utilities工具
  • 高性能 - 30秒超时,优化的性能表现
  • 🛡️ 健壮的错误处理 - 全面的错误管理机制
  • 📊 详细的日志记录 - 便于调试的日志系统
  • 🔧 易于集成 - 简单的MCP协议实现
  • 🌍 多数据库支持 - 支持38个NCBI数据库
  • 📅 灵活的搜索选项 - 支持日期范围、排序等多种搜索参数

🚀 快速开始

安装

npm install -g giisp-entrez-mcp

使用方法

作为全局命令

giisp-entrez

作为MCP服务器

服务器将启动并监听通过stdio的MCP协议消息。

与Claude Desktop集成

要在Claude Desktop中使用此MCP服务器,请将以下内容添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

方法1:使用npx(推荐)

{
  "mcpServers": {
    "giisp-entrez-mcp": {
      "command": "npx",
      "args": ["-y", "giisp-entrez-mcp"]
    }
  }
}

方法2:全局安装后使用

{
  "mcpServers": {
    "giisp-entrez": {
      "command": "giisp-entrez"
    }
  }
}

添加此配置后,重启Claude Desktop,您就可以通过MCP接口直接访问NCBI数据。

开发安装

git clone https://github.com/giisp/giisp-entrez-mcp.git
cd giisp-entrez-mcp
npm install
npm start

📖 使用说明

支持的E-utilities工具

1. EInfo - 数据库信息

获取数据库信息,包括可用数据库列表、字段列表和更新频率。

参数:

  • db (string, 可选): 数据库名称,不提供则返回所有数据库信息

示例:

{
  "name": "EInfo",
  "arguments": {
    "db": "pubmed"
  }
}

2. ESearch - 搜索记录

在指定数据库中搜索记录,返回匹配的UID列表。

参数:

  • db (string, 必需): 要搜索的数据库名称
  • term (string, 必需): 搜索查询词
  • usehistory (boolean, 可选): 是否使用历史记录
  • retstart (integer, 可选): 返回结果的起始位置
  • retmax (integer, 可选): 返回结果的最大数量
  • sort (string, 可选): 排序方式
  • mindate (string, 可选): 最小日期(格式:YYYY/MM/DD)
  • maxdate (string, 可选): 最大日期(格式:YYYY/MM/DD)

示例:

{
  "name": "ESearch",
  "arguments": {
    "db": "pubmed",
    "term": "artificial intelligence",
    "retmax": 10,
    "sort": "relevance"
  }
}

3. EPost - 上传UID列表

上传UID列表到NCBI历史服务器。

参数:

  • db (string, 必需): 数据库名称
  • id (string, 必需): UID列表,用逗号分隔

示例:

{
  "name": "EPost",
  "arguments": {
    "db": "pubmed",
    "id": "12345678,87654321"
  }
}

4. ESummary - 文档摘要

获取指定UID的文档摘要信息。

参数:

  • db (string, 必需): 数据库名称
  • id (string, 必需): UID列表,用逗号分隔
  • version (string, 可选): 版本号
  • retmode (string, 可选): 返回格式(xml或json)

示例:

{
  "name": "ESummary",
  "arguments": {
    "db": "pubmed",
    "id": "12345678",
    "retmode": "json"
  }
}

5. EFetch - 完整记录

获取指定UID的完整记录。

参数:

  • db (string, 必需): 数据库名称
  • id (string, 必需): UID列表,用逗号分隔
  • rettype (string, 可选): 返回类型(根据数据库而定)
  • retmode (string, 可选): 返回格式
  • version (string, 可选): 版本号

示例:

{
  "name": "EFetch",
  "arguments": {
    "db": "pubmed",
    "id": "12345678",
    "retmode": "xml"
  }
}

6. ELink - 相关记录

查找相关记录或在不同数据库间建立链接。

参数:

  • dbfrom (string, 必需): 源数据库名称
  • db (string, 必需): 目标数据库名称
  • id (string, 必需): 源数据库的UID列表
  • linkname (string, 可选): 链接名称
  • term (string, 可选): 搜索词
  • usehistory (boolean, 可选): 是否使用历史记录
  • cmd (string, 可选): 命令类型

示例:

{
  "name": "ELink",
  "arguments": {
    "dbfrom": "pubmed",
    "db": "protein",
    "id": "12345678"
  }
}

7. ECitMatch - 引用匹配

匹配引用格式。

参数:

  • bdata (string, 必需): 引用数据,每行一个引用
  • retmode (string, 可选): 返回格式(xml或json)

示例:

{
  "name": "ECitMatch",
  "arguments": {
    "bdata": "Smith J, et al. Nature. 2020;123:456-789.",
    "retmode": "json"
  }
}

支持的数据库

  • pubmed - 生物医学文献
  • protein - 蛋白质序列
  • nucleotide - 核酸序列
  • gene - 基因记录
  • genome - 基因组数据
  • structure - 分子结构
  • taxonomy - 分类学数据
  • gds - 基因表达数据集
  • sra - 序列读取档案
  • bioproject - 生物项目
  • biosample - 生物样本
  • clinvar - 临床变异
  • dbvar - 结构变异
  • gap - 基因型和表型
  • geoprofiles - 基因表达谱
  • homologene - 同源基因
  • medgen - 医学遗传学
  • mesh - 医学主题词
  • nlmcatalog - NLM目录
  • omim - 在线人类孟德尔遗传
  • pmc - PubMed Central
  • popset - 群体数据集
  • proteinclusters - 蛋白质簇
  • sequences - 序列数据
  • snp - 单核苷酸多态性
  • unigene - UniGene
  • unists - UniSTS

🔧 技术细节

  • 超时时间: 30秒
  • 请求头: 自动Content-Type和User-Agent
  • 错误处理: 区分网络、API和超时错误
  • 日志记录: 详细的请求和响应日志

🛠️ 错误处理

服务器处理以下错误类型:

  • 超时错误: 请求超过30秒
  • 网络错误: 无法连接到NCBI服务器
  • API错误: 服务器返回错误状态码
  • 参数错误: 缺少必需参数或类型错误

🧪 测试

运行测试套件:

npm test

这将测试:

  • API连接性
  • 参数验证
  • 错误处理

📁 项目结构

├── server.js              # 主服务器文件
├── package.json           # 项目配置和依赖
├── README.md             # 项目文档
├── LICENSE               # MIT许可证
├── .gitignore           # Git忽略规则
└── test/
    └── test-api.js       # 测试套件

🚀 开发

调试模式

使用Node.js调试器运行调试模式:

npm run dev

在调试器中设置断点进行开发。

贡献

  1. Fork仓库
  2. 创建功能分支
  3. 进行更改
  4. 为新功能添加测试
  5. 提交拉取请求

📄 许可证

MIT许可证 - 详见LICENSE文件。

🤝 支持

🔗 相关链接