PubMed MCP Server
Enables comprehensive biomedical literature research through PubMed database access with advanced search, full-text retrieval, citation analysis, and batch processing capabilities. Supports both local deployment and cloud hosting for seamless integration with AI assistants.
README
PubMed MCP Server - Remote Edition
A comprehensive Model Context Protocol (MCP) server for PubMed database access, optimized for deployment on render.com and other cloud platforms. This server provides advanced biomedical literature search, retrieval, and analysis capabilities through both local (stdio) and remote (SSE/HTTP) transports.
🚀 Features
🔧 Tools
search_pubmed: Search PubMed with comprehensive summaries and metadataget_full_abstract: Retrieve complete abstracts by PMIDget_full_text: Extract full text from PMC open access articlesexport_ris: Export citations in RIS format for reference managersget_citation_counts: Analyze citation metrics using NCBI elink APIoptimize_search_query: Transform natural language to optimized PubMed queries with MeSH termsfind_similar_articles: Find similar articles using NCBI's similarity algorithmbatch_process: Process multiple PMIDs with multiple operations efficiently
🌐 Deployment Modes
- Local Mode: Traditional stdio transport for Claude Desktop
- Remote Mode: SSE/HTTP transport for cloud deployment (render.com, etc.)
📋 Prerequisites
- Node.js v18.x or higher
- npm or yarn package manager
- (Optional) render.com account for cloud deployment
🎯 Installation & Usage
Option 1: Deploy to Render.com (Recommended for Remote Access)
-
Fork or clone this repository
-
Connect to Render.com
- Sign up at render.com
- Click "New +" → "Web Service"
- Connect your GitHub repository
-
Configure Environment Variables in Render dashboard:
NODE_ENV=production MCP_TRANSPORT=sse PORT=8000 HOST=0.0.0.0 LOG_LEVEL=info NCBI_EMAIL=your-email@example.com -
Deploy
- Render will automatically detect
render.yamland deploy - Your service URL will be:
https://pubmed-mcp-server.onrender.com
- Render will automatically detect
-
Add to Claude Desktop
Add to your Claude Desktop configuration:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"pubmed-remote": {
"url": "https://your-service-name.onrender.com/sse"
}
}
}
Option 2: Local Installation
- Clone and install
git clone <repository-url>
cd pubmed-mcp-remote
npm install
npm run build
- Configure for Local Mode
Add to Claude Desktop configuration:
{
"mcpServers": {
"pubmed": {
"command": "node",
"args": ["/path/to/pubmed-mcp-remote/dist/index.js"],
"env": {
"NCBI_EMAIL": "your-email@example.com"
}
}
}
}
Option 3: Development Mode
# Local stdio mode
npm run dev
# Remote SSE mode
MCP_TRANSPORT=sse npm run dev
⚙️ Configuration
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
NODE_ENV |
Environment mode | development |
No |
MCP_TRANSPORT |
Transport mode (sse or stdio) |
stdio |
No |
PORT |
Server port (remote mode only) | 8000 |
No |
HOST |
Server host (remote mode only) | 0.0.0.0 |
No |
LOG_LEVEL |
Logging level (debug, info, warn, error) |
info |
No |
NCBI_EMAIL |
Email for NCBI API (required by NCBI) | user@example.com |
Yes |
MAX_RESULTS |
Maximum search results | 100 |
No |
REQUEST_TIMEOUT |
API timeout in milliseconds | 30000 |
No |
Transport Modes
Stdio Mode (Local)
- Traditional MCP transport for local Claude Desktop
- Activated by default or when
MCP_TRANSPORT=stdio - Communication via stdin/stdout
SSE Mode (Remote)
- HTTP/SSE transport for remote deployment
- Activated when
MCP_TRANSPORT=sseor--remoteflag - Provides HTTP endpoints:
/sse- SSE connection endpoint/health- Health check endpoint/message- Client-to-server messaging
🔍 Example Usage
1. Query Optimization
Input: "covid vaccine effectiveness in elderly"
→ Output: Optimized PubMed query with MeSH terms
2. Literature Search
Tool: search_pubmed
Query: "diabetes treatment 2023"
Max Results: 10
→ Returns: Detailed articles with abstracts and metadata
3. Citation Analysis
Tool: get_citation_counts
PMIDs: ["36038128", "30105375"]
→ Returns: Citation counts and citing articles
4. Batch Processing
Tool: batch_process
PMIDs: ["36038128", "35105375", "34567890"]
Operations: ["abstract", "citations", "similar"]
→ Returns: Comprehensive analysis of all articles
📊 API Limits
| Operation | Limit | Notes |
|---|---|---|
| Search results | 100 articles | Per query |
| Full abstracts | 20 PMIDs | Per request |
| Full text | 10 PMC articles | Per request |
| Citation analysis | 20 PMIDs | Per request |
| RIS export | 50 PMIDs | Per batch |
| Similar articles | 50 articles | Per PMID (default: 10) |
| Batch processing | 50 PMIDs | Per batch, 5 concurrent ops |
| API delays | 200-600ms | Between requests |
🛡️ Rate Limiting & Best Practices
-
NCBI Guidelines Compliance
- Always provide a valid email address in
NCBI_EMAIL - Respect API rate limits (3 requests/second without API key)
- Use delays between requests (automatically handled)
- Always provide a valid email address in
-
Error Handling
- Network connectivity issues
- Invalid PMIDs or queries
- API timeouts
- Missing full text content
-
Performance Optimization
- Use batch processing for multiple articles
- Cache results when possible
- Use query optimization for better search results
🏗️ Project Structure
pubmed-mcp-remote/
├── src/
│ ├── index.ts # Main server with dual transport support
│ └── pubmed-api.ts # PubMed API integration
├── dist/ # Compiled JavaScript output
├── render.yaml # Render.com deployment config
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .gitignore # Git ignore rules
└── README.md # This file
🔧 Development
Build
npm run build
Run Locally (stdio)
npm start
Run as Remote Server (SSE)
npm run start:remote
# or
MCP_TRANSPORT=sse npm start
Clean Build
npm run clean
🚀 Deployment
Render.com
The repository includes a render.yaml file for automatic deployment:
- Push your code to GitHub
- Connect repository to Render
- Render automatically deploys using
render.yaml - Update environment variables in Render dashboard
Other Platforms
For deployment to other platforms (Heroku, AWS, DigitalOcean, etc.):
- Set
MCP_TRANSPORT=sseenvironment variable - Set
PORTto platform-required value - Run
npm run build && npm run start:remote
📖 MeSH Term Optimization
The server includes extensive medical term mappings:
- COVID-19 & Vaccines: covid, coronavirus, vaccination
- Cardiovascular: heart attack, myocardial infarction
- Cancer: tumor, oncology, carcinoma
- Mental Health: depression, anxiety
- Study Types: clinical trial, meta-analysis, RCT
- Treatment Types: therapy, surgery, medication
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly (both local and remote modes)
- Submit a pull request
📝 Version History
v1.0.2 (Current)
- ✨ Added remote/SSE transport support
- 🌐 Render.com deployment configuration
- 🔧 Environment variable configuration
- 📊 Health check endpoint
- ⚡ Dual mode support (stdio/SSE)
v1.0.1
- 🆕 Similar articles feature
- 📊 Citation analysis improvements
v1.0.0
- 🚀 Initial release
- 📖 Core PubMed functionality
📄 License
MIT License - see LICENSE file for details
🙋♂️ Support
For issues or questions:
- Check existing GitHub issues
- Create a new issue with detailed description
- Include error messages and reproduction steps
🔗 Related Resources
- NCBI E-utilities Documentation
- PubMed Search Tips
- Model Context Protocol
- Render.com Docs
- Claude Desktop
🎯 Quick Start Checklist
- [ ] Clone repository
- [ ] Install dependencies (
npm install) - [ ] Build project (
npm run build) - [ ] Set
NCBI_EMAILenvironment variable - [ ] Choose deployment mode (local or remote)
- [ ] Configure Claude Desktop
- [ ] Test with a simple search query
⚡ Performance Tips
- Use query optimization for better search results
- Batch process when analyzing multiple articles
- Cache results to avoid redundant API calls
- Monitor rate limits to prevent API throttling
- Use specific PMIDs when possible for faster retrieval
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。