Skip to main content
MCP server CX Codex

FAOSTAT MCP — Claude Code MCP server: what it does, how to install

Connects AI coding agents to UN agricultural statistics for 245 countries. It lets you retrieve crop, trade, food security, and emissions metrics via chat.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add faostat-mcp -e FAOSTAT_API_TOKEN=<FAOSTAT_API_TOKEN> -e FAOSTAT_USERNAME=<FAOSTAT_USERNAME> -e FAOSTAT_PASSWORD=<FAOSTAT_PASSWORD> -- uvx faostat-mcp
Open on GitHub

What FAOSTAT MCP does

This server bridges the UN food and agriculture database with coding assistants using 23 purpose-built MCP endpoints. The model handles category selection, filters time series from 1961 onward, and resolves ambiguity via faostat_search_codes. A built-in throttle limits traffic to 2 requests per second.

Requests flow through a tiered cache: 20 minutes in memory, 24 hours in SQLite, and optional Redis persistence. Anonymous access is not supported. You need credentials from the FAOSTAT Developer Portal to query the API. You can store your login in the OS keychain with faostat_setup or pass it as runtime environment variables.

What it helps with

  • query global crop yields and harvested acreage across historical dates
  • inspect country-level agricultural trade and price metrics
  • track greenhouse gas emissions originating from food systems
  • evaluate national indicators on undernourishment and food access

Example prompts for the agent

  • Compare wheat production volumes between France and Germany from 2015 to 2022 using FAOSTAT.
  • Show the agricultural greenhouse gas emission numbers for Brazil over the last five years.
  • Run faostat_setup with my credentials to store my login securely.

How to install FAOSTAT MCP

Platform CLI

claude mcp add faostat-mcp -e FAOSTAT_API_TOKEN=<FAOSTAT_API_TOKEN> -e FAOSTAT_USERNAME=<FAOSTAT_USERNAME> -e FAOSTAT_PASSWORD=<FAOSTAT_PASSWORD> -- uvx faostat-mcp

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from faostat-mcp <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about FAOSTAT MCP

How to install FAOSTAT MCP in Claude Code?

Run `claude mcp add faostat-mcp -e FAOSTAT_API_TOKEN=<FAOSTAT_API_TOKEN> -e FAOSTAT_USERNAME=<FAOSTAT_USERNAME> -e FAOSTAT_PASSWORD=<FAOSTAT_PASSWORD> -- uvx faostat-mcp`.

What does FAOSTAT MCP do?

It exposes official United Nations food and farming databases to your AI agent, making statistical queries possible through conversational prompts.

What credentials are required to use this server?

You need an account on the FAOSTAT Developer Portal. Supplying your username and password allows automatic token refresh, whereas standalone API tokens expire after 1 hour.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor