faostat-mcp-server — Claude Code MCP server for UN FAO statistics
A local SQLite mirror of UN FAOSTAT: production, trade, food security, land use, fertilizer, emissions for 245+ countries since 1961. Agents resolve codes, query cubes, and run SQL over big result sets.
Apache-2.0 2,410 installs ★ 3 updated 2026-10-18
claude mcp add --transport http faostat-mcp-server https://faostat-mcp-server--cyanheads.run.toolsWhat faostat-mcp-server does
This server brings UN food and agriculture statistics into your coding agent. The bulk corpus lands in a local SQLite mirror, and a DataCanvas layer adds a read-only SQL surface on top. Seven tools, one skill resource.
The flow starts with faostat_list_domains, which lists the ~69-domain catalog and marks what is indexed locally. faostat_resolve_codes maps names like maize or milk to the integer codes queries need, flagging countries versus aggregate regions. faostat_query_observations pulls the cube by areas, items, elements, and a year range. Small results come back inline; anything above the limit spills to a DataCanvas table, capped at 50,000 staged rows.
faostat_commodity_profile assembles a commodity snapshot in one call: top producers, production trend, trade flows. Ambiguous names should be resolved through faostat_resolve_codes with domain QCL first. Staged tables expire after a 2-hour TTL, and the opt-in faostat_dataframe_drop tool requires FAOSTAT_DATAFRAME_DROP_ENABLED=true. Data-quality flags travel with every row and are never stripped.
What it helps with
- find the right FAOSTAT domain by code or topic
- turn a commodity name into the integer code a query needs
- fetch observations by country, item, and year range
- build a single-commodity profile with producers, trend, and trade
- run SQL over large result sets without leaving the agent
Example prompts for the agent
- List FAOSTAT domains that are indexed and ready to query
- Resolve the item code for maize in the QCL domain
- Pull a commodity profile for wheat: top producers, trend, exports
How to install faostat-mcp-server
Platform CLI: remote server
claude mcp add --transport http faostat-mcp-server https://faostat-mcp-server--cyanheads.run.toolsPlatform CLI: remote server
codex mcp add faostat-mcp-server --url https://faostat-mcp-server--cyanheads.run.toolsConfig file
{
"mcpServers": {
"faostat-mcp-server": {
"url": "https://faostat-mcp-server--cyanheads.run.tools"
}
}
}Config file
{
"servers": {
"faostat-mcp-server": {
"type": "http",
"url": "https://faostat-mcp-server--cyanheads.run.tools"
}
}
}Platform CLI: remote server
gemini mcp add -t http faostat-mcp-server https://faostat-mcp-server--cyanheads.run.toolsStep 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-server
How do I install faostat-mcp-server in Claude Code?
Point Claude Code at the hosted server: claude mcp add --transport http faostat-mcp-server https://faostat-mcp-server--cyanheads.run.tools.
What does faostat-mcp-server do?
It exposes UN FAOSTAT data to your agent: production, trade, food balances, land use, fertilizer, emissions. The corpus sits in a local SQLite mirror, and large query results can be worked over with SQL through DataCanvas.
How do large result sets work?
Results that exceed the inline limit spill to a staged DataCanvas table. Use faostat_dataframe_describe to see its schema, then faostat_dataframe_query to run a read-only SELECT against it. Tables live for two hours.