SafetySearch MCP Server: FDA Food Safety Data
Access real-time FDA food safety data on the MCP server, track recalls, adverse events, and analysis for faster response.
Overview
The SafetySearch MCP Server exposes real-time FDA food safety data as tools that can be invoked by models or other services. It aggregates FDA recalls, adverse event reports, and related analysis into a simple HTTP API and an MCP-compatible tool manifest. Developers can integrate SafetySearch to provide up-to-date context for applications that need to monitor food safety issues, enrich conversational agents, or drive automated alerting and analytics pipelines.
By exposing the data as distinct tools (search, recalls, adverse-events, analysis), the server makes it easy for LLM-based assistants and automated systems to request specific, verifiable data rather than relying on latent model knowledge. This reduces hallucinations and enables faster, traceable responses to emerging food safety events.
Features
- Realtime access to FDA food recalls and enforcement reports
- Searchable adverse event reports related to foods
- Simple REST API with MCP-compatible tool manifest for model integrations
- Analysis endpoints that summarize recall trends and signal potential issues
- Lightweight server designed for local deployment or containerization
- Example clients and easy curl/Python usage for rapid prototyping
Installation / Configuration
Prerequisites:
- Git
- Node.js (14+) or Python 3.9+ depending on project variant (see repo README)
- Optional: FDA API key (for higher rate limits) — available from OpenFDA
Clone the repository and install dependencies:
Bash (Node.js example)
# If Node.js version is used
Bash (Python / pip example)
# If Python/requirements.txt is provided
Environment variables (example)
# Optional: OpenFDA API key for higher rate limits
# Server port
Running in Docker:
# Build and run (example)
Available Resources
The server exposes a small set of REST endpoints and an MCP-compatible manifest describing tools for model integration.
Endpoints
| Endpoint | Method | Description | Query params |
|---|---|---|---|
| /search | GET | Full-text search across FDA food safety data | q (query), limit, offset |
| /recalls | GET | List recent recalls and enforcement reports | status, product_type, limit |
| /adverse-events | GET | Search adverse event reports related to food | q, date_range, limit |
| /analysis | GET | Summaries and trend analysis (e.g., recent spikes) | type, window_days |
| /.well-known/mcp | GET | MCP tool manifest for model integrations | — |
Sample MCP manifest snippet (returned from /.well-known/mcp)
Quick Examples
Query recalls with curl:
Search adverse events via Python:
=
=
Use MCP manifest to load tools in an agent (pseudocode)
=
=
=
Use Cases
- Automated monitoring and alerting: Poll the /recalls and /analysis endpoints to detect spikes in recalls and trigger Slack/pager alerts for supply chain or quality teams.
- Conversational assistants: Integrate the MCP manifest so an LLM can call the safetysearch.recalls or safetysearch.adverse_events tools to answer user queries with live data instead of memorized facts.
- Incident response dashboards: Feed recall and adverse event streams into dashboards (Grafana/Prometheus pipelines) to visualize trends by product type, geographic distribution, or manufacturer.
- Regulatory research and analysis: Download recall records and run batch analytics to identify recurring failure modes, common contaminants, and time-to-closure metrics.
- Supply chain validation: Check incoming shipments against recent enforcement reports automatically to block risky suppliers.
Notes and Best Practices
- OpenFDA rate limits may apply. Use an API key for higher limits and implement caching for frequent queries.
- Treat the server as a context provider for models: prefer calling the specific tool endpoints rather than pasting raw records into prompts.
- Validate and log all tool outputs used in automated decision-making to maintain audit trails.
- The MCP manifest enables model-driven tool access; ensure your deployment is secured (HTTPS, authentication) when exposing it publicly.
For repository sources, examples, and the latest instructions, see the project on GitHub: https://github.com/surabhya/SafetySearch