io.github.cyanheads/pubmed-mcp-server

平台与服务

by cyanheads

面向 PubMed 的综合 MCP Server,可从 NCBI 检索、获取并分析生物医学文献,适合研究与知识发现。

什么是 io.github.cyanheads/pubmed-mcp-server

面向 PubMed 的综合 MCP Server,可从 NCBI 检索、获取并分析生物医学文献,适合研究与知识发现。

README

<div align="center"> <h1>@cyanheads/pubmed-mcp-server</h1> <p><b>MCP server for the NCBI E-utilities API. Search PubMed, fetch article metadata and full text, generate citations, explore MeSH terms, and discover related research. STDIO or Streamable HTTP.</b> <div>9 Tools • 1 Resource • 1 Prompt</div> </p> </div> <div align="center">

npm Version Framework MCP SDK

License TypeScript Bun

</div> <div align="center">

Public Hosted Server: https://pubmed.caseyjhand.com/mcp

</div>

Tools

Nine tools for working with PubMed and NCBI data:

ToolDescription
pubmed_search_articlesSearch PubMed with full query syntax, field-specific filters, date ranges, pagination, and optional brief summaries
pubmed_fetch_articlesFetch full article metadata by PMIDs — abstract, authors, journal, MeSH terms, grants
pubmed_fetch_fulltextFetch full-text articles from PubMed Central — body sections, references, and metadata for open-access articles
pubmed_format_citationsGenerate formatted citations in APA 7th, MLA 9th, BibTeX, or RIS
pubmed_find_relatedFind similar articles, citing articles, or references for a given PMID
pubmed_spell_checkSpell-check biomedical queries using NCBI's ESpell service
pubmed_lookup_meshSearch and explore MeSH vocabulary — tree numbers, scope notes, entry terms
pubmed_lookup_citationResolve partial bibliographic references to PubMed IDs via ECitMatch
pubmed_convert_idsConvert between DOI, PMID, and PMCID using the PMC ID Converter API

pubmed_search_articles

Search PubMed with full NCBI query syntax and filters.

  • Free-text queries with PubMed's full boolean and field-tag syntax
  • Field-specific filters: author, journal, MeSH terms, language, species
  • Common filters: has abstract, free full text
  • Date range filtering by publication, modification, or Entrez date
  • Publication type filtering (Review, Clinical Trial, Meta-Analysis, etc.)
  • Sort by relevance, publication date, author, or journal
  • Pagination via offset for paging through large result sets
  • Optional brief summaries for top N results via ESummary

pubmed_fetch_articles

Fetch full article metadata by PubMed IDs.

  • Batch fetch up to 200 articles at once (auto-switches to POST for batches >= 100)
  • Returns structured data: title, abstract, authors with deduplicated affiliations, journal info, DOI
  • Direct links to PubMed and PubMed Central (when available)
  • Optional MeSH terms, grant information, and publication types
  • Handles PubMed's inconsistent XML (structured abstracts, missing fields, varying date formats)

pubmed_fetch_fulltext

Fetch full-text articles from PubMed Central (PMC).

  • Accepts PMC IDs directly or PubMed IDs (auto-resolved to PMCIDs via ELink)
  • Returns complete article body text organized by sections and subsections
  • Optional reference list from back matter
  • Section filtering by title (case-insensitive match, e.g. ["methods", "results"])
  • Configurable max sections to limit response size
  • Up to 10 articles per request
  • Only open-access articles available in PMC will return full text

pubmed_format_citations

Generate formatted citations for articles.

  • Four citation styles: APA 7th, MLA 9th, BibTeX, RIS
  • Request multiple styles per article in a single call
  • Hand-rolled formatters — zero external dependencies, fully Workers-compatible
  • Up to 50 articles per request

pubmed_find_related

Find articles related to a source article via ELink.

  • Three relationship types: similar (content similarity), cited_by, references
  • Results enriched with title, authors, publication date, and source via ESummary
  • Similarity scores included for similar relationship type

pubmed_spell_check

Spell-check a biomedical query using NCBI's ESpell.

  • Returns the original query, corrected query, and whether a suggestion was found
  • Useful for query refinement before searching

pubmed_lookup_mesh

Search and explore the MeSH (Medical Subject Headings) vocabulary.

  • Search MeSH terms by name with exact-heading matching
  • Detailed records with tree numbers, scope notes, and entry terms by default
  • Useful for building precise PubMed queries with controlled vocabulary

