npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-openfda

v0.1.0

Published

MCP server for openFDA — drug adverse events, labels, recalls, device safety reports. No API key required (optional for higher rate limits).

Readme

mcp-openfda

An MCP (Model Context Protocol) server that gives LLMs direct access to openFDA — search drug adverse events, labels, recalls, and device safety reports.

No API key required. An optional key increases rate limits from 40 to 240 requests/minute.

Quick Start

Add to your MCP client config (Claude Code, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "openfda": {
      "command": "npx",
      "args": ["-y", "mcp-openfda"]
    }
  }
}

That's it. No configuration needed.

Tools

Drug Safety

| Tool | Description | |------|-------------| | drug_adverse_events | Search FAERS adverse event reports by drug name, reaction, seriousness, indication, and date range | | drug_labels | Search FDA-approved labeling (SPL) — indications, warnings, dosing, adverse reactions, drug interactions | | drug_enforcement | Search drug recalls and enforcement actions by drug, firm, classification, and status |

Device Safety

| Tool | Description | |------|-------------| | device_adverse_events | Search Medical Device Reports (MDR) by device name, event type (Death/Injury/Malfunction), and date range |

Aggregation

| Tool | Description | |------|-------------| | openfda_count | Aggregate top values for any field across any endpoint — e.g. top reactions for a drug, top recalled firms |

Example Prompts

Once connected, you can ask your LLM:

  • "What adverse events have been reported for Ozempic?"
  • "Show me the warnings section from the Keytruda label"
  • "Find Class I drug recalls in the last 6 months"
  • "What are the top 10 adverse reactions reported for metformin?"
  • "Search for device malfunction reports for insulin pumps"
  • "Compare adverse event profiles between Ozempic and Mounjaro"
  • "Has there been any recall activity for Novo Nordisk products?"

Typical Workflow

1. drug_adverse_events  → Find safety signals for a drug
2. drug_labels          → Check label warnings and contraindications
3. openfda_count        → Aggregate top reactions or compare drugs
4. drug_enforcement     → Check recall history
5. device_adverse_events → Review device safety for related devices

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | OPENFDA_API_KEY | (none) | Optional. Get one free at open.fda.gov. Increases rate limit from 40 to 240 req/min. |

Rate Limiting

The server includes a built-in token-bucket rate limiter:

  • With API key: 4 requests/second (240/min)
  • Without API key: 0.6 requests/second (40/min)
  • Automatic retry on 429 (rate limit exceeded) with 2-second backoff

Development

git clone https://github.com/cmanohar/mcp-openfda.git
cd mcp-openfda
npm install
npm run build
node dist/index.js  # runs on stdio

How It Works

This server wraps four openFDA API endpoints:

  • Drug Adverse Events (/drug/event.json) — FAERS reports
  • Drug Labels (/drug/label.json) — SPL/package inserts
  • Drug Enforcement (/drug/enforcement.json) — recalls and enforcement actions
  • Device Adverse Events (/device/event.json) — MDR reports

All endpoints support a count parameter for field-level aggregation, exposed via the openfda_count tool.

License

MIT