mcp-pubmed-server: Instructions file for Claude Code

CLAUDE.md

mcp-pubmed-server CLAUDE.md is an instructions file for Claude Code from hhx465453939/mcp-pubmed-server. It costs 997 tokens per session, scanned B, original, Apache-2.0.

A set of instructions for a Node.js server that connects an AI assistant to PubMed, the public database of biomedical research papers. It supports searching papers, retrieving details, extracting key information, and related queries.

In plain words
What is it for?
Use it when developing, testing, configuring, or running this PubMed literature-search server, including its PubMed API integration and cached results.
Why use it?
It gives the coding agent the project commands, configuration steps, API requirements, and cache behavior needed to work on the repository correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is hhx465453939/mcp-pubmed-server's own configuration. It tells Claude Code how to work on mcp-pubmed-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-pubmed-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to hhx465453939/mcp-pubmed-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/hhx465453939/mcp-pubmed-server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/hhx465453939/mcp-pubmed-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-pubmed-server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hhx465453939/mcp-pubmed-server/claude-md/github.svg)](https://agentmods.dev/instructions/hhx465453939/mcp-pubmed-server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/hhx465453939/mcp-pubmed-server/claude-md"><img src="https://agentmods.dev/badge/instructions/hhx465453939/mcp-pubmed-server/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-pubmed-server CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hhx465453939/mcp-pubmed-server/claude-md"><img src="https://agentmods.dev/badge/instructions/hhx465453939/mcp-pubmed-server/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 997 This file is loaded in full into every session.
When invoked 997 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00997 $0.00997
Opus 5 $0.00498 $0.00498
Sonnet 5 $0.00199 $0.00199
Haiku 4.5 $0.00100 $0.00100

Measured 10d ago against content hash 21e2dd86534c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

mcp-pubmed-server CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- **Claude Code (CLI)**: 配置在 `~/.claude/config.json`
CLAUDE.md · 115 lines

What it actually says

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目概述

这是一个 PubMed 数据服务器 (MCP Server),为 LLM 提供结构化的生物医学文献检索和分析功能。项目采用极简架构,专注于数据提供而非智能分析。

常用开发命令

基础命令

# 安装依赖
npm install

# 开发模式运行(支持文件监听和自动重启)
npm run dev

# 生产模式运行
npm start

# 运行测试
npm test

# 初始化项目(安装依赖并创建.env文件)
npm run setup

环境配置

# 复制环境变量模板
cp .env.example .env

# 编辑环境变量
# PUBMED_API_KEY=你的NCBI_API密钥
# PUBMED_EMAIL=你的邮箱地址
# ABSTRACT_MODE=quick|deep

核心架构

主要组件

  • src/index.js: 主服务器文件,包含所有 MCP 工具的实现
  • 缓存系统:
    • 内存缓存:临时存储搜索结果(LRU策略)
    • 文件缓存:持久化存储单篇论文详情(30天过期)
  • 配置文件:
    • config/mcp-config.json: MCP服务器配置模板
    • config/claude_desktop_config.json: Claude Desktop配置示例

MCP 工具集合

  1. pubmed_search: 主要文献搜索工具,支持高级参数
  2. pubmed_quick_search: 快速搜索,返回精简结果
  3. pubmed_get_details: 获取指定PMID的完整信息
  4. pubmed_extract_key_info: 提取论文关键信息
  5. pubmed_cross_reference: 交叉引用相关文献
  6. pubmed_batch_query: 批量查询多个PMID
  7. pubmed_cache_info: 缓存管理和统计

关键配置参数

  • ABSTRACT_MODE: 控制摘要长度(quick: 1500字符, deep: 6000字符)
  • 速率限制: 334ms间隔(PubMed API限制:每秒3次请求)
  • 缓存策略: 内存缓存5分钟过期,文件缓存30天过期

开发注意事项

PubMed API 集成

  • 使用 EUtilities API (esearch, esummary, efetch)
  • 需要配置 API_KEY 和 EMAIL 环境变量
  • 实现了速率限制和错误重试机制

缓存管理

  • 内存缓存使用 Map 对象,LRU淘汰策略
  • 文件缓存存储在 cache/papers/ 目录
  • 支持缓存统计和清理操作

LLM 优化特性

  • 结构化输出格式(compact, standard, detailed)
  • 摘要智能截断和关键点提取
  • 上下文窗口优化(通过 ABSTRACT_MODE 控制)

错误处理

  • 实现了完整的错误捕获和日志记录
  • 对网络超时、API限制等异常情况的处理
  • 缓存失效时的降级策略

测试和部署

本地测试

# 直接运行服务器进行测试
node src/index.js

# 测试特定工具
# 需要通过MCP客户端(如Claude Desktop, Cline等)进行测试

部署配置

项目支持多种MCP客户端:

  • Claude Desktop: 使用 claude_desktop_config.json
  • Cline (VS Code): 配置在VS Code设置中
  • Cherry Studio: 使用完整路径配置
  • Claude Code (CLI): 配置在 ~/.claude/config.json

环境变量

  • PUBMED_API_KEY: NCBI API密钥(必需)
  • PUBMED_EMAIL: 用于API请求的邮箱(必需)
  • ABSTRACT_MODE: 摘要模式(可选,默认quick)

项目结构原则

  • 单一职责: 专注于数据提供,不包含LLM分析逻辑
  • 性能优先: 通过缓存和批量操作优化响应速度
  • 标准化: 遵循MCP协议规范和PubMed API最佳实践
  • 可配置性: 通过环境变量和配置文件支持不同使用场景
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 115 lines · 997 tokens per session scan B 21e2dd86534c

Subscribe to this mod's changes

mcp-pubmed-server CLAUDE.md is an instructions file published in the GitHub repository hhx465453939/mcp-pubmed-server (6 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 997 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens