← Tutorials

How to Query FDA Drug Safety Data Using MCP (Step-by-Step Guide for Life Scientists)

Published Nov 3, 2026

0 0 Link copied

1. Introduction: Why Life Scientists Need MCP for Drug Safety Data

  • The Problem: Answering a simple pharmacovigilance question such as "What are the most reported side effects of this drug, and has it ever been recalled?" means jumping between the FAERS dashboard, DailyMed, Drugs@FDA, and the FDA recall database. Each portal has its own search syntax, and exporting results into one table usually ends in spreadsheets full of copy-and-paste errors.
  • The Solution: Model Context Protocol (MCP) acts as a secure data bridge between Claude and live FDA databases. Instead of answering from its training memory, Claude queries openFDA in real time, counts adverse event reports, reads the current label, checks for recalls, and combines everything into one structured report.

This guide uses the open-source openFDA MCP server listed in the BenchNBots directory. It covers the openFDA endpoints for drugs, devices, food, and recalls, including FAERS adverse events, drug labels (SPL), Drugs@FDA approvals, the NDC directory, and drug shortages.

Research use only: openFDA data is unvalidated, and a FAERS report does not prove that a drug caused a reaction. Results are for research and education, not for medical decisions or regulatory submissions.

2. What You Will Achieve in This Tutorial

By the end of this guide, you will:

  1. Connect Claude Desktop to the live openFDA database.
  2. Pull the most frequently reported adverse reactions for any drug from FAERS using a plain-English prompt.
  3. Check a drug's label warnings, recall history, and approval status in the same conversation.
  4. Get a structured markdown safety summary you can paste into a lab notebook, report, or literature review.

3. Prerequisites: What Is Needed (Tested & Verified for Claude)

Before getting started, make sure you have:

  • The Claude Desktop App installed on macOS or Windows (Option A also works on claude.ai in your browser).
  • 5 minutes of setup time.
  • For Option B only: Node.js version 24 or later installed on your computer (downloadable for free from nodejs.org).
  • Optional: a free openFDA API key from open.fda.gov. Without a key you get 1,000 requests per day; with one, 120,000.

No programming knowledge is required.

4. Which Setup Option Should You Choose?

There are two ways to connect Claude to openFDA. Both give Claude the same drug safety tools.

Option A: Connector (recommended) Option B: Config file (advanced)
What you do Add one URL in Claude's connector settings Edit a JSON file and restart Claude
Install needed None Node.js 24 or later
Where the server runs A public server hosted by the server's developer On your own computer
Works on Claude Desktop and claude.ai Claude Desktop only
Use your own API key No Yes
Setup time About 2 minutes About 5 minutes

Choose Option A for the quickest setup. Choose Option B if you want to use your own openFDA API key for heavy querying, or your organisation doesn't allow custom connectors.

5. Option A: Add openFDA as a Connector (No Install)

Prefer to watch? This 56-second video with voiceover shows every step below, from opening Customize to Claude's first drug safety profile.

▶ Watch this video on YouTube

Step 1: Open Your Connectors

In Claude Desktop (or on claude.ai), click Customize in the sidebar and select the Connectors tab.

Claude's Customize page with Customize selected in the sidebar, the Connectors tab open, and the Add button highlighted

Step 2: Add a Custom Connector

Click + Add, then Add custom connector.

The Add menu on Claude's Customize page showing the Add custom connector option

Fill in the form and click Continue:

  • Name: openFDA
  • MCP server URL:
https://openfda.caseyjhand.com/mcp

The Add custom connector form filled in with the name openFDA and the openFDA MCP server URL

Step 3: Keep "No sign-in" and Click Add

Claude detects that this server needs no account and selects No sign-in for you. Leave it as it is and click Add. No API key is needed.

The connector authentication options with No sign-in selected and the Add button highlighted

Step 4: Connect

Click Connect on the new connector page.

The openFDA connector page saying you're not connected yet, with the Connect button highlighted

You'll see Connected to openFDA and the server's 14 read-only tools, including Openfda Drug Profile, Openfda Count Values, Openfda Get Drug Label, and Openfda Search Recalls. They are set to Needs approval, so Claude asks before each lookup.

The connected openFDA connector showing its 14 read-only tools set to Needs approval

Step 5: Turn the Connector On in a Chat

Start a new chat, click + below the message box, open Connectors, and make sure openFDA is switched on. Then go to Run Your First Test Prompt.

The chat tools menu with Connectors open and the openFDA connector switched on

6. Option B: Run the openFDA Server on Your Computer (Advanced)

Step 1: Open Your Claude Desktop Configuration File

The easiest way to open it on any computer is in Claude Desktop: go to Settings → Developer → Edit Config. This creates the file if it doesn't exist yet.

  • For macOS users: If you use VS Code, you can also open your terminal and paste this command:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • For Windows users: Press Win + R, paste %APPDATA%\Claude, and open claude_desktop_config.json in any text editor.

Step 2: Add the openFDA MCP Configuration

Copy and paste the following snippet into your configuration file:

{
  "mcpServers": {
    "openfda": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ]
    }
  }
}

If your file already has an "mcpServers" section, add the "openfda" entry inside it instead of pasting a second one.

Optional: add your free API key. If you plan to run many queries, add an env block with the key you got from open.fda.gov:

