O

Openfda MCP Server

by cyanheads · io.github.cyanheads/openfda-mcp-server

Query FDA data on drugs, food, devices, and recalls via openFDA. Provides 12 tools for searching adverse events, drug labels, recalls, and more.

npm Remote GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-cyanheads-openfda-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "<VALUE>",
        "OPENFDA_CLAMP_LIMITS": "true",
        "CANVAS_PROVIDER_TYPE": "duckdb",
        "OPENFDA_DATAFRAME_DROP_ENABLED": "false",
        "OPENFDA_MIRROR_ENABLED": "false",
        "OPENFDA_MIRROR_PATH": "./data/openfda-mirror",
        "OPENFDA_MIRROR_REFRESH_CRON": "<VALUE>",
        "OPENFDA_MIRROR_FALLBACK_LIVE": "true",
        "OPENFDA_MIRROR_REFRESH_TIMEOUT_MS": "21600000",
        "OPENFDA_MIRROR_BASE_URL": "https://api.fda.gov",
        "MCP_LOG_LEVEL": "info",
        "LOGS_DIR": "<project-root>/logs",
        "OTEL_ENABLED": "false",
        "MCP_AUTH_MODE": "none",
        "MCP_HTTP_PORT": "3010",
        "OPENFDA_BASE_URL": "https://api.fda.gov",
        "MCP_TRANSPORT_TYPE": "stdio",
        "STORAGE_PROVIDER_TYPE": "in-memory"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
OPENFDA_API_KEY No Free API key from open.fda.gov. Increases daily limit from 1K to 120K requests.
OPENFDA_CLAMP_LIMITS No Clamp a limit above its endpoint's cap to that cap, with a notice naming the requested value and the cap. On by default; set to 'false' to reject such a limit instead and advertise the cap as the schema maximum. Default: true
CANVAS_PROVIDER_TYPE No DataCanvas staging, on by default: stage=true or a canvas_id on an openfda_search_* tool or openfda_lookup_ndc stages the matched records as a SQL table for the openfda_dataframe_* tools. The DuckDB binding ships with the server. Set to 'none' to disable. Default: duckdb
OPENFDA_DATAFRAME_DROP_ENABLED No Enable openfda_dataframe_drop, which deletes a table staged on a DataCanvas. Off by default; applies only when DataCanvas is enabled (CANVAS_PROVIDER_TYPE=duckdb). Default: false
OPENFDA_MIRROR_ENABLED No Serve exact-key lookups for drug/label, drug/ndc, drug/enforcement, and drug/drugsfda from a local bulk mirror instead of the API. Off by default; the initial harvest runs out-of-band via the mirror:init script. Default: false
OPENFDA_MIRROR_PATH No Directory holding one SQLite file per mirrored dataset. Default: ./data/openfda-mirror
OPENFDA_MIRROR_REFRESH_CRON No Cron expression for the in-process mirror refresh. HTTP transport only; stdio operators run mirror:refresh from the host. Requires the optional node-cron peer dependency.
OPENFDA_MIRROR_FALLBACK_LIVE No Fall back to the live API when the mirror is cold, missing the record, or failing. Disable to fail loudly instead. Default: true
OPENFDA_MIRROR_REFRESH_TIMEOUT_MS No Wall-clock budget for one scheduled refresh before it is aborted. Raise it for drug/label, the only multi-partition dataset. Default: 21600000
OPENFDA_MIRROR_BASE_URL No Host serving the openFDA bulk download manifest. Override only to harvest from a private mirror of the dumps. Default: https://api.fda.gov
MCP_LOG_LEVEL No Log level (`debug`, `info`, `warning`, `error`, etc.) Default: info
LOGS_DIR No Directory for log files (Node.js only). Default: <project-root>/logs
OTEL_ENABLED No Enable OpenTelemetry Default: false
MCP_AUTH_MODE No Authentication: `none`, `jwt`, or `oauth` Default: none
MCP_HTTP_PORT No HTTP server port Default: 3010
OPENFDA_BASE_URL No Base URL override for testing against a proxy or mock. Default: https://api.fda.gov
MCP_TRANSPORT_TYPE No Transport: `stdio` or `http` Default: stdio
STORAGE_PROVIDER_TYPE No Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` Default: in-memory

Similar servers