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

openfda-mcp-server

v1.1.0

Published

MCP server for querying U.S. FDA public datasets - drugs, devices, adverse events, recalls, and more

Readme

OpenFDA MCP Server

An MCP (Model Context Protocol) server that provides access to U.S. FDA public datasets including drugs, medical devices, adverse events, recalls, and more.

Features

  • 10 FDA Tools: Query drug and device databases through a standardized MCP interface
  • Drug Tools: Adverse events (FAERS), labels, NDC directory, recalls, Drugs@FDA, shortages
  • Device Tools: 510(k) clearances, classifications, adverse events (MDR), recalls
  • Individual Record Lookup: Retrieve specific reports by ID (safety report ID, set ID, MDR report number)
  • Advanced Filtering: Filter drug labels by boxed warnings, request specific label sections
  • Rate Limit Aware: Supports authenticated requests for higher rate limits (120k/hour vs 1k/hour)
  • TypeScript: Fully typed with Zod schema validation

Installation

# Install globally
npm install -g openfda-mcp-server

# Or use with npx
npx openfda-mcp-server

Configuration

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "openfda": {
      "command": "npx",
      "args": ["-y", "openfda-mcp-server"],
      "env": {
        "OPENFDA_API_KEY": "your-api-key-optional"
      }
    }
  }
}

Environment Variables

| Variable | Description | Default | | ----------------- | ---------------------------------- | ------------------------- | | OPENFDA_API_KEY | FDA API key for higher rate limits | None (uses public limits) |

Get a free API key at: https://open.fda.gov/apis/authentication/

Available Tools

Drug Tools

| Tool | Description | | ---------------------------- | ------------------------------------------------------------------------------------------------------ | | search_drug_adverse_events | Search FAERS for drug safety reports. Retrieve specific report by safetyReportId. | | search_drug_labels | Search drug labeling/prescribing info. Get by setId, filter by hasBoxedWarning, select sections. | | search_drug_ndc | Search the National Drug Code directory | | search_drug_recalls | Search drug recall enforcement reports | | search_drugs_at_fda | Search approved drug applications | | search_drug_shortages | Search current and resolved drug shortages |

Device Tools

| Tool | Description | | ------------------------------- | ----------------------------------------------------------------------------- | | search_device_510k | Search 510(k) premarket notifications | | search_device_classifications | Search device classification database | | search_device_adverse_events | Search MDR adverse event reports. Retrieve specific report by reportNumber. | | search_device_recalls | Search device recall enforcement reports |

Tool Parameters

search_drug_labels

| Parameter | Type | Description | | ------------------ | -------- | ------------------------------------------------------------ | | setId | string | Retrieve a specific label by its unique set_id | | drugName | string | Drug brand or generic name | | indication | string | Medical indication or use case | | activeIngredient | string | Active ingredient/substance name | | route | string | Route of administration (e.g., 'oral', 'intravenous') | | hasBoxedWarning | boolean | Filter for drugs with boxed warnings (most serious warnings) | | sections | string[] | Specific label sections to return (see below) | | limit | number | Maximum results (1-100) | | skip | number | Number of results to skip for pagination |

Available sections: indications_and_usage, dosage_and_administration, contraindications, warnings, warnings_and_cautions, adverse_reactions, drug_interactions, clinical_pharmacology, mechanism_of_action, pharmacokinetics, overdosage, description, how_supplied, storage_and_handling, boxed_warning

search_drug_adverse_events

| Parameter | Type | Description | | ---------------- | ------- | -------------------------------------------------- | | safetyReportId | string | Retrieve a specific FAERS report by its 8-digit ID | | drugName | string | Drug or product name to search | | reaction | string | Adverse reaction (e.g., 'headache', 'nausea') | | manufacturer | string | Drug manufacturer name | | serious | boolean | Filter for serious adverse events only | | dateFrom | string | Start date (YYYY-MM-DD) | | dateTo | string | End date (YYYY-MM-DD) | | limit | number | Maximum results (1-100) | | skip | number | Number of results to skip for pagination |

search_device_adverse_events

| Parameter | Type | Description | | ------------------ | ------ | ----------------------------------------------- | | reportNumber | string | Retrieve a specific MDR report by report number | | deviceName | string | Device generic name | | brandName | string | Device brand name | | manufacturerName | string | Device manufacturer name | | eventType | string | Type: 'Injury', 'Malfunction', 'Death', 'Other' | | dateFrom | string | Start date (YYYY-MM-DD) | | dateTo | string | End date (YYYY-MM-DD) | | limit | number | Maximum results (1-100) | | skip | number | Number of results to skip for pagination |

Usage Examples

Search for drug adverse events

Find adverse events for aspirin in the last year that were serious

Get a specific adverse event report

Retrieve FAERS report with safety report ID 10003641

Search for drugs with boxed warnings

Find all drugs with boxed warnings related to cardiovascular risks

Get specific label sections

Get the boxed_warning and contraindications sections for warfarin

Search for drug recalls

Search for Class I drug recalls from Pfizer

Search for device clearances

Find 510(k) clearances for cardiac pacemakers

Get a specific device adverse event report

Retrieve MDR report number 2649622-2020-08294

Search for device adverse events

Search device adverse events for insulin pumps that resulted in injury

CLI Usage

# Start with stdio transport (default)
openfda-mcp-server

# Start with HTTP transport
openfda-mcp-server --transport http --port 3000

Docker

Quick Start

# Build and run with docker-compose
docker-compose up -d

# Or build manually
docker build -t openfda-mcp-server .
docker run -p 3000:3000 -e OPENFDA_API_KEY=your-key openfda-mcp-server

Docker Compose

services:
  openfda-mcp:
    image: openfda-mcp-server:latest
    ports:
      - "3000:3000"
    environment:
      - OPENFDA_API_KEY=${OPENFDA_API_KEY:-}

Environment Variables

Pass environment variables to the container:

docker run -p 3000:3000 \
  -e OPENFDA_API_KEY=your-api-key \
  -e DEBUG=openfda-mcp:* \
  openfda-mcp-server

Development

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Test locally
pnpm serve:test

# Run full validation (format, lint, test, build)
pnpm validate

# Build for production
pnpm build

Programmatic Usage

import { createOpenFDAServer, handleSearchDrugAdverseEvents, handleSearchDrugLabels } from "openfda-mcp-server/lib"

// Create a custom server
const server = createOpenFDAServer({
  name: "my-fda-server",
  version: "1.0.0",
})

// Search for adverse events
const adverseEvents = await handleSearchDrugAdverseEvents({
  drugName: "aspirin",
  serious: true,
  limit: 10,
})

// Get a specific adverse event by ID
const specificReport = await handleSearchDrugAdverseEvents({
  safetyReportId: "10003641",
})

// Search for drugs with boxed warnings
const boxedWarningDrugs = await handleSearchDrugLabels({
  hasBoxedWarning: true,
  limit: 10,
})

// Get specific sections of a drug label
const warfarinLabel = await handleSearchDrugLabels({
  setId: "0cbce382-9c88-4f58-ae0f-532a841e8f95",
  sections: ["boxed_warning", "contraindications", "adverse_reactions"],
})

API Rate Limits

| Authentication | Per Minute | Per Hour | | --------------- | ---------- | -------- | | Without API Key | 40 | 1,000 | | With API Key | 240 | 120,000 |

License

MIT

Acknowledgments


Sponsored by SapientsAI — Building agentic AI for businesses