com.blackswancausallabs/openfda-mcp
OfficialThis server provides MCP tools to query FDA regulatory metadata for drugs, biologics, and medical devices via openFDA, focusing on identifier resolution and real-world evidence research.
Drugs & Biologics
search_drug_label: Full-text search of label text, with optional scoping to a specific section and pagination.lookup_drugsfda_application: Fetch Drugs@FDA metadata for a given NDA/BLA/ANDA number (prefix required, e.g., BLA761180).resolve_drug_to_application: Convert a brand/generic name to application number(s), searching brand and generic name fields directly.screen_for_rwe_signals(experimental): Sweeps labels for registry/real-world evidence terms, returning snippets for human review.
Medical Devices
lookup_device_submission: Retrieves CDRH device records by submission number, covering 510(k) (K), De Novo (DEN, via the 510(k) endpoint), PMA (P), and HDE (H) pathways, with supplement suffix handling.classify_device_product_code: Resolves a 3-letter product code to device class and medical specialty.validate_device_application: Chains the above two to return class, specialty, and category in one call.
General
Distinguishes not-found (returns None) from transient errors (retries then raises) for reliable automation.
Optionally accepts an API key for higher rate limits.
Handles openFDA quirks, like De Novo grants in the 510(k) endpoint and missing HDE number info.
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., "@com.blackswancausallabs/openfda-mcp Resolve device submission K203571 to its FDA classification"
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
An MCP server exposing FDA regulatory metadata (drugs, biologics, and medical devices) through the openFDA API.
Built by Black Swan Causal Labs as the identifier-resolution layer for a real-world-evidence (RWE) case roster: given an FDA application number or a product name, resolve it to authoritative regulatory metadata.
Why this exists
There are other openFDA MCP servers, and several are broader. This one is narrow on purpose: it is the instrument that resolved the application numbers in a specific published RWE dataset, and it exists so that dataset can name the tool that produced it.
That matters more than it might sound. Whether BLA 125123/2058 resolves to a
particular product, or DEN160026 to a particular device class, is a decision
made by a piece of software — and a different wrapper can yield a different
roster. "We used openFDA" is not a sufficient methods statement; "openfda-mcp
v0.1.0" is. If you use this in research, pin the version.
Its practical edge over a general openFDA client is the device half: resolving a CDRH submission number to a risk class takes a three-hop chain (number → product code → classification) with two non-obvious traps, both handled here.
Related MCP server: openfda-mcp-server
Tools
Drugs and biologics (/drug/* — CDER, CBER)
Tool | Purpose |
| Search SPL label text, optionally scoped to a section |
| Drugs@FDA record for an NDA/BLA/ANDA number |
| Brand or generic name → application number(s) |
| Experimental. Sweep labels for RWE signals |
Devices (/device/* — CDRH)
Tool | Purpose |
| K / DEN / P / H number → device record |
| Product code → device class + medical specialty |
| Full chain: number → class, specialty, category |
Install
pip install openfda-mcpAdd to your MCP client config:
{
"mcpServers": {
"openfda": {
"command": "openfda-mcp",
"env": { "OPENFDA_API_KEY": "${OPENFDA_API_KEY:-}" }
}
}
}The API key is optional. Without one, openFDA allows 40 requests/min and 1,000/day, which is enough for interactive use. A free key raises it to 240/min and 120,000/day — worth having for bulk sweeps.
Two findings worth knowing
Both were established empirically and are not obvious from FDA's docs.
De Novo grants live in the 510(k) endpoint. DEN###### numbers are stored
in the k_number field of /device/510k. There is no De Novo endpoint, and
looking for one leads to the wrong conclusion that De Novo numbers can't be
resolved. They can.
HDE numbers are not in openFDA at all. Neither the 510(k) nor the PMA
endpoint carries H######, so no product code — and therefore no classification
— is retrievable. This server still reports device_class: "III" for them, by
regulatory inference: HDE is by definition the pathway for devices that would
otherwise require a PMA. medical_specialty stays null, because that one really
is unavailable, and device_class_source says which is which.
Transient failures are never silent
A genuine absence and a failed request are different things, and this package keeps them different:
not found (HTTP 404, or 200 with no results) → returns
None; safe to cachetransient failure (timeout, connection error, 429, 5xx) → retried with backoff, then raises
OpenFDATransientError; never cache thisrejected request (other 4xx) → raises
OpenFDARequestError
This is a direct response to a real defect: an earlier version swallowed every
exception and returned None, so a single read timeout on one application
number was cached as a real miss and silently blanked two fields on that record
for weeks. Cached failures are indistinguishable from real absences, which makes
them the worst kind of silent data loss.
On screen_for_rwe_signals
It is unvalidated. There is no ground-truth oracle for a discovery sweep, and below the strongest hits the results are dominated by applications whose labels use "registry" in an unrelated sense. Treat its output as candidates for human review — not as a finding, and not as a count to report. Establishing recall against a held-out set of known cases is open work.
Development
pip install -e ".[dev]"
pytest # unit tests, offline
pytest -m live # live checks against api.fda.govLive tests assert against known-good fixtures (K203571 → class II Ophthalmic,
DEN160026 → class II Immunology, BLA761180 → LEO Pharma) so a change on
FDA's side surfaces as a test failure rather than as quietly wrong data.
License
MIT
Available Tools
7 toolsclassify_device_product_codeB
Resolve a CDRH product code to its device class and medical specialty.
Inputs: product_code (required). Returns: object
lookup_device_submissionA
Look up a CDRH device submission by its number.
Handles all four device pathways: 510(k) K-numbers ("K203571"), De Novo grants ("DEN160026" — stored in the 510(k) endpoint, not a separate one), PMA P-numbers ("P230044"), and HDE H-numbers. Supplement suffixes ("P230044/S001") are stripped before lookup.
Inputs: number (required). Returns: object
lookup_drugsfda_applicationB
Fetch Drugs@FDA application metadata for an NDA/BLA/ANDA number.
Inputs: application_number (required). Returns: object
resolve_drug_to_applicationA
Resolve a brand or generic drug name to its NDA/BLA application number(s).
Bridges drug-name-only sources (registry inventories, product lists) to FDA regulatory metadata. Searches the brand and generic name fields directly rather than label prose, so another product merely mentioning this drug does not produce a false match.
Inputs: drug_name (required), limit. Returns: object
screen_for_rwe_signalsA
EXPERIMENTAL. Sweep drug labels for registry / real-world-evidence signals.
Searches the label corpus for terms suggesting registry, natural-history or other real-world evidence, then aggregates hits by application number with snippets showing where each term matched.
This tool is unvalidated and has a known false-positive problem. It has no ground-truth oracle, and below the strongest hits the results are dominated by applications whose labels use "registry" in an unrelated sense. Its output is a candidate list for human review — not a finding, and not a count you should report.
Inputs: extra_terms, limit_per_term. Returns: result
search_drug_labelB
Search openFDA drug labels (SPL) for a term.
Inputs: term (required), skip, limit, section. Returns: object
validate_device_applicationA
Validate a device number and derive class, specialty and category in one call.
Chains lookup_device_submission -> classify_device_product_code, which is the full three-hop resolution: number -> product_code -> classification.
Inputs: number (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 7 tools
Each tool targets a distinct resource/action: drug label search, application metadata lookup, name-to-application resolution, RWE signal screening, device submission lookup, product code classification, and full validation. The drug and device groups are clearly separated, and descriptions clarify any potential overlap (e.g., validate_device_application explicitly chains the other two device tools).
All tool names follow a verb-first, snake_case convention (search, lookup, resolve, screen, classify, validate), but the noun phrases vary in structure: some are direct objects (drug_label, device_submission), some use prepositions (drug_to_application, for_rwe_signals). This is mostly consistent and readable, with minor deviations.
Seven tools is well-scoped for covering both drug-related (labels, applications, name resolution, RWE signals) and device-related (submissions, product codes, validation) workflows. Each tool serves a clear purpose without bloat.
The core workflows are covered: drug label search, drug name-to-application resolution, application metadata retrieval, RWE signal screening, device submission lookup, product code classification, and full validation. Minor gaps exist, such as no device search by name and no adverse event data, but the primary lifecycle is well supported.
Maintenance
Related MCP Connectors
FDA medical-device regulatory intelligence from keyless openFDA datasets.
Check products against FDA food, drug and device recalls; drug labels, NDC, 510(k) via openFDA
FDA MCP — US Food and Drug Administration public API (free, no auth)
Search and export FDA drug labels by brand name, generic ingredient, or UNII code.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying FDA drug approvals, device clearances (510(k)), recalls, and adverse events via the openFDA API, providing tools for clinical and pharmaceutical research.1MIT
- AlicenseAqualityDmaintenanceEnables LLMs to search FDA drug labels and adverse event data via the OpenFDA API, supporting natural language queries for drug safety information.2MIT
- AlicenseAqualityDmaintenanceProvides LLM-optimized access to FDA data through the OpenFDA API and direct regulatory decision document retrieval, covering all 21 OpenFDA endpoints plus 510(k) summaries, De Novo decisions, and PMA approvals.41MIT
- AlicenseNot gradedqualityBmaintenanceEnables querying FDA medical device regulatory databases including 510(k) clearances, PMA approvals, recalls, and adverse events through natural language.102 npmMIT