{
  "mcpServers": {
    "openfda": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/openfda-mcp-server"
      ],
      "env": {
        "OPENFDA_API_KEY": "paste-your-key-here"
      }
    }
  }
}

Save and close the file.

Step 3: Restart Claude Desktop

Completely quit the Claude Desktop app (ensure it is closed from your system tray or menu bar, not just the window) and reopen it. Claude Desktop only detects new MCP servers when it starts up.

7. Run Your First Test Prompt

Whichever option you chose, paste this exact prompt into a new chat to test your setup:

"Using openFDA, build a drug safety profile for semaglutide. Show the 8 most frequently reported adverse reactions in FAERS with their report counts, summarize the boxed warning from the current FDA label, and list any recalls. Present the results as clean markdown tables and note the date the data was last updated."

Claude asks before using each tool, showing exactly what it will look up. Here it uses Openfda Count Values to tally the most-reported reactions in FAERS reports that name semaglutide. Click Allow once each time, or Always allow if you don't want to be asked again. A detailed question like this one takes several lookups (in our test, six: drug profile, reaction counts, label, two recall searches and a recall tally).

Claude asking permission to use the Openfda Count Values tool to count FAERS reactions for semaglutide, with Allow once highlighted

8. Expected Outcomes

When working correctly, Claude will query live openFDA records instead of relying on training memory, and the answer will be marked Used openFDA. You should see something like this:

Top reported adverse reactions (FAERS, semaglutide)

Rank Reaction (MedDRA term) Reports
1 Nausea 11,150
2 Off label use 7,890
3 Vomiting 7,332
4 Diarrhoea 6,833
5 Decreased appetite 5,107
6 Constipation 4,976
7 Weight decreased 4,777
8 Impaired gastric emptying 4,175

Total FAERS reports mentioning semaglutide: about 78,000 (openFDA data last updated 28 October 2026).

Claude's answer marked Used openFDA, with a markdown table of the top FAERS adverse reactions for semaglutide

Claude then summarizes the label's boxed warning, the risk of thyroid C-cell tumors, which appears on every semaglutide label (Ozempic, Wegovy and Rybelsus). For recalls, it finds 57 FDA enforcement records, all Class II. Only 5 involve brand-name products, such as Wegovy pens recalled in December 2025 after hair was found in a prefilled syringe. The other 52 involve compounded semaglutide, mostly because sterility couldn't be assured.

Claude's recall summary: 57 Class II recall records for semaglutide, with the table of 5 brand-name product recalls highlighted

We checked these numbers directly against the openFDA API on 3 November 2026, and they match. FAERS grows every quarter, so your counts will be higher if you run this later. Always check the linked FDA record before you rely on a result.

How to read these numbers: A high report count for nausea reflects how widely the drug is used and how common the side effect is. It is not an incidence rate. FAERS has no denominator (it doesn't know how many people took the drug), contains duplicate reports, and is affected by media attention. Use it to spot signals, not to measure risk.

9. Troubleshooting & FAQs

Q: I can't find "Add custom connector" (Option A).

Fix: On Team and Enterprise plans, only organisation owners can add custom connectors, so ask your admin to add it. If connectors are turned off for your organisation, use Option B instead.

Q: Claude says "Tool execution failed" or doesn't show the openFDA tools (Option B).

Fix: Check three things:

  1. Node.js 24 or later is installed. Run node --version in your terminal to check.
  2. Your configuration file is valid JSON: no trailing commas, every { and [ closed, and straight quotes (") rather than curly quotes (“ ”). Paste it into a JSON validator such as jsonlint.com if unsure.
  3. You fully quit Claude Desktop (from the menu bar or system tray) before reopening it.

Q: Claude reports "429 Too Many Requests" or a rate limit.

Fix: Without an API key openFDA allows 1,000 requests per day. Switch to Option B and add your free OPENFDA_API_KEY to raise the limit to 120,000 per day.

Q: My drug returns zero results.

Fix: openFDA matches on generic and brand names as they appear in FDA records. Try the generic name (semaglutide instead of Ozempic), check the spelling, or ask Claude to "look up the NDC directory first to find the exact name openFDA uses."

Q: Can I use this for medical devices or food recalls?

A: Yes. The same server searches device adverse events (MAUDE), 510(k) clearances and PMA approvals, and food enforcement reports. Just ask, for example: "List Class I food recalls involving Listeria in the last 12 months."

Q: Can I upload my own company's internal safety reports?

A: Not with this server. It only queries public FDA data. With Option A, your queries also pass through the developer's hosted server, and with either option your prompts and results are processed by Claude like any other conversation. Don't put patient identifiers or confidential case reports into your prompts.

10. Quick Quiz: Test Your Knowledge

  1. True or False: A drug with 11,000 FAERS reports of nausea causes nausea in 11,000 patients. (Answer: False. FAERS counts voluntary reports, not confirmed cases, and has no denominator, so it can't measure how often a reaction happens.)
  2. Which setup option lets you add your own openFDA API key? (Answer: Option B, running the server on your computer with OPENFDA_API_KEY in the env block of claude_desktop_config.json.)
  3. What must you do after editing claude_desktop_config.json? (Answer: Completely quit and reopen Claude Desktop, because it only detects new MCP servers when it starts.)

Taxonomies