FAOSTAT data for 245 countries: crops, trade, food security, and emissions via 21 MCP tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Query UN food and agriculture statistics with AI β powered by the Model Context Protocol
An MCP (Model Context Protocol) server that exposes the full FAOSTAT API as tools for AI assistants. Connect any MCP-compatible client β Claude, Cursor, Windsurf, Zed, or your own agent β to the world's most comprehensive database of food, agriculture, fisheries, forestry, and nutrition statistics, covering 245 countries and territories from the United Nations Food and Agriculture Organization (FAO).
Keywords: FAOSTAT, MCP server, Model Context Protocol, AI agriculture data, FAO statistics, food security AI, agricultural data Python, UN data, crop production statistics, Claude, Cursor, Windsurf
Researchers, data journalists, policy analysts, and developers can ask natural-language questions and get answers directly from FAOSTAT β without writing a single API call. Your AI assistant handles domain discovery, filtering, and interpretation automatically.
Who is this for?
FAOSTAT is the statistical database of the United Nations Food and Agriculture Organization (FAO). It is the world's most comprehensive freely available source of data on food and agriculture, covering:
Data spans from 1961 to the present, across 245 countries and territories, in multiple languages.
The Model Context Protocol is an open standard that lets AI assistants call external tools at runtime. This server registers all FAOSTAT API endpoints as discoverable tools β your AI assistant automatically selects and chains the right calls when you ask a question.
faostat_setup β store credentials once, never touch a config file againfaostat_search_codes β agents ask before guessing ambiguous codesListed on the official MCP Registry β discoverable directly from Claude Desktop, Cursor, and any MCP-compatible client.
Easiest β use the faostat_setup tool (no config files needed):
Once the server is running and connected to your AI client, ask your assistant:
"Call faostat_setup with my FAOSTAT username and password."
The tool validates your credentials against the API, then stores them securely in your system keychain (macOS/Windows) or ~/.config/faostat-mcp/credentials.json (Linux/Docker). All subsequent sessions authenticate automatically β no env vars or .env file required.
Alternative β environment variables (CI/CD, Docker, advanced):
Register for a free FAOSTAT API account at the FAOSTAT Developer Portal.
The server works without Redis (SQLite disk cache is used instead). For shared or high-volume setups, launch Redis via Docker:
Then set REDIS_HOST_IP_ADDRESS, REDIS_HOST_PORT_NUMBER, and REDIS_DATABASE in .env.
Opens a browser UI at http://localhost:5173 where you can browse and test all 21 tools interactively.
The server uses a 3-tier cache to minimise redundant API calls. FAOSTAT data updates at most daily, so most repeated queries are served instantly.
| Tier | TTL | Scope | Notes |
|---|---|---|---|
| In-memory | 20 min | Current session | Fastest; reset on server restart |
| SQLite disk | 24 h | Cross-session | ~/.cache/faostat-mcp/cache.db; no extra infra |
| Redis | 30 min | Multi-user shared | Optional; set REDIS_* env vars to enable |
Cache lookup order: memory β disk β Redis β API call. A disk or Redis hit promotes the value to memory for the rest of the session.
To disable the disk cache (e.g. on a read-only filesystem), set FAOSTAT_DISK_CACHE=false.
The server speaks standard MCP over stdio, so it works with any compatible client.
Add one of the blocks above to:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonRestart Claude Desktop β faostat will appear in the tools panel.
Add the block to .cursor/mcp.json in your project root, or to your global Cursor MCP settings. See the Cursor MCP docs for details.
Any client that supports MCP stdio servers accepts the same config shape. Consult your client's documentation for the config file location.
Once connected, ask your AI assistant questions like:
| Domain | Example Question |
|---|---|
| Crop production | "What were the top 10 wheat-producing countries in 2022?" |
| Food security | "Show me food security indicators for Ethiopia from 2015 to 2020" |
| Trade | "Which countries are most dependent on food imports?" |
| Yield comparison | "Compare maize yields between the USA and Brazil over the last decade" |
| Emissions | "What are greenhouse gas emissions from agriculture in Sub-Saharan Africa?" |
| Discovery | "What agricultural datasets does FAOSTAT have for trade?" |
Your AI assistant will automatically:
faostat_list_groups or faostat_groups_and_domains to find the right domainfaostat_search_codes to look up a code by name β if multiple codes match (e.g. "production" matches both Production and Gross Production Index), the assistant pauses and asks you to choose before proceedingfaostat_get_data or faostat_get_rankings with the confirmed codesNo reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/faostat-mcp)<a href="https://allmcps.com/mcp/faostat-mcp"><img src="https://allmcps.com/api/badge/faostat-mcp?style=directory" alt="FAOSTAT MCP on AllMCPs" /></a>