pubmed_lookup_citation

Resolve partial bibliographic references to PubMed IDs via NCBI ECitMatch.

  • Match citations by journal, year, volume, first page, and/or author name
  • More fields = better match accuracy; at least one field required
  • Batch up to 25 citations per request
  • Deterministic matching — more reliable than free-text search for known references

pubmed_convert_ids

Convert between article identifiers (DOI, PMID, PMCID) using the PMC ID Converter API.

  • Batch up to 50 IDs per request
  • Accepts DOIs, PMIDs, or PMCIDs (all IDs must be the same type)
  • Only resolves articles indexed in PubMed Central
  • Returns all available identifier mappings for each input ID

Resource and prompt

TypeNameDescription
Resourcepubmed://database/infoPubMed database metadata via EInfo (field list, record count, last update)
Promptresearch_planGenerate a structured 4-phase biomedical research plan outline

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool definitions — single file per tool, framework handles registration and validation
  • Unified error handling across all tools
  • Pluggable auth (none, jwt, oauth)
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase

PubMed-specific:

  • Complete NCBI E-utilities integration (ESearch, EFetch, ESummary, ELink, ESpell, EInfo, ECitMatch) plus PMC ID Converter
  • Sequential request queue with configurable delay for NCBI rate limit compliance
  • NCBI-specific XML parser with isArray hints for PubMed's inconsistent XML structure
  • Hand-rolled citation formatters (APA, MLA, BibTeX, RIS) — zero deps, Workers-compatible

Getting started

Public Hosted Instance

A public instance is available at https://pubmed.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{
  "mcpServers": {
    "pubmed": {
      "type": "streamable-http",
      "url": "https://pubmed.caseyjhand.com/mcp"
    }
  }
}

Self-Hosted / Local

Add the following to your MCP client configuration file.

json
{
  "mcpServers": {
    "pubmed": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/pubmed-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "NCBI_API_KEY": "your-key-here"
      }
    }
  }
}

Or with npx (no Bun required):

json
{
  "mcpServers": {
    "pubmed": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/pubmed-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "NCBI_API_KEY": "your-key-here"
      }
    }
  }
}

Or with Docker:

json
{
  "mcpServers": {
    "pubmed": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/pubmed-mcp-server:latest"]
    }
  }
}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp

Prerequisites

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/pubmed-mcp-server.git
  1. Navigate into the directory:
sh
cd pubmed-mcp-server
  1. Install dependencies:
sh
bun install

Configuration

All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or httpstdio
MCP_HTTP_PORTHTTP server port3010
MCP_AUTH_MODEAuthentication: none, jwt, or oauthnone
MCP_LOG_LEVELLog level (debug, info, warning, error, etc.)info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1in-memory
NCBI_API_KEYNCBI API key for higher rate limits (10 req/s vs 3 req/s)none
NCBI_ADMIN_EMAILContact email sent with NCBI requests (recommended by NCBI)none
NCBI_REQUEST_DELAY_MSDelay between NCBI requests in ms334 (100 with key)
NCBI_MAX_RETRIESRetry attempts for failed NCBI requests3
NCBI_TIMEOUT_MSNCBI request timeout in ms30000
OTEL_ENABLEDEnable OpenTelemetryfalse

Running the server

Local development

  • Build and run the production version:

    sh
    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:http
    # or
    bun run start:stdio
    
  • Run checks and tests:

    sh
    bun run devcheck  # Lints, formats, type-checks, and more
    bun run test      # Runs the test suite
    

Project structure

DirectoryPurpose
src/mcp-server/toolsTool definitions (*.tool.ts). Nine PubMed tools.
src/mcp-server/resourcesResource definitions. Database info resource.
src/mcp-server/promptsPrompt definitions. Research plan prompt.
src/services/ncbiNCBI E-utilities service layer — API client, queue, parser, formatter.
src/configServer-specific environment variable parsing and validation with Zod.
tests/Unit and integration tests, mirroring the src/ structure.

Development guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for logging, ctx.state for storage
  • Register new tools and resources in the createApp() arrays

Contributing

Issues and pull requests are welcome. Run checks and tests before submitting:

sh
bun run devcheck
bun run test

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

常见问题

io.github.cyanheads/pubmed-mcp-server 是什么?

面向 PubMed 的综合 MCP Server,可从 NCBI 检索、获取并分析生物医学文献,适合研究与知识发现。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描111.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描111.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描9.6k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.0k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.8k

评论