com.blackswancausallabs/openfda-mcp

com.blackswancausallabs/openfda-mcp

Enables querying FDA regulatory metadata for drugs, biologics, and medical devices through the openFDA API, including resolving application numbers and product names to authoritative regulatory details.

Category
访问服务器

README

<!-- mcp-name: com.blackswancausallabs/openfda-mcp -->

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.

Tools

Drugs and biologics (/drug/* — CDER, CBER)

Tool Purpose
search_drug_label Search SPL label text, optionally scoped to a section
lookup_drugsfda_application Drugs@FDA record for an NDA/BLA/ANDA number
resolve_drug_to_application Brand or generic name → application number(s)
screen_for_rwe_signals Experimental. Sweep labels for RWE signals

Devices (/device/* — CDRH)

Tool Purpose
lookup_device_submission K / DEN / P / H number → device record
classify_device_product_code Product code → device class + medical specialty
validate_device_application Full chain: number → class, specialty, category

Install

pip install openfda-mcp

Add 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 cache
  • transient failure (timeout, connection error, 429, 5xx) → retried with backoff, then raises OpenFDATransientError; never cache this
  • rejected 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.gov

Live 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选