Skip to main content
Glama

CI Python MCP License Website

LinkedIn X

⚡ 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

search_drug_labels

openFDA drug labels

Boxed warning, indications, contraindications, warnings, adverse reactions (trimmed), DailyMed link

get_adverse_events

openFDA FAERS

Most reported reactions with counts and share of reports, optionally serious-only

signal_check

openFDA FAERS

PRR and ROR with 95% CIs, Yates chi-squared and the Evans signal flag for a drug–reaction pair

drug_recalls

openFDA enforcement

Recalls with Class I/II/III, reason, status, firm, dates

search_trials

ClinicalTrials.gov v2

Trials by condition, intervention or sponsor, filtered by status and phase

get_trial

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-After parsing, 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 tools
drug_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

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers