# USDA FoodData Central MCP

> USDA FoodData Central MCP Server gives your AI client access to the U.S. Department of Agriculture’s massive food database. You use it to search for foods and pull deep nutritional metrics—everything from total calories to specific fatty acid profiles. It's the definitive source for diet planning, research, and health applications.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** nutrition-data, dietary-analysis, food-science, macro-nutrients, public-api, health-data

## Description

You're working with the USDA FoodData Central MCP Server when you need the definitive source for U.S. nutritional metrics. This server connects your AI client straight into the Department of Agriculture’s massive, research-grade food database. It lets your agent pull deep, specific data points—everything from basic calorie counts to complex fatty acid profiles. Forget guessing; this is where you get real numbers.

To find a quick overview, use `search_usda_foods`. This tool scans the entire 300,000+ food database by name or simple criteria. It spits out fundamental nutrition facts per serving, giving you immediate summaries of calories, total protein, fat content, carbohydrates, dietary fiber, and sugar levels for specified items. You're instantly checking general nutritional balance across a huge range of foods.

When you know exactly what food item you want to analyze, use `get_usda_food_details`. This tool fetches the complete, granular nutritional profile for one specific food using its unique USDA Food ID. It doesn't just give you macro counts; it drills down into specialized metrics. You get detailed data on every vitamin and mineral listed, a breakdown of amino acids, and precise measurements of all fatty acid types, like saturated and polyunsaturated fats.

This server isn't limited to one type of food record. It lets your agent check multiple distinct categories of data, making sure the nutrition facts you pull are relevant for whatever project you’re running. You can access foundational research records—the pure, scientific-grade data that forms the bedrock of dietary science. You can also pull historical metrics from the SR Legacy collection, which tracks older food compositions. For commercial applications, you'll use the Branded category to analyze exactly what people buy in stores. Finally, if your goal is understanding real consumption patterns, the Survey data provides insight into how foods are actually eaten.

The system processes these complex datasets so you don't have to manually cross-reference multiple USDA sources. Whether you're building a diet planning application or running academic research on specific nutrient deficiencies, this server gives you structured access to it all.

## Tools

### get_usda_food_details
Fetches the full nutritional breakdown for one specific food item using its unique USDA Food ID.

### search_usda_foods
Searches the 300,000+ food database by name or criteria and returns basic nutrition facts per serving.

## Prompt Examples

**Prompt:** 
```
How many calories are in 100g of chicken breast?
```

**Response:** 
```
According to USDA data, 100g of raw chicken breast contains approximately 165 kcal, 31g protein, 3.6g fat, and 0g carbohydrates. It's an excellent source of lean protein with minimal fat content.
```

**Prompt:** 
```
Find a list of foods with the highest vitamin D content per 100g.
```

**Response:** 
```
Accessing USDA database for Vitamin D (Nutrient ID: 328)...
Top sources per 100g:
1. Cod liver oil — 250 µg
2. Salmon (sockeye, cooked) — 16.7 µg
3. Mushrooms (exposed to UV) — 10.7 µg
4. Mackerel (Atlantic, cooked) — 16.1 µg
```

**Prompt:** 
```
Look up the exact fat profile (saturated, monounsaturated, polyunsaturated) of an avocado.
```

**Response:** 
```
Parsing profile for 'Avocados, raw' (FDC ID: 171705). Per 100g:
- Total Fat: 14.7g
  - Saturated: 2.13g
  - Monounsaturated: 9.8g (primarily oleic acid)
  - Polyunsaturated: 1.82g
```

## Capabilities

### Find Food Nutrition by Name
Your AI client searches the entire USDA database to pull a summary of calories, protein, fat, carbs, fiber, and sugar for specified food items.

### Get Deep Nutritional Metrics by ID
Your agent retrieves a complete profile for one specific food item, including detailed data on all vitamins, minerals, amino acids, and fatty acid types (saturated/polyunsaturated).

