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.
Install / Use
claude mcp add cyanheads -- npx -y github:cyanheads/faostat-mcp-serverIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
SecuritySupported Platforms
Our assessment of faostat-mcp-server
faostat-mcp-server scores 83/100 on our quality scale, 896th of 1,116 Security skills we index.
Its MCP Server is 18 KB long, well organised into 23 sections with 8 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated today, so faostat-mcp-server is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-10-29. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
faostat-mcp-server compared with similar skills
All 4 of these similar skills score higher than faostat-mcp-server; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| faostat-mcp-server (this skill)by cyanheads | 83 | 3 | today | MCP Server |
| Agent-Reachby Panniantong | 100 | 105.7k | 4d ago | CLAUDE.md |
| claude-memby thedotmack | 100 | 104.1k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.2k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.7k | today | CLAUDE.md |
Frequently asked questions
- How do I install faostat-mcp-server?
- Run
claude mcp add cyanheads -- npx -y github:cyanheads/faostat-mcp-server. The install tabs above show the steps for each supported agent. - Which AI agents does faostat-mcp-server work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is faostat-mcp-server safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is faostat-mcp-server still maintained?
- The repository was last updated today, so faostat-mcp-server is actively maintained.
Skill content
View source on GitHubPublic Hosted Server: https://faostat.caseyjhand.com/mcp
</div>Overview
Global food and agriculture statistics from the UN's FAOSTAT: production, trade, food balances, food security, land use, fertilizer, and emissions for 245+ countries and territories since 1961. Resolve commodity and country codes, query the data, and run SQL over large results.
Tools
| 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_dataframe_drop | Drop one staged canvas table before its 2-hour TTL. Opt-in — callable only with FAOSTAT_DATAFRAME_DROP_ENABLED=true. |
Capability reference
faostat_list_domains <sub>tool</sub>
- Full FAOSTAT catalog (~69 domains) read live from the bulk manifest, annotated with local mirror status
codefor an exact domain lookup;topicsubstring filter over code/name/topic;indexed_onlyto list only domains queryable from the local mirroroffset+limit(max 200, default 20) page the catalog — response reportstotalMatches,truncated, andnextOffset- Each entry reports
indexed/index_readyflags, local row count, and last completed sync
faostat_resolve_codes <sub>tool</sub>
- FTS5 full-text
query, substringname_contains, or exactcodelookup within adimension:area,item, orelement - Item/element matches are scoped to codes present in the given
domain's cube; area codes are shared across domains - Every area match is flagged
countryoraggregate(codes ≥ 5000, plus curated sub-threshold roll-ups such as China=351) limit(max 200, default 50) +offsetpage the match set- Typed errors:
unknown_domain,index_not_ready,query_timeout
faostat_query_observations <sub>tool</sub>
- Filters by
area_codes/item_codes/element_codesand an inclusiveyear_start/year_endrange - Aggregate regions excluded by default (
include_aggregates: false); explicitarea_codesbypass the exclusion limitcaps the inline page (default 200, max 1000); a match that exceeds it spills in full to a DataCanvas table (50,000-row staging cap) —faostat_dataframe_describefor its columns, then SQL viafaostat_dataframe_query- Every row carries its data-quality
flag(A/E/I/B/M/T/X, others per domain) — never dropped - Typed errors:
domain_not_indexed,index_not_ready,canvas_disabled,canvas_not_found,invalid_year_range,query_timeout
faostat_commodity_profile <sub>tool</sub>
- Selects one QCL item with
item_codeoritem_query(code takes precedence), then ranks top producers/exporters/importers and returns an annual production trend - Query selection prefers a unique exact label after trimming, collapsing whitespace, and case folding; otherwise requires a unique relevance match. For ambiguous terms such as
maizeormilk, callfaostat_resolve_codeswithdomain: "QCL",dimension: "item", and the query, then pass the selecteditem_code(e.g.56for maize grain) - Rankings are per-country sums grouped by unit, each country at its own latest reporting year; countries only (aggregates excluded)
- Returns a partial, production-only profile with a notice — rather than failing — when the trade domain (TCL) isn't indexed or still syncing
top_ncaps each ranked list (max 50); when the merged observation set is too large to inline it spills to a DataCanvas table —faostat_dataframe_describefor its columns, thenfaostat_dataframe_queryfor further SQL- Every staging outcome is stated in the notice: the staged table, a set that fit inline, a staging failure, or a disabled canvas
- Typed errors:
missing_item,ambiguous_item,no_match,domain_not_indexed,index_not_ready,invalid_year_range,canvas_not_found,query_timeout
faostat_dataframe_query <sub>tool</sub>
- Single-statement read-only
SELECTover stagedfaostat_xxxxxxxxtables — joins, aggregates, window functions, and CTEs all work - Writes, DDL,
DROP,COPY,PRAGMA,ATTACH, external-file functions, and system catalogs (information_schema,sqlite_master,duckdb_*) are rejected - Engine-setting introspection,
query_table, dynamicquery()SQL, and file table references are rejected;query()with a single literal read-onlySELECTremains supported row_limitcaps the response (default 1000, max 10000);truncatedmeans more rows exist, with no exact total computed on this path- Typed errors:
canvas_disabled,canvas_not_found,missing_table,system_catalog_access,invalid_sql
faostat_dataframe_describe <sub>tool</sub>
- Lists staged tables with source tool, query params, row count, column schema, and recorded creation/expiry timestamps
namedescribes one table outright; otherwiseoffset+limit(max 100, default 20) page the listing newest-first- Typed errors:
canvas_disabled,canvas_not_found,missing_table
faostat_dataframe_drop <sub>tool</sub>
- Opt-in: registered disabled — listed on the landing page with its enable hint, absent from
tools/list— unlessFAOSTAT_DATAFRAME_DROP_ENABLED=true - Drops one staged
faostat_xxxxxxxxtable and its provenance from the session canvas, or from the canvas acanvas_idnames - Idempotent: a name not staged on that canvas returns
dropped: falsewith a notice and changes nothing - Typed errors:
canvas_disabled,canvas_not_found
Features
The faostat-guide covers comparable reporting years, country versus regional totals, units, coverage, and complete SQL analysis across staged results. It ships with plugin, npm, Docker, and MCPB installs and is served through the MCP Skills extension as a skill resource.
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
FAOSTAT-specific:
- Persistent local SQLite mirror of the FAOSTAT bulk corpus via the framework
MirrorService, with FTS5 over the dimension labels driving code resolution - Streaming bulk-ZIP ingester — skips domains whose upstream update date hasn't advanced, and stream-parses the normalized CSV into SQLite without materializing the full file in memory
- Config-driven domain selection (
FAOSTAT_DOMAINS) — the indexed set can grow without code changes, and the full catalog stays browsable regardless - DataCanvas SQL surface (DuckDB) for
GROUP BY, ranking, and time-series analysis over spilled result sets
Agent-friendly output:
- Country-vs-aggregate classification on every area, with aggregates excluded from sums by default — guards against double-counting World/continent rows with their member countries
- Data-quality provenance — every observation carries its FAOSTAT flag (
A/E/I/B/M/T/X, others per domain), never dropped from output - Graceful partial results —
faostat_commodity_profilereturns a production-only profile with a notice, rather than failing, when the trade domain isn't indexed - Typed error contracts —
index_not_ready,domain_not_indexed,canvas_disabled, and others each carry a concrete recovery hint
Getting started
Connect to the hosted instance, no install:
claude mcp add --transport http faostat-mcp-server https://faostat.caseyjhand.com/mcp
Or run it locally after building the mirror:
claude mcp add faostat-mcp-server -- npx -y @cyanheads/faostat-mcp-server
For other clients, add this to the MCP config file:
{
"mcpServers": {
"faostat-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/faostat-mcp-server"]
}
}
}
The bulk-download service is public and keyless. For Docker or a source build, see Running the server.
Configuration
| Variable | Description | Default |
|:---------|:------------|:--------|
| FAOSTAT_DOMAINS | Comma-separated FAOSTAT domain codes to index into the local mirror. Domains outside this set appear in faostat_list_domains but are not queryable until added and re-synced. | QCL,TCL,FBS,FS,RL,GLE,RFN,QV |
| FAOSTAT_MIRROR_PATH | Directory holding the per-domain SQLite stores and the shared dimension database. Created if absent. | ./.faostat-mirror |
| FAOSTAT_BULK_BASE_URL | FAOSTAT bulk-download service base URL (manifest + per-domain ZIPs). | https://bulks-faostat.fao.org/production |
| FAOSTAT_REFRESH_CRON | Cron for the in-process incremental refresh (HTTP transport only). Omit to disable and run mirror:refresh out-of-band. | — |
| CANVAS_PROVIDER_TYPE | DataCanvas engine. duckdb enables the SQL surface; set none to disable analytical staging (the dataframe_* tools then report canvas_disabled and large queries
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
105.7kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
claude-mem
104.1kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
headroom
78.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.7kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
