OpenFDA MCP Server
This server exposes 15 MCP tools for querying U.S. FDA public datasets—drugs, devices, recalls, adverse events, and regulatory listings like the Orange and Purple Books—with filtering, pagination, and individual record lookup.
Drug safety & labeling: search FAERS adverse events (by drug, reaction, manufacturer, seriousness, date; or
safetyReportId), and drug labels/SPL (bysetId, drug/ingredient/route,hasBoxedWarning, selectedsections).Drug product data: NDC directory (NDC, brand/generic name, labeler, dosage form, route), Drugs@FDA approved applications, and current/resolved drug shortages.
Device data: 510(k) clearances, device classifications (Class 1–3), MDR adverse events (by device, brand, manufacturer, event type, date, or
reportNumber), and device recalls.Recalls: drug and device enforcement reports filtered by firm, classification (I–III), status, state, and date range.
Orange Book: approved products with therapeutic equivalence codes plus patent listings (expiry, substance/product/use flags).
Purple Book: licensed biologics with BLA number, 351(a)/351(k) license type, biosimilar and interchangeability filters.
Patent expiry view: unified Orange Book (optionally Purple Book) patents sorted by earliest expiry with exclusivity data.
Server introspection: an
infotool reporting name, version, build, runtime, and capability counts.Common controls: all search tools support
limit(1–100) andskippagination; truncated label/section text is flagged and can be returned in full where supported.
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., "@OpenFDA MCP Server search for adverse events of aspirin"
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.
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
Related MCP server: OpenFDA MCP Server
Installation
# Install globally
npm install -g openfda-mcp-server
# Or use with npx
npx openfda-mcp-serverConfiguration
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 |
| 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 FAERS for drug safety reports. Retrieve specific report by |
| Search drug labeling/prescribing info. Get by |
| Search the National Drug Code directory |
| Search drug recall enforcement reports |
| Search approved drug applications |
| Search current and resolved drug shortages |
Device Tools
Tool | Description |
| Search 510(k) premarket notifications |
| Search device classification database |
| Search MDR adverse event reports. Retrieve specific report by |
| Search device recall enforcement reports |
Built-in Tools
Tool | Description |
| Server name, version, build and capability counts. Registered automatically by SomaMCP. |
Tool Parameters
search_drug_labels
Parameter | Type | Description |
| string | Retrieve a specific label by its unique set_id |
| string | Drug brand or generic name (matches either) |
| string | Medical indication or use case |
| string | Active ingredient/substance name |
| string | Route of administration (e.g., 'oral', 'intravenous') |
| boolean | Filter for drugs with boxed warnings (most serious warnings) |
| string[] | Specific label sections to return (see below) |
| boolean | Return section text in full (see below) |
| number | Maximum results (1-100) |
| 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
Sections are cut at 200 characters (the boxed warning at 500), and each label's truncated lists the ones that were cut. Set fullText: true to get them whole; full sections can be long, so pair it with sections. Drug and device recalls, shortages and device classifications mark cut text the same way. Each device MDR text has its own truncated flag, true when it was cut at 300 characters.
search_drug_adverse_events
Parameter | Type | Description |
| string | Retrieve a specific FAERS report by its 8-digit ID |
| string | Drug or product name to search |
| string | Adverse reaction (e.g., 'headache', 'nausea') |
| string | Drug manufacturer name |
| boolean | Filter for serious adverse events only |
| string | Start date (YYYY-MM-DD) |
| string | End date (YYYY-MM-DD) |
| number | Maximum results (1-100) |
| number | Number of results to skip for pagination |
search_device_adverse_events
Parameter | Type | Description |
| string | Retrieve a specific MDR report by report number |
| string | Device generic name |
| string | Device brand name |
| string | Device manufacturer name |
| string | Type: 'Injury', 'Malfunction', 'Death', 'Other' |
| string | Start date (YYYY-MM-DD) |
| string | End date (YYYY-MM-DD) |
| number | Maximum results (1-100) |
| 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 seriousGet a specific adverse event report
Retrieve FAERS report with safety report ID 10003641Search for drugs with boxed warnings
Find all drugs with boxed warnings related to cardiovascular risksGet specific label sections
Get the boxed_warning and contraindications sections for warfarinSearch for drug recalls
Search for Class I drug recalls from PfizerSearch for device clearances
Find 510(k) clearances for cardiac pacemakersGet a specific device adverse event report
Retrieve MDR report number 2649622-2020-08294Search for device adverse events
Search device adverse events for insulin pumps that resulted in injuryCLI Usage
# Start with stdio transport (default)
openfda-mcp-server
# Start with HTTP transport
openfda-mcp-server --transport http --port 3000Docker
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-serverDocker 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-serverDevelopment
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Test locally
pnpm serve:test
# Run full validation (format, lint, test, build)
pnpm validate
# What CI runs: the same steps, checking format and lint without fixing them
pnpm run ci
# Build for production
pnpm buildServing the Tools from a Worker
openfda-mcp-server/tools registers the 14 tools on a somamcp server without anything Node-only, so it runs on Cloudflare Workers without nodejs_compat. A hosted server can send each caller's own openFDA key: client gets the call's session and returns a client made for that call.
import { createServer, getRequestHeader } from "somamcp"
import { createFDAAPIClient, registerOpenFDATools, VERSION } from "openfda-mcp-server/tools"
type Env = { OPENFDA_API_KEY: string }
const serverFor = (env: Env) => {
const server = createServer<{ apiKey?: string }>({
authenticate: async (request) => ({ apiKey: getRequestHeader(request, "x-openfda-api-key")?.trim() || undefined }),
name: "openfda",
version: VERSION, // the installed openfda-mcp-server version
})
registerOpenFDATools(server, {
// The caller's own key, else the server's.
client: (session) => createFDAAPIClient({ apiKey: session?.apiKey ?? env.OPENFDA_API_KEY }),
})
return server
}
export default { fetch: (request: Request, env: Env) => serverFor(env).fetch(request) }Build a client per call, never one shared and changed: one Worker serves many callers at once. Import everything from openfda-mcp-server/tools: openfda-mcp-server/lib also loads the Node-only server. Without client, the tools use one client that reads OPENFDA_API_KEY from process.env, as the CLI does. A Worker has no process, so that client sends no key: pass client there. Build the server once per isolate in real code rather than per request.
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
From https://open.fda.gov/apis/authentication/:
Authentication | Per Minute | Per Day | Counted per |
Without API Key | 240 | 1,000 | IP address |
With API Key | 240 | 120,000 | key |
License
MIT
Acknowledgments
OpenFDA - FDA open data API
Sponsored by SapientsAI — Building agentic AI for businesses
Available Tools
15 toolsinfoARead-only
Returns identity and build information for this server (name, version, build commit, runtime, capability counts)
Inputs: no named parameters.
search_device_510kB
Search FDA 510(k) premarket notification database for medical device clearances. Find device clearances by device name, applicant, product code, clearance type, or decision date. Returns clearance decisions and device classification details.
Inputs: skip, limit, applicant, deviceName, +4 more.
search_device_adverse_eventsA
Search FDA Medical Device Report (MDR) database for device adverse events. Find adverse events by device name, brand, manufacturer, event type (Injury/Death/Malfunction), and date. Retrieve a specific MDR report by reportNumber. Returns device details, event descriptions, and patient outcomes.
Inputs: skip, limit, dateTo, dateFrom, +5 more.
search_device_classificationsA
Search FDA medical device classification database. Find devices by name, class (1-3), medical specialty, product code, or regulation number. Class 1 is lowest risk, Class 3 is highest risk (implants, life-sustaining).
Inputs: skip, limit, deviceName, deviceClass, +3 more.
search_device_recallsA
Search FDA medical device recall and enforcement reports. Find recalls by company, product description, classification (I-III), status, and date. Class I is most serious (may cause death), Class III is least serious.
Inputs: skip, limit, dateTo, status, +4 more.
search_drug_adverse_eventsA
Search FDA Adverse Event Reporting System (FAERS) for drug safety reports. Find adverse events by drug name, reaction type, manufacturer, date range, and seriousness. Retrieve a specific report by safetyReportId. Returns patient demographics, drug details, and reported reactions.
Inputs: skip, limit, dateTo, serious, +5 more.
search_drug_labelsA
Search FDA drug labeling (SPL) information including prescribing information, indications, warnings, boxed warnings, dosage, and active ingredients. Retrieve a specific label by setId. Filter for drugs with boxed warnings using hasBoxedWarning. Request specific sections (e.g., indications_and_usage, adverse_reactions, boxed_warning) to limit response.
Inputs: skip, limit, route, setId, +6 more.
search_drug_ndcA
Search the National Drug Code (NDC) Directory for drug product identification. Find drugs by NDC, brand name, generic name, labeler, dosage form, or route. Returns product details, active ingredients, and packaging information.
Inputs: skip, limit, route, brandName, +4 more.
search_drug_recallsB
Search FDA drug recall and enforcement reports. Find recalls by company, classification (I-III), status, state, and date range. Class I is most serious (may cause death), Class III is least serious.
Inputs: skip, limit, state, dateTo, +4 more.
search_drugs_at_fdaA
Search the Drugs@FDA database for approved drug applications. Find approved drugs by sponsor, application number, brand name, or marketing status. Returns application details, products, and submission history.
Inputs: skip, limit, brandName, sponsorName, +2 more.
search_drug_shortagesA
Search the FDA Drug Shortage Database for current and resolved drug shortages. Find shortages by generic drug name or status (Current/Resolved). Returns shortage details, posting dates, and resolution information.
Inputs: skip, limit, status, genericName.
search_fda_drug_patent_expiryA
Unified patent expiry and exclusivity view across FDA Orange Book and optionally Purple Book. Search by drug name or application number. Returns patents sorted by earliest expiry date with associated exclusivity data. Set includePurpleBook=true to also include biologics data.
Inputs: skip, limit, applNo, drugName, +2 more.
search_fda_orange_bookA
Search FDA Orange Book for approved drug products with therapeutic equivalence evaluations. Find drugs by trade name, ingredient, applicant, application number, or TE code. Returns product details, patent counts, and exclusivity counts. Data is downloaded from FDA bulk files and cached for 24 hours.
Inputs: skip, limit, applNo, teCode, +2 more.
search_fda_orange_book_patentsA
Search FDA Orange Book patent data for drug products. Find patents by drug name, application number, or patent number. Returns patent details including expiry dates, substance/product/use flags, and associated exclusivities.
Inputs: skip, limit, applNo, drugName, +1 more.
search_fda_purple_bookA
Search FDA Purple Book for licensed biological products. Find biologics by product name, applicant, BLA number, license type (351(a)/351(k)), biosimilar status, or interchangeability. Returns product details, licensing status, and reference product information.
Inputs: skip, limit, applicant, blaNumber, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool maps to a distinct FDA dataset (labels, adverse events, NDC, 510(k), MDR, shortages, Purple Book), so selection is mostly clear. The only real overlap is search_fda_orange_book vs search_fda_orange_book_patents vs search_fda_drug_patent_expiry, where the unified patent-expiry view partially duplicates the other two — descriptions mitigate but don't erase this.
Nearly all tools follow a search_<domain>_<resource> snake_case pattern (search_drug_labels, search_device_510k, search_fda_purple_book). Minor deviations exist: bare 'info' and 'search_drugs_at_fda' (plural) break the pattern, and the prefix ordering alternates between drug-first, device-first, and fda-first.
Fifteen tools is well within a reasonable range and each corresponds to a real, distinct OpenFDA endpoint. Nothing feels padded — the count is justified by the breadth of FDA datasets (drugs, devices, biologics, patents).
Strong coverage of drugs, devices, biologics, patents, recalls, and adverse events with both search and retrieve-by-ID paths. Gaps remain: no food/dietary-supplement/cosmetic/tobacco endpoints that OpenFDA offers, and no generic cross-endpoint query, but core drug/device workflows are covered.
Maintenance
Related MCP Connectors
FDA MCP — US Food and Drug Administration public API (free, no auth)
NIH clinical trials and FDA adverse event reports. 4 MCP tools for health research.
Adverse events, drug recalls, labels, 510(k), as one MCP tool through Apify
Hosted MCP server for finding authoritative primary data sources and official portals.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server that provides comprehensive medical information by querying multiple authoritative medical APIs including FDA, WHO, PubMed, Google Scholar, and RxNorm.1174 npm122MIT
- FlicenseBqualityDmaintenanceA comprehensive MCP server that provides access to U.S. FDA public datasets via the openFDA API, enabling querying of drug adverse events, labeling, recalls, approvals, shortages, NDC directory, and medical device regulatory data.1026-
- AlicenseNot gradedqualityDmaintenanceMCP server for clinical and pharmaceutical data, enabling search of ClinicalTrials.gov, PubMed, FDA, and ICH guidelines without API keys.MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to query U.S. FDA public datasets, including drug adverse events, labeling, recalls, approvals, shortages, NDC directory, and medical device regulatory information.10MIT