com.blackswancausallabs/openfda-mcp
OfficialClick on "Install 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-mcpResolve 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: @cyanheads/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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables AI agents to query and analyze FDA adverse events, drug labels, medical device clearances, and other public health datasets through natural language commands.Last updated13
- Alicense-qualityAmaintenanceQuery FDA data on drugs, food, devices, and recalls via openFDA. Provides 12 tools for searching adverse events, drug labels, recalls, and more.Last updated9734Apache 2.0
- Flicense-qualityBmaintenanceEnables querying FDA drug approvals, device clearances (510(k)), recalls, and adverse events via the openFDA API, providing tools for clinical and pharmaceutical research.Last updated1
- Alicense-qualityDmaintenanceEnables LLMs to search FDA drug labels and adverse event data via the OpenFDA API, supporting natural language queries for drug safety information.Last updatedMIT
Related MCP Connectors
FDA medical-device regulatory intelligence from keyless openFDA datasets.
OpenFDA MCP — wraps the openFDA API (free, no auth required)
Query FDA data on drugs, food, devices, and recalls via openFDA. STDIO or Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Black-Swan-Causal-Labs/openfda-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server