UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.
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.
Global food & agriculture statistics from the UN FAOSTAT bulk-download corpus, served from a local SQLite mirror with a DataCanvas SQL surface, over MCP. STDIO & Streamable HTTP.
Public Hosted Server: https://faostat.caseyjhand.com/mcp
FAOSTAT is the UN Food and Agriculture Organization's authoritative global statistics service β crop and livestock production, agricultural trade, food balances, food security and nutrition, land use, fertilizer use, and agrifood-systems emissions for 245+ countries and territories from 1961 to the present. Each domain is a data cube of area (country/region) Γ item (commodity) Γ element (metric) Γ year, with a data-quality flag on every observation.
This server does not call the FAOSTAT REST query API β that endpoint is auth-gated (HTTP 401 keyless). Instead it syncs FAOSTAT's keyless bulk-download service (per-domain ZIPs of normalized CSVs plus their dimension code lists) into a persistent local SQLite mirror (embedded, with FTS5 over the dimension labels) and serves every query from that mirror β fast, offline-capable, and free of per-request rate limits. Analytical query results spill to a DataCanvas (DuckDB-backed) so an agent can run SQL GROUP BY, rankings, joins, and time-series analysis over the full result set.
[!IMPORTANT] First run requires a mirror build. The corpus is not bundled. Run
bun run mirror:initonce to download and index the selected FAOSTAT domains before querying. The read tools returnindex_not_readyuntil the first sync completes. See Building the mirror.
Six tools organized around the mirror's discover β resolve β query flow, with a DataCanvas pair for SQL over large result sets:
| Tool | Description |
|---|---|
faostat_list_domains | Discover FAOSTAT statistical domains with codes, descriptions, last-update date, upstream row count, and local index status. The entry point β every query keys on a domain code. |
faostat_resolve_codes | Resolve human terms to the opaque integer codes a query needs (areas, items, elements), flagging each area as a country or an aggregate region. |
faostat_query_observations | Query a domain's cube by area(s), item(s), element(s), and year range. Inline preview for small results; large sets spill to a DataCanvas table. |
faostat_commodity_profile | Workflow: assemble top producers, the production trend, and trade flows for one commodity from the production and trade domains in a single call. |
faostat_dataframe_query | Run a read-only SQL SELECT against the canvas tables staged by the analytical tools. |
faostat_dataframe_describe | List the canvas tables staged this session, each with provenance, row count, and column schema. |
faostat_list_domainsDiscover the catalog and what's queryable right now.
indexed / index_ready flags, local row count, and last completed synctopic substring filter over code, name, and topic (e.g. "trade", "emissions", "QCL")indexed_only to list just the domains queryable from the local mirrorcode for an exact domain lookup (e.g. "RL") β one full record, without a topic search that can match unrelated domainsoffset + limit to page the catalog; the response reports totalMatches, truncated, and the nextOffset to resume at. Domain descriptions are long, so a browse call is bounded by default β raise limit (max 200) to pull the whole catalog in one responsefaostat_resolve_codesTurn names into the integer codes the cube requires β FAOSTAT is unqueryable without code resolution.
query, e.g. "maize" β item 56), substring filter (name_contains), or exact-code lookup (code)dimension: area (countries/regions), item (commodities), or element (metrics like production, yield, import quantity)country or aggregate (World, continents, economic groupings; codes β₯ 5000) so an agent can avoid summing a region with its member countriesquery / name_contains / code to list the whole dimensionfaostat_query_observationsThe core data tool β query a domain's cube and get observations with their data-quality flag.
area_codes, item_codes, element_codes (resolve them first), and a year_start / year_end rangeinclude_aggregates: false) so a naive SUM does not double-count a region with its members β set include_aggregates: true for World/continent roll-ups, or pass explicit area_codes to query exactly what you namecanvas_id + table_name) for SQL aggregationlimit caps the inline page (default 200, max 1000); a match that outgrows the page is staged to the canvas table in full, and when no table is staged the response reports how many matched β so a low limit trims the response without putting rows out of reachA=Official, E=Estimated, I=Imputed, B=break, X=external) β honor it; never treat estimated/imputed values as officialfaostat_commodity_profileA workflow tool that assembles a global profile for one commodity in a single call.
QCL) and trade (TCL) domains and merges the results β the response discloses how many items the name matched in total, so a broad term like "milk" never silently narrowsyear_start / year_end range with invalid_year_range instead of returning an empty profilefaostat_dataframe_query / faostat_dataframe_describeSQL analytics over the canvas tables (faostat_xxxxxxxx) that faostat_query_observations and faostat_commodity_profile stage. Call faostat_dataframe_describe first to discover table and column names, then faostat_dataframe_query for cross-country and cross-item aggregation, GROUP BY rankings, joins, window functions, and CTEs β standard DuckDB SQL.
DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected by the framework SQL gate. System catalogs (information_schema, sqlite_master, duckdb_*) are denied so a caller can't enumerate staged tables it doesn't hold a handle for β list them via faostat_dataframe_describe.area_code, area, item_code, item, element_code, element, year, unit, value, flag. Keep flag in projections and honor it in interpretation.canvas_id is optional on both tools β omit it to operate on the tables staged in the current session (the common case).faostat_dataframe_describe lists newest-first and pages: pass name for one table, or offset + limit (default 20, max 100) and follow the reported nextOffset while truncated is true.All tool output is also rendered as human-readable markdown (content[]) alongside the structured payload, so tool-only MCP clients reach the same data.
No 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-server)<a href="https://allmcps.com/mcp/faostat-mcp-server"><img src="https://allmcps.com/api/badge/faostat-mcp-server?style=directory" alt="Faostat MCP Server on AllMCPs" /></a>