# USDA FoodData Central Alternative MCP

> USDA FoodData Central Alternative MCP Server lets your AI agent audit food records and nutrient data using public USDA sources. Instead of querying technical databases, you ask natural language questions to pull detailed composition reports, discover specific nutrients, or compare multiple foods instantly.

## Overview
- **Category:** government-public-data
- **Price:** Free
- **Tags:** nutritional-data, food-composition, health-research, dietary-analysis, open-data

## Description

This server connects your AI client to authoritative USDA food composition data, letting your agent run complex nutrient audits without you ever having to touch a messy technical database. You just ask natural language questions, and it pulls the details.

**Search Food Items:** This tool lets your AI agent search through keywords, instantly giving you detailed metadata—including FDC IDs—for thousands of different food items. Instead of manually cross-referencing codes, you get a solid list of options right away.

**Retrieve Full Nutrient Profiles:** When you need to know the full composition report for any specific food, your AI agent executes this tool. It pulls every nutrient breakdown you want—whether it's calories, mineral levels, or vitamin content—and presents it clearly.

**Compare Multiple Foods:** If you gotta compare nutritional values across different categories, the agent handles that side-by-side for ya. You give it a list of foods, and it generates a direct comparison report showing how they stack up against each other.

**Query Specialized Records:** For deep food science research, this tool lets you run specialized searches using foundation records or specific survey data sets. This isn't just surface-level querying; it’s for targeted, academic-grade investigation.

**List Available Nutrients:** You can scan the entire USDA catalog to generate a list of every recognized nutrient marker. If you need to pinpoint exactly which dietary components are tracked, this tool shows you what's available.

You don't gotta mess with proprietary databases or technical endpoints. Your agent just takes your prompt—like 'What's the protein content in apples versus almonds?'—and handles the whole data retrieval process using established public sources.

## Prompt Examples

**Prompt:** 
```
Search for 'greek yogurt' in the USDA database.
```

**Response:** 
```
I've retrieved several entries for greek yogurt. Notable options include low-fat and whole milk versions. Would you like the nutrient details for any specific brand?
```

**Prompt:** 
```
Show nutritional details for FDC ID 170895.
```

**Response:** 
```
I've identified FDC ID 170895 as 'Raw Spinach'. It contains high levels of Vitamin A and K. Would you like the full breakdown per 100g?
```

**Prompt:** 
```
List available nutrients in the USDA catalog.
```

**Response:** 
```
I've scanned the nutrient catalog. It includes over 200 items, from 'Energy' and 'Protein' to specific minerals like 'Selenium'. I can help you search for a specific dietary marker.
```

## Capabilities

### Search Food Items
The agent searches by keyword and returns detailed metadata, including FDC IDs, for thousands of food items.

### Retrieve Full Nutrient Profiles
You ask for a specific food's nutrient breakdown (like calories or vitamins) and get the full composition report.

### Compare Multiple Foods
The agent accepts a list of foods and provides side-by-side comparisons of their nutritional values.

### Query Specialized Records
You run deep searches using specialized survey data or foundation records for targeted food science research.

### List Available Nutrients
The agent scans the catalog and returns a list of all recognized nutrients, helping you pinpoint specific dietary markers.

## Use Cases

### Creating a cross-dietary comparison
A nutritionist needs to compare the Vitamin C and calcium content of three different plant sources. Instead of pulling three separate reports, they ask their agent via `batch_discovery` to list all three foods. The agent immediately generates a side-by-side nutrient breakdown for easy review.

### Verifying research data on specialized compounds
A food scientist is working on a specific foundation record that isn't in the main tables. They use `composition_intelligence` to query the specialized survey data, ensuring they maintain strict control over their foundational research and get targeted results.

### Auditing ingredient lists from product photos
A health enthusiast takes a picture of packaged food ingredients. They use `food_auditing` to search for the main keywords, retrieving detailed metadata like FDC IDs and brand name potential matches, turning vague labels into structured data.

### Building a comprehensive nutrient index
A developer needs to ensure their app tracks every possible dietary marker. They start by running `metadata_discovery` to list all available nutrients in the USDA catalog. This gives them the full scope of data they need to model.

## Benefits

- Stop manually compiling spreadsheets. With this server, you can list multiple foods and compare their nutritional values instantly using the `batch_discovery` tool. It handles the cross-referencing for you.
- Get immediate accuracy on dietary needs. Instead of guessing nutrient levels, use `nutrient_oversight` to pull detailed composition reports for specific items per 100g.
- Speed up research dramatically. The `food_auditing` tool lets you search by keyword and get back crucial metadata (like FDC IDs) in a single prompt, skipping manual database navigation.
- Target niche data points. Need to know every marker? Use the `metadata_discovery` tool to list all available nutrients in the catalog—no searching through hundreds of PDFs needed.
- Build better apps faster. App developers use this server's tools to automate food data queries, ensuring their health-tech projects are always fed accurate USDA metrics.

## How It Works

The bottom line is: You talk to it like a person, and it handles all the complex database calls in the background.

1. Subscribe to this server and enter your USDA API Key credentials.
2. Tell your AI client what data you need (e.g., 'Compare spinach and kale for Vitamin K').
3. Your agent runs the necessary tools, pulling structured food composition reports directly into your chat window.

## Frequently Asked Questions

**How do I find my USDA API Key?**
Sign up at the [**USDA API portal**](https://api.nal.usda.gov/), and you will receive your API Key via email. Copy and paste it below.

**Can the agent search for branded food items?**
Yes. Use the `search_foods` tool and set the `dataType` to 'Branded'. Your agent will retrieve specific products from various manufacturers instantly.

**Is it possible to retrieve a full nutritional breakdown?**
Yes. The `get_food` tool provides a comprehensive list of nutrients, including vitamins, minerals, and caloric data for any specific FDC ID.

**What are the rate limits for using the USDA FoodData Central Alternative tool?**
The API enforces specific rate limits based on your subscription tier. If you exceed those quotas, the agent will return an explicit HTTP error code. Always check the official documentation for current usage guidelines.

**How can I perform specialized queries using the USDA FoodData Central Alternative to find niche dietary markers?**
You first list all available nutrients in the catalog. This lets you filter results efficiently for specific minerals or vitamins outside of standard searches. It keeps your research focused.

**What happens if I input an unrecognized FDC ID when using USDA FoodData Central Alternative?**
The agent returns a structured error code and the item's status immediately. This lets your workflow catch bad IDs instantly instead of failing silently, which is crucial for data pipelines.

**Can I connect USDA FoodData Central Alternative to my internal database or other services?**
The tool outputs standardized JSON structures that are easy to ingest into any modern database. Remember, your client code handles the actual writing and storage of this retrieved data.

**How efficiently does USDA FoodData Central Alternative handle batch discovery compared to single lookups?**
It processes multiple food items in a single request structure for comparison. This method is significantly faster than running individual queries, provided your list stays within the allowed item count.