Food Data Central MCP Server
Provides configuration instructions for running the Food Data Central MCP server on macOS, including specific file paths and environment setup needed for the Claude Desktop application.
Utilizes npm for package management and running the server, with commands for installation, building, and execution of the Food Data Central MCP server.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Food Data Central MCP Server
This is a Model Context Protocol (MCP) server for exposing API access to the USDA's FoodData Central API.
Features
Search for foods in the USDA FoodData Central database
Access food nutrient information
Paginated results
Support for multiple data types (Foundation, SR Legacy, Survey, Branded)
Related MCP server: nutrition-mcp-server
Setup
Clone the repository
Install dependencies:
npm installBuild the project:
npm run build
Running the Server
The server uses stdio transport, which means it's designed to be run as a subprocess by an MCP client. To run it directly:
# Set the USDA API key as an environment variable
export USDA_API_KEY=your-api-key-here
npm startFor development with hot reloading:
# Set the USDA API key as an environment variable
export USDA_API_KEY=your-api-key-here
npm run devUsing with Claude Desktop
To use this MCP server with Claude Desktop:
Open the Claude Desktop settings:
On macOS: Click on the Claude menu and select "Settings..."
On Windows: Click on the Claude menu and select "Settings..."
In the Settings pane, click on "Developer" in the left-hand bar, and then click on "Edit Config"
This will create or open a configuration file at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the Food Data Central MCP server to the configuration file:
{ "mcpServers": { "food-data-central": { "command": "npx", "args": ["tsx", "/path/to/food-data-central-mcp-server/src/index.ts"], "env": { "PATH": "/opt/homebrew/bin", "USDA_API_KEY": "<INSERT KEY HERE>" } } } }Replace
/path/to/food-data-central-mcp-serverwith the absolute path to this repository, and<INSERT KEY HERE>with your actual USDA API key.Note: If you're on Windows, you may need to adjust the PATH value to include your npm global installation directory.
Save the configuration file and restart Claude Desktop
After restarting, you should see a hammer icon in the bottom right corner of the input box. Click on it to see the available tools.
Now Claude will be able to access the Food Data Central API through this MCP server. You can ask Claude to search for foods, get nutrient information, or retrieve detailed food data.
MCP Resources and Tools
Resources
food://details- Get detailed information about a specific food by IDQuery parameters:
fdcId: Food Data Central ID (required)format: Optional. 'abridged' for an abridged set of elements, 'full' for all elements (default)nutrients: Optional. List of up to 25 nutrient numbers (comma-separated)
food://foods- Get details for multiple food items using input FDC IDsQuery parameters:
fdcIds: List of multiple FDC IDs (required, comma-separated)format: Optional. 'abridged' for an abridged set of elements, 'full' for all elements (default)nutrients: Optional. List of up to 25 nutrient numbers (comma-separated)
food://list- Get a paged list of foodsQuery parameters:
dataType: Optional. Filter on a specific data type (comma-separated list)pageSize: Optional. Maximum number of results to return (default: 50)pageNumber: Optional. Page number to retrieve (default: 1)sortBy: Optional. Field to sort bysortOrder: Optional. Sort order, "asc" or "desc"
Tools
search-foods- Search for foods using keywordsParameters:
query: Search terms to find foods (required)dataType: Optional. Filter on a specific data type (array of strings)pageSize: Optional. Maximum number of results to return (default: 50)pageNumber: Optional. Page number to retrieve (default: 1)sortBy: Optional. Field to sort bysortOrder: Optional. Sort order, "asc" or "desc"brandOwner: Optional. Filter results based on the brand owner of the food (only for Branded Foods)tradeChannel: Optional. Filter foods containing any of the specified trade channelsstartDate: Optional. Filter foods published on or after this date (format: YYYY-MM-DD)endDate: Optional. Filter foods published on or before this date (format: YYYY-MM-DD)
Example Usage
Get food details using the MCP resource:
food://details?fdcId=2345678&format=fullGet multiple foods using the MCP resource:
food://foods?fdcIds=534358,373052,616350Get a list of foods using the MCP resource:
food://list?dataType=Foundation,SR Legacy&pageSize=10&pageNumber=1Search for foods using the MCP tool:
{
"name": "search-foods",
"arguments": {
"query": "apple",
"dataType": ["Foundation", "SR Legacy"],
"pageSize": 10,
"pageNumber": 1
}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search foods, compare nutrients, and look up the full USDA FoodData Central database.
USDA FoodData Central nutrition data: search foods, compare macros, and analyze meals.
Food nutrition lookup via natural language, barcode, and image. Database of 1,000,000+ foods.
Nutrition data for AI agents and LLMs, powered by Edamam’s database of 1,000,000 foods, including 680,000+ with UPC codes. Lookup via natural language and barcode at low cost and low latency. Highly accurate, deterministic data covering macro and micronutrients, allergens, and lifestyle diet tags.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides intelligent access to the USDA nutrition database through AI assistants, enabling users to search foods, compare nutritional content, find foods high in specific nutrients, and query authoritative nutrition data across 7,146+ food items through natural language.1-
- AlicenseAqualityDmaintenanceEnables natural language access to USDA's FoodData Central database with 1M+ foods, supporting search, nutrition facts, food comparison, and daily value calculations.8MIT
- AlicenseNot gradedqualityDmaintenanceProvides access to USDA FoodData Central database, enabling food search, nutrition details, and comparison for dietary analysis via MCP.5MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides a USDA-accurate food database with deterministic macro math, enabling tools like list_foods, get_food, calculate_macros, filter_by_diet, build_meal, and list_available_tags. It allows Claude to look up nutrition facts and solve for exact macro targets offline, without AI or network.6MIT