usda-mcp-server
MCP server by cyanheads Community
Searches the USDA FoodData Central database for nutrition data on about 400,000 foods. It returns nutrient profiles, comparisons and a nutrient reference for AI assistants.
Install usda-mcp-server
Built from the published package, never by AI.
claude mcp add usda-mcp-server -e USDA_FDC_API_KEY=YOUR_USDA_FDC_API_KEY -- npx -y @cyanheads/usda-mcp-serverRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"usda-mcp-server": {
"env": {
"USDA_FDC_API_KEY": "YOUR_USDA_FDC_API_KEY"
},
"args": [
"-y",
"@cyanheads/usda-mcp-server"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"usda-mcp-server": {
"env": {
"USDA_FDC_API_KEY": "YOUR_USDA_FDC_API_KEY"
},
"args": [
"-y",
"@cyanheads/usda-mcp-server"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"usda-mcp-server": {
"env": {
"USDA_FDC_API_KEY": "YOUR_USDA_FDC_API_KEY"
},
"args": [
"-y",
"@cyanheads/usda-mcp-server"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add usda-mcp-server --env USDA_FDC_API_KEY=YOUR_USDA_FDC_API_KEY -- npx -y @cyanheads/usda-mcp-server{
"mcpServers": {
"usda-mcp-server": {
"env": {
"USDA_FDC_API_KEY": "YOUR_USDA_FDC_API_KEY"
},
"args": [
"-y",
"@cyanheads/usda-mcp-server"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add usda-mcp-server npx -y @cyanheads/usda-mcp-serverGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the usda-mcp-server block.
About
usda-mcp-server is an MCP server from cyanheads that gives AI assistants access to USDA FoodData Central, the US government's food composition database. Users can search foods by keyword, ingredient or UPC/GTIN, and then pull full nutrient profiles scaled to a chosen portion or unit. Batch fetches and side-by-side comparisons of 2 to 5 foods are also supported.
The server runs over STDIO or Streamable HTTP and can be used through the hosted instance or installed locally with npx, Docker or a source build. Food search, lookup and comparison require a free USDA FDC API key, while the static nutrient reference works without one. It suits developers and agents that need nutrition facts, with results that show each food's data source.
Written from the project's README and checked against it.
Tools it gives your assistant
usda_search_foodsSearches foods by keyword, ingredient, or UPC/GTIN across several FDC data sources.usda_get_foodReturns the full nutrient profile for one food by FDC ID, with optional portion scaling.usda_get_foodsFetches nutrient data for 2 to 20 FDC IDs in one request, reporting failed IDs separately.usda_compare_foodsCompares 2 to 5 foods side by side, with nutrients shown as rows in a markdown table.usda_list_nutrientsLists the static FDC nutrient reference with IDs, names, units and categories, without an API call.
What you need
- USDA FoodData Central API key, free from api.data.gov (needed for search, get, batch and compare tools)
- Bun v1.4.0 or higher, or Node.js v24 or higher, for local runs
- Docker, optional, for container runs
| Setting | Needed | What it is |
|---|---|---|
USDA_Environment variable | Required | USDA FoodData Central API key from data.gov. Required for all food data requests. |
USDA_Environment variable | Optional | When true, an over-limit request is served up to its cap with a notice: usda_get_foods fetches the first 20 distinct FDC IDs and usda_compare_foods compares the first 5, returning the rest as deferredIds, and usda_search_foods serves a page Default: true |
MCP_Environment variable | Optional | Sets the minimum log level for output (e.g., 'debug', 'info', 'warn'). Default: info |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Search USDA foods for cooked brown rice and show its protein per 100 g.
- Compare oats, quinoa and brown rice on fiber, iron and sodium.
- List the USDA nutrients in the vitamins category.
Good to know
- Food search, lookup and comparison need a USDA FDC API key; the nutrient reference does not.
- Batch fetch accepts 2 to 20 FDC IDs per call, and comparison accepts 2 to 5 foods.
- Portion scaling needs valid portion data or a Branded gram label; no density is inferred for volume units.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to usda-mcp-server
All alternatives →Standardizes lab test names to LOINC codes and units to UCUM, and symptoms and diagnoses to ICPC-3, offline and with no API key. Built for people who want their health records on their own machine and queryable by an AI agent over MCP.
RuView is a WiFi sensing platform and MCP server that uses low-cost ESP32 sensors to detect people, breathing and heart rate. It is for developers and operators who want room sensing without cameras or wearables.
ToolUniverse is an MCP server that gives AI assistants access to more than 2,700 scientific tools for life science, research and literature. It is aimed at AI scientists, researchers and developers building research systems.
Mirobody is a self-hosted engine that turns lab reports, wearable data and genetic files into a single health record. Its built-in MCP server lets an AI assistant query that record and trace each number back to its source file. It is for people who want their health data on their own machine.
ScanSci PDF gets academic papers for AI agents. Give it a DOI, arXiv ID, article link, reference list or research question, and it searches candidate sources and tries to fetch accessible full texts. It is for students, researchers and labs.
Searches CNKI and Web of Science through an MCP server, returning records with impact factors. It can also open a paper in the user's signed-in browser and read its full text. Built for researchers who want AI answers on science topics backed by the source article.
Compare with Mirobody, Ruview or tooluniverse
usda-mcp-server: common questions
What data does the usda-mcp-server use?
It uses USDA FoodData Central, covering SR Legacy, Foundation, Survey (FNDDS) and Branded data sources. Each food result shows its dataType so users know the source.
Does it need an API key?
Search, single-food lookup, batch fetch and comparison require a USDA FDC API key, which is free from api.data.gov. The static nutrient reference works without one.
Can I scale nutrients to a portion or weight?
Yes, usda_get_food can scale values to g, oz, lb, kg or serving with an optional quantity. Volume and other labels need an explicit mass-unit request.
How do I install usda-mcp-server?
In Claude Code run claude mcp add usda-mcp-server -e USDA_FDC_API_KEY=YOUR_USDA_FDC_API_KEY -- npx -y @cyanheads/usda-mcp-server. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is usda-mcp-server the official server?
usda-mcp-server is a community project by cyanheads, not verified by a company domain.
Is usda-mcp-server free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is usda-mcp-server safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to usda-mcp-server?
Similar MCP servers: Mirobody, Ruview, tooluniverse, Mirobody.
Does usda-mcp-server work with ChatGPT?
Yes. Add its server URL in ChatGPT as a custom connector. See MCP in ChatGPT.