### Check Multiple Food Data Types
You access different categories of data—like research-grade foundations vs. commercial branded products—to ensure the nutrition facts are relevant to your goal.

## Use Cases

### Formulating a High-Fiber Recipe
A developer needs to build a recipe that hits 30g of fiber. Instead of guessing, they ask their agent to run `search_usda_foods` for foods meeting high-fiber criteria. The server returns multiple options, allowing the agent to select and calculate ingredient proportions.

### Comparing Fat Profiles
A food scientist wants to compare avocados and walnuts' fat composition. They use `get_usda_food_details` on both foods using their respective IDs, letting the agent extract and compare specific metrics like monounsaturated vs. polyunsaturated fats.

### Quick Meal Planning
A user asks, 'How many carbs are in 100g of raw chicken breast?' The agent immediately runs `search_usda_foods`, pulling the precise carb count (and protein/fat) without needing a manual lookup or API key hassle.

### Analyzing Historical Trends
A researcher needs to compare modern branded products against historical records. They use the server's ability to pull data from both 'Branded' and 'SR Legacy' data types, ensuring their analysis covers a full spectrum of food history.

## Benefits

- Stop guessing on nutrition facts. Use `search_usda_foods` to instantly pull reliable counts for calories, protein, fat, carbs, fiber, and sugar per serving.
- Get surgical detail with `get_usda_food_details`. You retrieve the full breakdown of vitamins, minerals, amino acids, and specific fatty acid profiles—not just total fat.
- Work across all data types. The server supports foundation (research), branded (commercial), and survey (consumption) data, giving you a complete picture of food science.
- Write faster reports by eliminating manual lookups. Your agent handles the complex querying against 300k+ records automatically.
- Build confidence into your application logic. By using USDA's definitive source, your dietary analysis is backed by government-grade data.

## How It Works

The bottom line is: Your AI client sends structured requests to pull verified nutrition data from the USDA directly into your workflow.

1. Tell your agent what you need, like 'Find foods high in Vitamin D.'
2. Your agent calls `search_usda_foods`, passing the search parameters (e.g., nutrient name or food type).
3. The server returns a list of matching foods and their basic nutritional summary; if you need more detail on one item, your agent then uses `get_usda_food_details` with that specific Food ID.

## Frequently Asked Questions

**How do I find basic nutritional facts using search_usda_foods?**
Run `search_usda_foods` and provide the food name. The server returns a quick summary of calories, protein, fat, carbs, fiber, and sugar per serving right away.

**Do I need get_usda_food_details for every query?**
No. Use `search_usda_foods` first for a quick overview. You only use `get_usda_food_details` when you need the deep metrics, like specific micronutrients or fatty acid breakdowns.

**Can I compare branded and foundation foods?**
Yes. The server supports multiple data types. Just provide the necessary Food IDs, and your agent can pull comparable nutritional profiles regardless of whether they are commercial products or research standards.

**How do I get started with `search_usda_foods`?**
You must first obtain a free API key from Vinkius. Once you have that credential, set it as an environment variable in your agent's configuration to enable the tool.

**What should I do if `get_usda_food_details` fails?**
If the ID is invalid or data isn't found, the tool returns a specific error code and null payload. Your agent needs to check for this failure state before attempting any nutritional analysis.

**Can I filter `search_usda_foods` by a nutrient other than calories or protein?**
Yes, the tool accepts specific Nutrient IDs. You simply pass the ID and the minimum required amount you want to track in your search parameters.

**Are there limitations on calling `search_usda_foods` repeatedly?**
Vinkius enforces standard rate limits per subscription level. To avoid hitting those caps, we recommend batching multiple queries into a single workflow run.

**Does `get_usda_food_details` handle different data sources (e.g., branded vs foundation)?**
Yes. You specify the required data type—Foundation, SR Legacy, or Branded—as part of the food ID to ensure you get the correct nutritional profile for your use case.

**How do I get a USDA API key?**
Register for a free API key at fdc.nal.usda.gov/api-key-signup.html. Approval is instant — no wait time required.