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.
curl -O https://raw.githubusercontent.com/hhx465453939/mcp-pubmed-server/main/CLAUDE.mdgit clone --depth 1 https://github.com/hhx465453939/mcp-pubmed-serverWrote 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.
[](https://agentmods.dev/instructions/hhx465453939/mcp-pubmed-server/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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` 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 工具集合
- pubmed_search: 主要文献搜索工具,支持高级参数
- pubmed_quick_search: 快速搜索,返回精简结果
- pubmed_get_details: 获取指定PMID的完整信息
- pubmed_extract_key_info: 提取论文关键信息
- pubmed_cross_reference: 交叉引用相关文献
- pubmed_batch_query: 批量查询多个PMID
- 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最佳实践
- 可配置性: 通过环境变量和配置文件支持不同使用场景
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.
- 10d ago First seen · 115 lines · 997 tokens per session scan B 21e2dd86534c
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.
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.
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.
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).
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.
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).
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.