
Faostat Mcp Server
If you've ever wanted an LLM to answer questions about world food production, trade, or land use without scraping the FAOSTAT site, this is the one to reach for. It serves the UN FAOSTAT bulk-download corpus from a local SQLite mirror, covering 245+ countries back to 1961. The tools walk you through the natural workflow: list domains, resolve human terms like "maize" or "Kenya" to codes, then query observations by area, item, element, and year range. There's also a commodity profile tool that bundles top producers, production trends, and trade flows for one crop in a single call. Large results spill into a staging table you can query with read-only SQL. It runs over STDIO or Streamable HTTP, and a public hosted instance is available if you'd rather not run it locally.
- GitHub stars
- 3
- tools
- 6
- transport
- STDIO, HTTP
- env vars
- 12
- last updated
- Nov 3, 2026
Install
From registry metadata$ npx add-mcp https://faostat.caseyjhand.com/mcp --name faostatRun in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.
Review the command, arguments and environment values before installing. MCP servers run with your local permissions.
Other ways
Claude Code
$ claude mcp add --transport http faostat https://faostat.caseyjhand.com/mcpRun in your terminal. Add --scope user to make it available in every project.
Tools
Verified live · 6 toolsVerified live against the running server on Nov 13, 2026.
faostat_list_domainsDiscover FAOSTAT statistical domains (production, trade, food balances, food security, land use, agri-emissions, prices, value) with their codes, descriptions, last-update date, upstream row count, and local index status. Every query keys on a domain code from here. The `index...5 params
Discover FAOSTAT statistical domains (production, trade, food balances, food security, land use, agri-emissions, prices, value) with their codes, descriptions, last-update date, upstream row count, and local index status. Every query keys on a domain code from here. The `index...
codestringindexed_onlybooleanlimitintegeroffsetintegertopicstringfaostat_resolve_codesResolve labels to the numeric codes or exact alphanumeric item identities faostat_query_observations needs: areas (countries/regions), items (commodities), and elements (metrics). Use query for full-text matching, name_contains for substring matching, code or code_text for exa...10 params
Resolve labels to the numeric codes or exact alphanumeric item identities faostat_query_observations needs: areas (countries/regions), items (commodities), and elements (metrics). Use query for full-text matching, name_contains for substring matching, code or code_text for exa...
codeintegercode_textstringdimension*stringarea · item · elementdomain*stringitem_codesarrayitem_codes_textarraylimitintegername_containsstringoffsetintegerquerystringfaostat_query_observationsQuery a FAOSTAT domain's data cube by area(s), item(s), element(s), sources, and year range, returning values with units and data-quality flags. Resolve numeric codes or exact alphanumeric item identities with faostat_resolve_codes; element resolution accepts item selectors an...11 params
Query a FAOSTAT domain's data cube by area(s), item(s), element(s), sources, and year range, returning values with units and data-quality flags. Resolve numeric codes or exact alphanumeric item identities with faostat_resolve_codes; element resolution accepts item selectors an...
area_codesarraycanvas_idstringdomain*stringelement_codesarrayinclude_aggregatesbooleanitem_codesarrayitem_codes_textarraylimitintegersource_codesarrayyear_endintegeryear_startintegerfaostat_commodity_profileAssemble a global profile for one QCL item in a single call: top-producing countries, the annual production trend, and trade flows (top exporters and importers). Supply item_code or item_query; code wins when both are supplied. A query selects a unique normalized exact label,...6 params
Assemble a global profile for one QCL item in a single call: top-producing countries, the annual production trend, and trade flows (top exporters and importers). Supply item_code or item_query; code wins when both are supplied. A query selects a unique normalized exact label,...
canvas_idstringitem_codeintegeritem_querystringtop_nintegeryear_endintegeryear_startintegerfaostat_dataframe_queryRun a single-statement SELECT against canvas tables staged by faostat_query_observations and faostat_commodity_profile (faostat_xxxxxxxx). Use DuckDB joins, aggregates, window functions, and CTEs for rankings and time-series analysis. Item groups can overlap their members even...3 params
Run a single-statement SELECT against canvas tables staged by faostat_query_observations and faostat_commodity_profile (faostat_xxxxxxxx). Use DuckDB joins, aggregates, window functions, and CTEs for rankings and time-series analysis. Item groups can overlap their members even...
canvas_idstringrow_limitintegersql*stringfaostat_dataframe_describeList the canvas tables (faostat_xxxxxxxx) staged by faostat_query_observations and faostat_commodity_profile, each with its source tool, the query parameters that produced it, creation/expiry timestamps, row count, and column schema. Call this before faostat_dataframe_query to...4 params
List the canvas tables (faostat_xxxxxxxx) staged by faostat_query_observations and faostat_commodity_profile, each with its source tool, the query parameters that produced it, creation/expiry timestamps, row count, and column schema. Call this before faostat_dataframe_query to...
canvas_idstringlimitintegernamestringoffsetintegerSponsors
Configuration
FAOSTAT_DOMAINSdefault: QCL,TCL,FBS,FS,RL,GLE,RFN,QVComma-separated FAOSTAT domain codes to index into the local mirror.
FAOSTAT_MIRROR_PATHdefault: ./.faostat-mirrorDirectory holding the per-domain SQLite mirror databases and the shared dimension database.
FAOSTAT_BULK_BASE_URLdefault: https://bulks-faostat.fao.org/productionFAOSTAT bulk-download service base URL (manifest + per-domain ZIPs).
CANVAS_PROVIDER_TYPEdefault: duckdbDataCanvas engine for SQL over large result sets. Defaults to 'duckdb'; set 'none' to disable analytical staging.
FAOSTAT_DATAFRAME_DROP_ENABLEDdefault: falseSet to 'true' to make faostat_dataframe_drop callable, so a staged table can be dropped before its 2-hour TTL. Off by default: the tool is registered disabled.
MCP_LOG_LEVELdefault: infoSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
MCP_TRANSPORT_TYPEdefault: httpSelects the HTTP transport.
MCP_HTTP_HOSTdefault: 127.0.0.1The hostname for the HTTP server.
MCP_HTTP_PORTdefault: 3010The port to run the HTTP server on.
MCP_HTTP_ENDPOINT_PATHdefault: /mcpThe endpoint path for the MCP server.
MCP_AUTH_MODEdefault: noneAuthentication mode to use: 'none', 'jwt', or 'oauth'.
FAOSTAT_REFRESH_CRONCron expression for the in-process incremental mirror refresh (HTTP transport only). Omit to disable.
Readme
@cyanheads/faostat-mcp-server
Global food & agriculture statistics from the UN FAOSTAT bulk-download corpus, served from a local SQLite mirror with a DataCanvas SQL surface, via MCP. STDIO or Streamable HTTP.
Details
- Repository
- github.com/cyanheads/faostat-mcp-server
- Category
- Databases
- Package
@cyanheads/faostat-mcp-server- Transport
- STDIO, HTTP
- Registry
- MCP registry, active
- Resources
- 1
- Tools verified
- Nov 13, 2026
More from cyanheads
- National Parks Mcp Server3
- Federal Regulations Mcp Server2
- Calculator Mcp Server3
- Congressgov Mcp Server2
- Nws Weather Mcp Server2
- Obsidian Mcp Server705
- Toolkit Mcp Server20
- Nhtsa Vehicle Safety Mcp Server3
- Eur Lex Mcp Server12
- Hn Mcp Server7
- Git Mcp Server245
- Secedgar Mcp Server11
- Gdelt Mcp Server10
- Eurostat Mcp Server9
- Open Meteo Mcp Server13
- Pubchem Mcp Server13
- Gutenberg Mcp Server6
- Libofcongress Mcp Server6
- Orcid Mcp Server6
- Protein Mcp Server6
- Wikipedia Mcp Server6
- Cdc Health Mcp Server5
- Usaspending Mcp Server5
- Openstreetmap Mcp Server9