医疗
STDIO提供FDA、WHO、PubMed医学信息的MCP服务器
提供FDA、WHO、PubMed医学信息的MCP服务器
A Model Context Protocol (MCP) server that provides comprehensive medical information by querying multiple authoritative medical APIs including FDA, WHO, PubMed, and RxNorm.
This MCP server offers five specialized tools for querying medical information from reliable sources:
search-drugsSearch for drug information using the FDA database.
Input:
query (string): Drug name to search for (brand name or generic name)limit (optional, number): Number of results to return (1-50, default: 10)Output:
Example:
Drug Search Results for "Advil"
Found 1 drug(s)
1. **ADVIL**
   Generic Name: IBUPROFEN
   Manufacturer: PFIZER CONSUMER HEALTHCARE
   Route: ORAL
   Dosage Form: TABLET
   Purpose: For temporary relief of minor aches and pains...
   Last Updated: 20210902
get-drug-detailsGet detailed information about a specific drug by NDC (National Drug Code).
Input:
ndc (string): National Drug Code (NDC) of the drugOutput:
get-health-statisticsGet health statistics and indicators from WHO Global Health Observatory.
Input:
indicator (string): Health indicator to search for (e.g., 'Life expectancy', 'Mortality rate')country (optional, string): Country code (e.g., 'USA', 'GBR')limit (optional, number): Number of results to return (1-20, default: 10)Output:
Example:
Health Statistics: Life expectancy at birth (years)
Country: USA
Found 10 data points
1. **USA** (2019)
   Value: 78.5 years
   Numeric Value: 78.5
   Date: 2019-12-31
search-medical-literatureSearch for medical research articles in PubMed.
Input:
query (string): Medical topic or condition to search formax_results (optional, number): Maximum number of articles to return (1-20, default: 10)Output:
Example:
Medical Literature Search: "diabetes treatment"
Found 10 article(s)
1. **Novel Approaches to Diabetes Management**
   PMID: 12345678
   Journal: New England Journal of Medicine
   Publication Date: 2024-01-15
search-google-scholarSearch for academic research articles using Google Scholar.
Input:
query (string): Academic topic or research query to search forOutput:
Example:
Google Scholar Search: "machine learning healthcare"
Found 10 article(s)
1. **Machine Learning in Healthcare: A Systematic Review**
   Authors: Smith J, Johnson A - Journal of Medical AI
   Year: 2023
   Citations: Cited by 45
   URL: https://scholar.google.com/...
   Abstract: This systematic review examines the application of machine learning...
