development
location
documentation
public
food safety
What is A comprehensive Model Context Protocol (MCP) server that provides access to FDA data for food safety information.?
SafetySearch is an MCP server that offers 8 tools to access product safety data, helping users check product recalls, monitor food safety issues, analyze trends, and get comprehensive insights.
Documentation
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 SafetySearch
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
๐ง Usage# Using uv (Recommended)
Note:
If you have previously installed mcp in another project, or if you encounter errors like Failed to spawn: mcp ... No such file or directory, run:
uv remove mcp
uv add "mcp[cli]>=1.0.0"
This ensures the mcp binary 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 contains food.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?"