Purpose
medical-mcp is an MCP (Model Context Protocol) server used to bring authoritative medical information into AI coding environments such as Cursor and Claude Desktop. By querying multiple authoritative medical APIs, it lets users directly obtain drug information, health statistics, medical literature, clinical guidelines, and pediatric materials within AI workflows. The project emphasizes local operation: data does not leave the local machine, there is no tracking, no logging, and no uploading to the cloud, no API key is required, and it works out of the box.
Main capabilities
Drug information
- search-drugs: searches FDA, DailyMed, TGA (Australia), Health Canada, and EMA, and can filter by country (US, AU, CA, EU). Unsupported codes are rejected rather than returning empty regulatory results.
- search-drug-nomenclature: obtains standardized drug names via RxNorm (limit defaults to 25).
- search-drug-safety: queries FDA FAERS adverse events (including report IDs), recalls, and shortage information.
Health statistics
- get-health-statistics: queries WHO Global Health Observatory data, such as life expectancy, mortality, and disease prevalence.
Medical literature
- search-medical-literature: searches more than 30 million PubMed articles and includes evidence grading. The optional question or rerank parameters reorder the hits so that papers that actually answer the question rank above papers that merely share keywords.
- rank-search-hits: performs the same reordering on an existing list (title + abstract). It is only used for retrieval ranking and does not constitute diagnosis or advice.
- get-article-details: retrieves detailed article information by PMID.
- search-google-scholar: when MONID_API_KEY is set, searches academic papers via Monid TinyFish (research_paper); otherwise uses Semantic Scholar.
- search-medical-journals: queries top journals (NEJM, JAMA, Lancet, BMJ, Nature Medicine).
Clinical tools
- search-clinical-guidelines: queries practice recommendations from medical organizations.
- search-clinical-trials: queries ClinicalTrials.gov.
- list-sources: lists the complete catalog of registry adapters and specialized tool sources (WHO, PubMed, RxNorm, Scholar, AAP), and explains which MCP tool accesses each source.
Pediatric sources
- search-pediatric-guidelines: queries AAP policy/clinical reports and Bright Futures via PubMed. Out-of-domain web hits are discarded; labels come from the page itself.
- search-pediatric-literature: queries research from major pediatric journals and supports question / rerank parameters similar to medical literature.
- search-pediatric-drugs: queries drugs with pediatric labeling, including NDC, manufacturer, and DailyMed URL.
Reliability and monitoring
- health-check: probes all upstream sources and reports latency/status, circuit breaker status, and cache health.
- get-cache-stats: views cache statistics (hit rate, memory usage, entry count).
How to use
Install in Cursor (recommended)
The project provides a one-click installation link.
Manual installation
Requirements: Node.js 18+ and npm. Add the configuration to claude_desktop_config.json: macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Restart Claude Desktop after configuration.
Container operation
The container runs an HTTP server, listening on port 3000 inside the container. Use -p 3000:3000 to publish that port to the local machine. Optional API keys are passed in at runtime and are not written into the image. If local port 3000 is alreadyoccupied, you can publish another host port and have the client point to that port; the process inside the container still uses 3000. Stop the container: docker stop sends SIGTERM, and the process stops accepting connections and exits. Point the MCP client to http://127.0.0.1:3000/mcp。健康检查 The URL is not an MCP session; the client needs to send initialize, then call tools/call. Optional keys can be passed in from the shell without writing them into the image. When the client manages the container's standard input, stdio is still usable: keep stdin open, do not allocate a terminal. Use -i to keep stdin open for passing protocol messages, and do not add -t. A TTY is for interactive terminals and may alter the bytes used by this protocol. Logs stay on stderr to avoid mixing into stdout.
Example operations
- Search drug information
- Search medical literature (with evidence grading), results include evidence labels
- Run a health check
Applicable scenarios
- Medical information retrieval in AI programming environments such as Cursor and Claude Desktop.
- Query drug regulatory, naming, and safety (adverse events, recalls, shortages) information.
- Obtain WHO health statistics.
- Retrieve and rank medical literature such as PubMed, and view evidence grading labels.
- Query clinical guidelines and clinical trials.
- Query pediatric guidelines, literature, and drugs with pediatric labels.
- Monitor the availability and cache status of each data source.
Limitations and notes
- Evidence grading labels are labels automatically generated based on titles and abstracts, and are not independently verified grades.
- The ranking function is only retrieval ranking and does not constitute diagnosis or advice.
- The tools provide information from authoritative sources, but cannot replace professional medical advice, diagnosis, or treatment; medical decisions should be made in consultation with qualified medical professionals.
- Upstream API responses are validated through Zod schemas; if the source response format changes, a warning is logged but it continues to run with the raw data and will not crash.
- Rate limiting and circuit breaker policy: per-source token bucket limits (PubMed 3/sec without a key, 10/sec with a key; FDA 4/sec; Google Scholar 0.2/sec); after 3 consecutive failures, the circuit breaker opens for 60 seconds; transient failures (429, 5xx, network errors) are retried with exponential backoff up to 2 times.
- Cached responses return in <10ms, API calls take about 800-1500ms, and the expected hit rate for common queries is 60%+.
- When MONID_API_KEY is set, Scholar/AAP search and PMC HTML scraping go through Monid TinyFish; without a key, Scholar falls back to the Semantic Scholar API(free, well-structured, 100 requests/sec, no API key required).
- The optional NCBI_API_KEY environment variable can increase PubMed from 3 requests/sec to 10 requests/sec.
- Tech stack: Node.js, TypeScript, MCP SDK; dependencies @modelcontextprotocol/sdk, superagent, zod, express, cors; platforms macOS, Windows, Linux.
- Security and privacy: listens only on localhost, the server runs locally with no external access; stores no data, all queries are performed in real time and nothing is written to disk; process isolation keeps medical data on the local machine; no API key required (NCBI and Monid keys are optional).
- License: MIT License, see LICENSE.md for details.