Access FDA Food Safety Data
MCP server giving Claude access to FDA food-safety data - recalls, alerts, and adverse-event reports.
Why it matters
Leverage the FDA's extensive food safety data, including recalls, alerts, and adverse events, to gain comprehensive insights into product safety and trends.
Outcomes
What it gets done
Search for food recalls by product description, type, or specific product.
Analyze food safety trends and company information.
Retrieve detailed information on adverse events and product safety alerts.
Access and query FDA Enforcement and Adverse Events APIs.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-safetysearch | bash Capabilities
Tools your agent gets
Search for food product recalls with detailed analysis, safety information, and comprehensive reporting
Search recalls by product type with detailed analysis, company trends, and safety recommendations
Check recalls for specific products with detailed safety information and recommendations
Search recalls by classification with detailed analysis and risk assessment
Search recalls by code information with detailed product tracking and safety alerts
Search recalls by date range with detailed timeline analysis and safety trends
Search adverse events with detailed case analysis and safety information
Get detailed symptom analysis, case details, and safety information for specific food products
Overview
SafetySearch MCP Server
An MCP server exposing FDA food-safety data as 8 tools - searching recalls by product, type, classification, code, or date, and checking adverse-event reports and symptom summaries. It is built on the public openFDA Enforcement and Adverse Events APIs. Use when you want Claude to check a food product's recall status, safety classification, or reported adverse events directly against FDA data.
What it does
This MCP server gives Claude access to FDA (Food and Drug Administration) food-safety data through 8 tools covering product recalls, safety alerts, adverse-event reports, and symptom summaries - built on top of the public openFDA API.
When to use - and when NOT to
Use it when you want Claude to check whether a specific food product has an active recall, search recalls by product type, classification, or date range, look up a product by its lot or code info, or check adverse-event reports and symptom patterns for a food product - for example asking "Are there any recalls for ice cream?" or "I got sick after eating Cheerios, have other people reported problems?". It only covers FDA Food safety data (enforcement/recall and adverse-event endpoints) - not drugs, devices, or other FDA-regulated categories. Requires Python 3.10 or higher and either pip or uv.
Capabilities
Eight tools, all under a food namespace: search_recalls_by_product_description(query) (detailed analysis and safety insights), search_recalls_by_product_type(product_type) (company trends and safety recommendations), search_recalls_by_specific_product(product_name) (safety info and recommendations for one named product), search_recalls_by_classification(classification) (risk-severity-based search, e.g. "Class I"), search_recalls_by_code_info(code_info) (product tracking by lot or code), search_recalls_by_date(days, default 30) (timeline analysis over a date range), search_adverse_events_by_product(product_name) (case analysis for reported adverse events), and get_symptom_summary_for_product(product_name) (aggregated symptom and case details). All tools call the openFDA Enforcement API (api.fda.gov/food/enforcement.json) and Adverse Events API (api.fda.gov/food/event.json) through a centralized async HTTP client that handles request and response logic, error handling, and API key management.
How to install
Clone the repository and install dependencies:
# Using pip
pip install "mcp[cli]>=1.0.0" httpx>=0.24.0 pydantic>=2.0.0
# Or using uv (recommended)
uv add "mcp[cli]>=1.0.0" httpx>=0.24.0 pydantic>=2.0.0
With uv, test the server via the MCP Inspector (uv run mcp dev server.py), run it directly (uv run python server.py), or install it into Claude Desktop for production use (uv run mcp install server.py). If you previously installed mcp in another project and hit a "Failed to spawn: mcp" error, run uv remove mcp then uv add "mcp[cli]>=1.0.0" to re-link the binary to the current environment. The codebase separates server.py (the MCP entrypoint), the safetyscore/tools/ package (currently just food.py, implementing the 8 tools), and safetyscore/api_client.py (the shared API client) - with its own Pytest suite in test_safetyscore/ runnable via uv run python test_safetyscore/test_tools/test_food_tools.py.
Who it's for
Consumers, food-safety researchers, or anyone who wants Claude to check a food product's recall status, safety classification, or reported adverse events directly against FDA data - rather than searching the FDA website by hand - grounded in the same enforcement and adverse-event data the FDA itself publishes.
Source README
SafetySearch
Search. Scan. Stay Safe.
A comprehensive Model Context Protocol (MCP) server that provides access to FDA (Food and Drug Administration) data for Food safety information.
๐ฏ What This Server Provides
This MCP server offers 8 tools to access product safety data, helping users:
- Check product recalls and safety alerts for food products
- Monitor food safety issues and recall trends
- Analyze safety trends and company information
- Get comprehensive food safety insights
๐ Quick Start
Prerequisites
- Python 3.10 or higher
- pip or uv package manager
Installation
Clone or download the project:
git clone https://github.com/surabhya/SafetySearch.git cd SafetySearchInstall dependencies:
# Using pip pip install "mcp[cli]>=1.0.0" httpx>=0.24.0 pydantic>=2.0.0 # Or using uv (recommended) uv add "mcp[cli]>=1.0.0" httpx>=0.24.0 pydantic>=2.0.0
๐ง Usage
Using uv (Recommended)
Note:
If you have previously installedmcpin another project, or if you encounter errors likeFailed to spawn: mcp ... No such file or directory, run:uv remove mcp uv add "mcp[cli]>=1.0.0"This ensures the
mcpbinary is correctly linked to your current environment.
Start the MCP Inspector (Development Mode)
Test and validate the server using the MCP Inspector:
uv run mcp dev server.py
Start the Server Directly
Run the server directly for testing:
uv run python server.py
Install in Claude Desktop (Production)
Install the server in Claude Desktop for production use:
uv run mcp install server.py
๐ ๏ธ Available Tools
Food Safety Tools (8 tools) โ
| Tool | Description | Parameters |
|---|---|---|
search_recalls_by_product_description |
Searches for food recalls with detailed analysis, safety insights, and comprehensive reporting. | query: str |
search_recalls_by_product_type |
Searches for recalls by product type with detailed analysis, company trends, and safety recommendations. | product_type: str |
search_recalls_by_specific_product |
Checks for recalls on specific products with detailed safety information and recommendations. | product_name: str |
search_recalls_by_classification |
Searches for recalls by classification with detailed analysis and risk assessment. | classification: str |
search_recalls_by_code_info |
Searches for recalls by code info with detailed product tracking and safety alerts. | code_info: str |
search_recalls_by_date |
Searches for recalls by date range with detailed timeline analysis and safety trends. | days: int (default: 30) |
search_adverse_events_by_product |
Searches for adverse events with detailed case analysis and safety insights. | product_name: str |
get_symptom_summary_for_product |
Gets detailed symptom analysis, case details, and safety insights for a specific food product. | product_name: str |
๐๏ธ Architecture
The server is built with a simple, modular architecture designed for clarity and extensibility.
graph TD
subgraph "SafetySearch MCP"
A[User] -- "Tool Call" --> B["server.py<br/>(MCP Entrypoint)"];
B -- "Executes" --> C{"Food Tools<br/>(safetyscore/tools/food.py)"};
C -- "HTTP Request" --> D["API Client<br/>(safetyscore/api_client.py)"];
end
D -- "Calls" --> E["openFDA API<br/>(api.fda.gov)"];
subgraph "Testing Framework"
F[Pytest] -- "Runs" --> G["Test Suite<br/>(test_safetyscore/)"];
G -- "Tests" --> C;
end
server.py: The main entry point of the MCP server. It initializes the toolsets and makes them available to the MCP environment.safetyscore/: The core Python package containing all the logic.tools/: This directory contains the different tool modules. Currently, it only containsfood.py.food.py: Implements the 8 tools for food safety, which provide detailed analysis and safety insights.
api_client.py: A centralized asynchronous HTTP client for interacting with the external openFDA API. It handles request/response logic, error handling, and API key management.
test_safetyscore/: Contains the test suite for the server, ensuring the reliability and correctness of the tools.
This structure separates concerns, making it easy to maintain and add new toolsets in the future.
๐ Example Prompts and Tool Calls
Here are some examples of user prompts and the corresponding tool calls they would trigger.
Food Safety Tools
User Prompt: "Are there any recalls for ice cream?"
food.search_recalls_by_product_description(query="ice cream")User Prompt: "Show me recent recalls for bakery products."
food.search_recalls_by_product_type(product_type="Bakery")User Prompt: "I bought some 'Ben & Jerry's Chocolate Fudge Brownie' ice cream, is it safe?"
food.search_recalls_by_specific_product(product_name="Ben & Jerry's Chocolate Fudge Brownie")User Prompt: "List all the most serious food recalls."
food.search_recalls_by_classification(classification="Class I")User Prompt: "The code on my food package is '222268'. Is there a recall for it?"
food.search_recalls_by_code_info(code_info="222268")User Prompt: "What food recalls have happened in the last two weeks?"
food.search_recalls_by_date(days=14)User Prompt: "I got sick after eating Cheerios. Have other people reported problems?"
food.search_adverse_events_by_product(product_name="Cheerios")User Prompt: "What are the common symptoms people report after eating 'Lucky Charms'?"
food.get_symptom_summary_for_product(product_name="Lucky Charms")
๐งช Running Tests
To verify that all tools work as expected, you can run the provided test suites:
Prerequisites
- Ensure you have installed all dependencies (see Installation section above)
Run All Test Suites
From the project root directory, run:
# Test Food Tools
uv run python test_safetyscore/test_tools/test_food_tools.py
๐ API Endpoints Used
Food Safety
- Enforcement API:
https://api.fda.gov/food/enforcement.json - Adverse Events API:
https://api.fda.gov/food/event.json
SafetySearch - Making FDA safety data accessible to everyone through the power of MCP.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.