Skip to main content
Glama
ek-nath

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: OpenFDA FastMCP Server

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
drug_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of behavioral disclosure. The word 'Search' implies a read-only operation, which is a positive signal, but it does not disclose potential rate limits, API authentication requirements, pagination behavior, or error handling. Given that the description is minimal and lacks these details, a score of 3 reflects that it provides some behavioral context (read operation) but is far from comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured. It leads with the purpose, then lists arguments in a clear key-value format. Every sentence provides useful information without redundancy or excessive length. It is appropriately sized for a tool with only two parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema (context signal) so return values are likely covered there, reducing the description's burden. However, there are no annotations, and the description omits details such as pagination, rate limits, or usage constraints that would be valuable for a search tool interacting with an external API. It is adequate for basic invocation but not fully complete for a production context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no descriptions for its parameters (0% coverage), so the description must compensate. It does so by explicitly defining both 'drug_name' and 'limit': 'drug_name: The name of the drug.' and 'limit: Number of results to return (default 5).' This adds meaning beyond the raw schema types and defaults, though the explanations are brief.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Search OpenFDA for adverse events associated with a drug.' It uses a specific verb (Search) and resource (OpenFDA adverse events), which distinguishes it from the sibling tool 'search_drug_label' that focuses on drug labels. This is a clear, non-tautological purpose statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There is no mention of use cases, exclusions, or relationships to sibling tools like search_drug_label. A user would need external knowledge to decide which tool fits their need.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
drug_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden but only adds the generic/brand nuance and the default limit (already in schema). It does not disclose output format, error behavior, rate limits, or any other behavioral traits beyond the basic search.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and includes a structured arg list, but the arg list largely duplicates the schema. Still, it is free of unnecessary filler and front-loads the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a simple search tool, but it lacks explicit guidance on when to use it over the sibling tool and does not address any access or output considerations. Since an output schema exists, return values need not be explained, but the behavioral gaps hurt completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description compensates by explaining the meaning of drug_name with an example and specifying the default for limit, adding value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action (search) and resource (OpenFDA drug labels), and mentions generic or brand name, distinguishing it from the sibling tool for adverse events.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context for when to use the tool (searching drug labels by name) but does not explicitly address alternatives or situations when the sibling tool should be used instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedget_drug_adverse_events
    • First observedsearch_drug_label

TDQS

A3.6/5.0
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 issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time access to medical data including drug interactions, ICD-10 codes, FDA adverse event reports, and clinical guidelines. It enables LLMs to query databases like openFDA, PubMed, and CMS for pharmaceutical and clinical information.
    1
    MIT

Latest Blog Posts

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/ek-nath/openfda-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server