Skip to main content
Glama
openfda-mcp-server

openfda-mcp-server

by ek-nath

OpenFDA MCP Server

An MCP (Model Context Protocol) server for the OpenFDA API, built with FastMCP. This server exposes FDA drug labels and adverse event data to LLMs via the Model Context Protocol.

Features

Tools

  • search_drug_label: Search for official FDA drug labels by brand or generic name. Returns indications, warnings, and dosage information.

  • get_drug_adverse_events: Search for reported adverse events associated with a specific drug, including seriousness and outcomes.

Prompts

  • drug_safety_report: A prompt template that guides the LLM to generate a comprehensive safety report for a specific drug, combining label warnings with real-world adverse event data.

Related MCP server: fda-approvals-mcp

Installation & Setup

  1. Clone and Install:

    git clone https://github.com/ek-nath/openfda-mcp-server.git
    cd openfda-mcp-server
    uv sync
  2. Verify Installation: Run the server manually to ensure dependencies are correct (it will wait for input):

    uv run server.py

API Key Configuration (Optional)

The OpenFDA API is rate-limited. For higher throughput, you can obtain an API key from the OpenFDA website.

If you have an API key, you can provide it to the server using a .env file:

  1. Create .env file: Copy the provided template:

    cp .env.template .env
  2. Set OPENFDA_API_KEY: Edit the newly created .env file and replace your_openfda_api_key_here with your actual API key:

    OPENFDA_API_KEY=your_actual_api_key

The server will automatically detect and use the OPENFDA_API_KEY from this file.

Integration

1. Gemini CLI

To use this tool with the Gemini CLI, add the server configuration to your global settings file (~/.gemini/settings.json).

Configuration:

{
  "mcpServers": {
    "openfda": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/openfda-mcp-server",
        "run",
        "--quiet",
        "server.py"
      ]
    }
  }
}

Replace /ABSOLUTE/PATH/TO/... with the full path to your cloned directory.

Troubleshooting: If you encounter EPERM errors on macOS regarding .Trash, add .Trash/ to your ~/.geminiignore file.

2. Google ADK (Agent Development Kit)

This server can be easily integrated into Python agents built with the Google Gen AI Agent Development Kit (ADK).

👉 View the ADK Integration Guide

3. Claude Desktop

Add the same configuration snippet above to your claude_desktop_config.json (usually located in ~/Library/Application Support/Claude/).

Usage Examples

Once connected, you can ask your agent questions like:

  • "Check the official FDA label for Lisinopril. Are there warnings about kidney issues?"

  • "I take Atorvastatin. Is it safe to take Ibuprofen?"

  • "Generate a drug safety report for Metformin."

License

MIT

Available Tools

2 tools
get_drug_adverse_eventsA

Search OpenFDA for adverse events associated with a drug.

Args: drug_name: The name of the drug. limit: Number of results to return (default 5).

Inputs: drug_name (required), limit. Returns: result

search_drug_labelA

Search OpenFDA for drug labels by drug name (generic or brand name).

Args: drug_name: The name of the drug (e.g., 'ibuprofen', 'Advil'). limit: Number of results to return (default 1).

Inputs: drug_name (required), limit. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools target distinct OpenFDA endpoints: drug labels and adverse events. There is no overlap in their purposes, making it clear which to use.

    Naming Consistency4/5

    Both names follow a verb_noun pattern, but one uses 'search' and the other uses 'get', which is a minor inconsistency. Otherwise the pattern is clear and predictable.

    Tool Count3/5

    With only two tools, the server feels thin for the OpenFDA domain, which has many potential endpoints. However, the two tools cover two common use cases, so the count is borderline acceptable.

    Completeness2/5

    OpenFDA offers many data types (e.g., recalls, enforcement reports, labeling for drugs and devices). Only drug labels and adverse events are covered, leaving significant gaps that would force agents to look elsewhere.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides 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.
      4
      1
      MIT