Note: This tool uses web scraping to access Google Scholar since it doesn't provide a public API. It includes rate limiting protection and stealth measures to avoid detection.
search-drug-nomenclatureSearch for drug information using RxNorm (standardized drug nomenclature).
Input:
query (string): Drug name to search for in RxNorm databaseOutput:
git clone <repository-url> cd medical-mcp
npm install
npm run build
Start the MCP server:
npm start
The server runs on stdio and can be connected to any MCP-compatible client.
Here are some example queries you can make with this MCP server:
{ "tool": "search-drugs", "arguments": { "query": "Tylenol", "limit": 5 } }
{ "tool": "get-drug-details", "arguments": { "ndc": "00071015527" } }
{ "tool": "get-health-statistics", "arguments": { "indicator": "Life expectancy at birth (years)", "country": "USA", "limit": 5 } }
{ "tool": "search-medical-literature", "arguments": { "query": "COVID-19 treatment", "max_results": 10 } }
{ "tool": "search-drug-nomenclature", "arguments": { "query": "aspirin" } }
This MCP server integrates with the following medical APIs:
GET /drug/label.json - Drug labeling informationGET /api/Indicator - Health statistics and indicatorsGET /esearch.fcgi - Search for medical articlesGET /efetch.fcgi - Retrieve article detailsGET /REST/drugs.json - Standardized drug nomenclatureThe server includes comprehensive error handling:
The Google Scholar integration uses Puppeteer for web scraping with the following features:
# Build and run in stdio mode (inherently localhost-only) npm run build npm start # Or directly node build/index.js
# HTTP server on localhost only (port 3000) npm run start:http # Custom port npm run start:http:port # or node build/index.js --http --port=8080 # Test localhost access curl http://localhost:3000/info
# Build and run stdio npm run dev # Build and run HTTP npm run dev:http
# Clone the repository git clone https://github.com/JamesANZ/medical-mcp.git cd medical-mcp # Install dependencies npm install # Build the server npm run build
Create or edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "medical-mcp": { "command": "node", "args": ["/path/to/medical-mcp/build/index.js"], "cwd": "/path/to/medical-mcp" } } }
Replace the paths with your actual installation directory:
For users with NVM (Node Version Manager):
{ "mcpServers": { "medical-mcp": { "command": "/Users/yourusername/.nvm/versions/node/v22.17.0/bin/node", "args": [ "/Users/yourusername/Documents/projects/medical-mcp/build/index.js" ] } } }
For users with system Node.js:
{ "mcpServers": { "medical-mcp": { "command": "node", "args": ["/Users/yourusername/medical-mcp/build/index.js"], "cwd": "/Users/yourusername/medical-mcp" } } }
To find your Node.js path:
# If using NVM which node # Example output: /Users/yourusername/.nvm/versions/node/v22.17.0/bin/node # If using system Node.js which node # Example output: /usr/local/bin/node
Once connected, you'll have access to these medical tools:
search-drugs - Search FDA drug databasesearch-pubmed-articles - Search medical literaturesearch-google-scholar - Search academic researchsearch-medical-databases - Comprehensive multi-database searchsearch-medical-journals - Search top medical journalsget-drug-by-ndc - Get drug details by NDC codecheck-drug-interactions - Check drug interactionsget-drug-safety-info - Get drug safety informationgenerate-differential-diagnosis - Generate differential diagnosesget-diagnostic-criteria - Get diagnostic criteria for conditionsget-risk-calculators - Get clinical risk calculatorsget-lab-values - Get normal lab value rangesget-health-indicators - Get WHO health statisticssearch-rxnorm-drugs - Search RxNorm drug databasesearch-clinical-guidelines - Search clinical guidelinesUser: "What are the side effects of metformin and can it interact with lisinopril?"
Claude will use:
- search-drugs for metformin information
- check-drug-interactions for metformin + lisinopril
- get-drug-safety-info for detailed safety data
User: "A 45-year-old patient presents with chest pain, shortness of breath, and diaphoresis. What should I consider?"
Claude will use:
- generate-differential-diagnosis for possible conditions
- get-diagnostic-criteria for specific diagnostic criteria
- search-medical-databases for latest research
User: "Find recent research on COVID-19 treatment protocols"
Claude will use:
- search-pubmed-articles for medical literature
- search-medical-journals for top-tier research
- search-google-scholar for additional academic sources
# Check if the server builds correctly npm run build # Test the server directly node build/index.js # Check for port conflicts lsof -i :3000
# Make sure the executable has proper permissions chmod 755 build/index.js # On macOS, you might need to allow Node.js in Security & Privacy
{ "mcpServers": { "medical-mcp": { "command": "node", "args": ["/path/to/medical-mcp/build/index.js", "--http", "--port=3001"], "cwd": "/path/to/medical-mcp" } } }
# Set custom API timeouts export MCP_TIMEOUT=30000 # Set custom user agent export MCP_USER_AGENT="Medical-Research-Tool/1.0"
# Should work (localhost) curl http://localhost:3000/info # Should be blocked (external IP) curl http://YOUR_EXTERNAL_IP:3000/info # Returns: "Access denied: This server is restricted to localhost only"
# Verify server is bound to localhost only netstat -an | grep :3000 # Should show: 127.0.0.1:3000 (not 0.0.0.0:3000)
Important: This MCP server provides information from authoritative medical sources but should not be used as a substitute for professional medical advice, diagnosis, or treatment. Always consult with qualified healthcare professionals for medical decisions.
@modelcontextprotocol/sdk - MCP SDK for server implementationsuperagent - HTTP client for API requestspuppeteer - Browser automation for web scraping Google Scholarzod - Schema validation for tool parametersThis project is licensed under the MIT License - see the LICENSE.md file for details.