Pharma MCP
This MCP server gives AI assistants FDA drug safety data and ClinicalTrials.gov research tools.
Search FDA drug labels by brand or generic name for boxed warnings, indications, contraindications, warnings, adverse reactions, and DailyMed links.
Retrieve the most reported FAERS adverse events for a drug, with counts and optional serious-only filtering.
Run pharmacovigilance signal checks for drug–reaction pairs, including PRR, ROR, 95% CIs, Yates chi-squared, and Evans criteria.
Look up FDA drug recalls with classification, reason, status, firm, and dates.
Search ClinicalTrials.gov trials by condition, intervention, sponsor, status, and phase.
Get full trial details by NCT ID, including summary, eligibility, primary outcomes, enrollment, sponsor, and status.
Use the
drug_safety_briefprompt to combine all six tools into a sourced one-page safety brief.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pharma MCP is pancreatitis disproportionately reported for semaglutide?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
⚡ Overview
Ask your assistant "What are the most reported adverse events for semaglutide, and is pancreatitis disproportionately reported?" or "Find recruiting phase 3 trials for type 2 diabetes sponsored by Novo Nordisk". It calls these tools, and every answer links back to the FDA or ClinicalTrials.gov source.
Tools
Tool | Source | What it returns |
| openFDA drug labels | Boxed warning, indications, contraindications, warnings, adverse reactions (trimmed), DailyMed link |
| openFDA FAERS | Most reported reactions with counts and share of reports, optionally serious-only |
| openFDA FAERS | PRR and ROR with 95% CIs, Yates chi-squared and the Evans signal flag for a drug–reaction pair |
| openFDA enforcement | Recalls with Class I/II/III, reason, status, firm, dates |
| ClinicalTrials.gov v2 | Trials by condition, intervention or sponsor, filtered by status and phase |
| ClinicalTrials.gov v2 | Summary, eligibility criteria, primary outcomes, enrollment, sponsor |
There's also a prompt, drug_safety_brief, that has the assistant combine all six into a
one-page safety brief with sources and limitations.
How signal_check works
From four FAERS counts (drug and reaction, drug, reaction, all reports) it builds the 2×2 table
reaction | other reactions | |
drug | a | b |
other drugs | c | d |
and computes PRR = [a/(a+b)] / [c/(c+d)] and ROR = ad/bc, with log-normal 95% confidence
intervals and a Yates-corrected chi-squared. A pair is flagged when PRR ≥ 2, χ² ≥ 4 and at
least 3 cases (Evans et al., 2001), the screening rule used in pharmacovigilance practice.
When a reaction is reported only for this drug (a zero cell), PRR and ROR use the
Haldane-Anscombe correction (+0.5 per cell), so it can still be flagged. Reactions are
matched as exact MedDRA terms, the same terms get_adverse_events lists.
FAERS holds voluntary reports. A signal is a statistical association that deserves review, not proof that the drug causes the event. The server's instructions tell the assistant to present results that way and never as medical advice.
Related MCP server: Healthcare Compliance MCP
Install
With any MCP-compatible client (desktop assistants, IDE agents), add this to the client's MCP server config:
{
"mcpServers": {
"pharma": {
"command": "uvx",
"args": ["--from", "git+https://github.com/faizanreza-cs/pharma-mcp", "pharma-mcp"],
"env": { "OPENFDA_API_KEY": "optional-your-key" }
}
}
}Or run it yourself:
git clone https://github.com/faizanreza-cs/pharma-mcp && cd pharma-mcp
make setup
make run # stdio
make http # streamable HTTP at http://127.0.0.1:8000/mcp
make inspect # MCP Inspector (needs Node)An openFDA API key is optional but raises the limits from 1,000 to 120,000 requests per day. Get one free at https://open.fda.gov/apis/authentication/.
Built for real use
Polite to public APIs: responses are cached for an hour, requests are spaced out, and 429 and 5xx responses are retried with backoff, honouring
Retry-After.Doesn't fail on "no results": openFDA answers 404 when nothing matches, and the server returns an empty list instead of an error.
Validated inputs: NCT id format, trial status and phase enums, empty search terms. Bad input returns a clear error message to the model, not an exception.
Compact outputs: long label sections are trimmed so they don't flood the context window.
Tests: 21, all offline. Signal math is checked against hand-computed values, including zero-cell cases. Every tool is exercised end to end through a real MCP client against mocked HTTP. Retries,
Retry-Afterparsing, caching and query escaping are covered. CI runs on Python 3.11 to 3.13, plus a Docker build and handshake check.
The test fixtures are hand-made samples in the documented response shapes, not real data
(see tests/fixtures/README.md).
License
MIT. Not affiliated with the FDA or NIH. Data come from public APIs and are provided as-is.
Available Tools
6 toolsdrug_recallsA
Recent FDA drug recalls (enforcement reports) matching a drug name, with classification (Class I is most serious), reason and status.
Inputs: drug (required), limit. Returns: object
get_adverse_eventsB
Most frequently reported adverse reactions for a drug in FAERS (FDA Adverse Event Reporting System), with report counts. Optionally only serious reports.
Inputs: drug (required), limit, serious_only. Returns: object
get_trialA
Full details of one clinical trial by NCT id: summary, eligibility criteria, primary outcomes, enrollment, sponsor and status.
Inputs: nct_id (required). Returns: object
search_drug_labelsA
Search FDA drug labels (package inserts) by brand or generic name. Returns boxed warning, indications, contraindications, warnings and adverse reactions sections, trimmed, with a DailyMed link.
Inputs: drug (required), limit. Returns: object
search_trialsB
Search ClinicalTrials.gov by condition, intervention and/or sponsor. Filter by status (e.g. RECRUITING, COMPLETED) and phase (PHASE1, PHASE2, PHASE3, PHASE4). Returns NCT id, title, phase, enrollment, dates, sponsor.
Inputs: limit, phase, status, sponsor, +2 more. Returns: object
signal_checkA
Pharmacovigilance signal check for a drug-reaction pair in FAERS: proportional reporting ratio (PRR) and reporting odds ratio (ROR) with 95% confidence intervals, Yates chi-squared, and whether it meets the Evans signal criteria. Use MedDRA preferred terms, e.g. 'PANCREATITIS'.
Inputs: drug (required), reaction (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct information need: drug label lookup, FAERS adverse event frequencies, pharmacovigilance signal statistics, recalls, trial search, and trial detail. The only near-overlap is search_trials vs get_trial and get_adverse_events vs signal_check, but the descriptions clearly separate search/detail and frequency/signal-analysis purposes.
All names use snake_case and most follow a verb_noun pattern, such as search_drug_labels, get_adverse_events, search_trials, and get_trial. Two names, signal_check and drug_recalls, deviate into noun-oriented phrasing, but the overall convention remains readable and predictable.
Six tools is well-scoped for a focused pharma safety and clinical trials server. Each tool covers a distinct resource or analysis operation, with no obvious filler tools.
The server covers drug labels, adverse events, signal detection, recalls, and clinical trial search/detail, which is strong lifecycle coverage for its apparent purpose. Minor gaps include drug-drug interactions and regulatory/approval lookup, but agents can work around these for most pharmacovigilance workflows.
Maintenance
Related MCP Connectors
FDA drug data via openFDA: adverse-event reports and safety-signal tools (FAERS search, event…
Test healthcare AI agents' medication claims against cited FDA label text. Not for clinical use.
Supplement safety for AI agents. 1,500+ rules, NIH+FDA data, quality grading A-D.
Official FDA recalls, drug labels, adverse events and clinical trials, with cited sources.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and analyze FDA adverse events, drug labels, medical device clearances, and other public health datasets through natural language commands.14-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access FDA and ClinicalTrials.gov data for medical device compliance, adverse event monitoring, and regulatory due diligence.-
- AlicenseAqualityDmaintenanceEnables LLMs to search FDA drug labels and adverse event data via the OpenFDA API, supporting natural language queries for drug safety information.2MIT
- AlicenseAqualityDmaintenanceEnables querying FDA drug label information including adverse reactions, warnings, and indications via natural language.510 npm1GPL 3.0