Usda MCP Server

Search foods, compare nutrients, and look up the full USDA FoodData Central database.

Local serverstdio

What is the Usda MCP Server?

Search foods, compare nutrients, and look up the full USDA FoodData Central database.

What it actually does

  • Declarative tool and resource definitions — single file per primitive, framework handles registration and validation
  • Unified error handling — handlers throw, framework catches, classifies, and formats
  • Pluggable auth: none, jwt, oauth
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • STDIO and Streamable HTTP transports

Configuration

  • Bun v1.3.2 or higher (or Node.js v24+). - A free USDA FDC API key — register at api.data.gov/signup. The key is required; without it the server will not start.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
usda_search_foodsSearch foods by keyword across SR Legacy, Foundation, Survey FNDDS, and Branded data sources, with nutrient preview and pagination
usda_get_foodFull nutrient profile for one food by FDC ID, with optional per-portion scaling (g, oz, lb, kg, or serving)
usda_get_foodsBatch nutrient fetch for 2–20 FDC IDs in a single request; failed IDs reported in failed[] instead of aborting
usda_compare_foodsSide-by-side nutrient comparison for 2–5 foods, formatted as a markdown table scaled to a common gram basis
usda_list_nutrientsStatic FDC nutrient reference table (~150 nutrients) with IDs, names, units, and categories — no API call required

How to install the Usda MCP Server

{
  "mcpServers": {
    "usda-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/usda-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info",
        "USDA_FDC_API_KEY": "your-api-key"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Bun v1.3.2 or higher (or Node.js v24+). - A free USDA FDC API key — register at api.data.gov/signup. The key is required; without it the server will not start.
VariableDescriptionRequired
MCP_TRANSPORT_TYPEConfiguration value read at startup.Optional
MCP_LOG_LEVELConfiguration value read at startup.Optional
USDA_FDC_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • “Use Usda to usda search foods.”
  • “Use Usda to usda get food.”
  • “Use Usda to usda get foods.”

Frequently asked questions

Search foods, compare nutrients, and look up the full USDA FoodData Central database. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.