Power your agent
URL ของผู้เผยแพร่เอง ไม่ใช่เอนด์พอยต์ของ PlugMCP
Host a copy with our keys and logs.
https://faostat.caseyjhand.com/mcpปุ่ม Claude ด้านบนจะเปิด Claude พร้อมกรอกชื่อและ URL ให้แล้ว คุณยังต้องยืนยันที่นั่นเอง
claude mcp add --transport http io.github.cyanheads-faostat-mcp-server https://faostat.caseyjhand.com/mcpRun in a terminal.
{ "mcpServers": { "io.github.cyanheads-faostat-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://faostat.caseyjhand.com/mcp" ] } }}claude_desktop_config.json
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดPublic Hosted Server: https://faostat.caseyjhand.com/mcp
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.
faostat_list_domains toolcode for an exact domain lookup; topic substring filter over code/name/topic; indexed_only to list only domains queryable from the local mirroroffset + limit (max 200, default 20) page the catalog — response reports totalMatches, truncated, and nextOffsetindexed / index_ready flags, local row count, and last completed syncfaostat_resolve_codes toolquery, substring name_contains, or exact code lookup within a dimension: area, item, or elementdomain's cube; area codes are shared across domainscountry or aggregate (codes ≥ 5000, plus curated sub-threshold roll-ups such as China=351)limit (max 200, default 50) + offset page the match setunknown_domain, index_not_ready, query_timeoutfaostat_query_observations toolarea_codes / item_codes / element_codes and an inclusive year_start / year_end rangeinclude_aggregates: false); explicit area_codes bypass the exclusionlimit caps 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_describe for its columns, then SQL via faostat_dataframe_queryflag (A/E/I/B/M/T/X, others per domain) — never droppeddomain_not_indexed, index_not_ready, canvas_disabled, canvas_not_found, invalid_year_range, query_timeoutfaostat_commodity_profile toolitem_code or item_query (code takes precedence), then ranks top producers/exporters/importers and returns an annual production trendmaize or milk, call faostat_resolve_codes with domain: "QCL", dimension: "item", and the query, then pass the selected item_code (e.g. 56 for maize grain)top_n caps each ranked list (max 50); when the merged observation set is too large to inline it spills to a DataCanvas table — faostat_dataframe_describe for its columns, then faostat_dataframe_query for further SQLmissing_item, ambiguous_item, no_match, domain_not_indexed, index_not_ready, invalid_year_range, canvas_not_found, query_timeoutfaostat_dataframe_query toolSELECT over staged faostat_xxxxxxxx tables — joins, aggregates, window functions, and CTEs all workDROP, COPY, PRAGMA, ATTACH, external-file functions, and system catalogs (information_schema, sqlite_master, duckdb_*) are rejectedquery_table, dynamic query() SQL, and file table references are rejected; query() with a single literal read-only SELECT remains supportedrow_limit caps the response (default 1000, max 10000); truncated means more rows exist, with no exact total computed on this pathcanvas_disabled, canvas_not_found, missing_table, system_catalog_access, invalid_sqlfaostat_dataframe_describe toolname describes one table outright; otherwise offset + limit (max 100, default 20) page the listing newest-firstcanvas_disabled, canvas_not_found, missing_tablefaostat_dataframe_drop tooltools/list — unless FAOSTAT_DATAFRAME_DROP_ENABLED=truefaostat_xxxxxxxx table and its provenance from the session canvas, or from the canvas a canvas_id namesdropped: false with a notice and changes nothingcanvas_disabled, canvas_not_foundBuilt 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:
MirrorService, with FTS5 over the dimension labels driving code resolutionFAOSTAT_DOMAINS) — the indexed set can grow without code changes, and the full catalog stays browsable regardlessGROUP BY, ranking, and time-series analysis over spilled result setsAgent-friendly output:
A/E/I/B/M/T/X, others per domain), never dropped from outputfaostat_commodity_profile returns a production-only profile with a notice, rather than failing, when the trade domain isn't indexedindex_not_ready, domain_not_indexed, canvas_disabled, and others each carry a concrete recovery hintA public instance is available at https://faostat.caseyjhand.com/mcp — no installation required. It serves Streamable HTTP; each client takes its own configuration shape.
For Claude Code:
claude mcp add --transport http faostat-mcp-server https://faostat.caseyjhand.com/mcp
For Cline (cline_mcp_settings.json):
{
"mcpServers": {
"faostat-mcp-server": {
"type": "streamableHttp",
"url": "https://faostat.caseyjhand.com/mcp"
}
}
}
For Cursor (mcp.json):
{
"mcpServers": {
"faostat-mcp-server": {
"url": "https://faostat.caseyjhand.com/mcp"
}
}
}
Claude Desktop adds remote servers under Settings → Connectors.
Add the following to your MCP client configuration file. The server runs entirely on a local mirror, so build the mirror once before querying.
{
"mcpServers": {
"faostat-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/faostat-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"faostat-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/faostat-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"faostat-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-v", "faostat-mirror:/usr/src/app/.faostat-mirror",
"ghcr.io/cyanheads/faostat-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
No API key is required — the FAOSTAT bulk-download service is public and keyless.
QCL,TCL,FBS,FS,RL,GLE,RFN,QV, ∼37M rows) needs a few GB; TCL (∼17M rows) dominates and can be dropped from FAOSTAT_DOMAINS on a constrained host.git clone https://github.com/cyanheads/faostat-mcp-server.git
cd faostat-mcp-server
bun install
cp .env.example .env
# edit .env to override the default domain set, mirror path, or refresh cron
The corpus is not bundled. Before the data tools can answer queries, sync the selected domains into the local mirror:
bun run mirror:init # one-time bootstrap — downloads and indexes the FAOSTAT_DOMAINS set
bun run mirror:refresh # re-sync domains whose upstream update date has advanced; build missing planner statistics
bun run mirror:verify # report sync status, local row counts, and sample reads
mirror:init is idempotent and resumable per domain — re-running after an interrupt re-streams only the unfinished domain ZIP. FAOSTAT_DOMAINS selects which domains are indexed; everything else in the catalog shows in faostat_list_domains with indexed: false until added and re-synced. On HTTP transport, set FAOSTAT_REFRESH_CRON to refresh in-process on a schedule; on stdio, run mirror:refresh out-of-band. The read tools return index_not_ready until the first sync completes.
mirror:refresh also builds query-planner statistics (ANALYZE) for any selected domain that has none, even when its data is unchanged upstream — a mirror synced by an older release, or one whose last build failed. Otherwise the server builds them itself, in the background on a worker thread, the first time a data read touches that domain, and keeps answering meanwhile.
See .env.example for the full list of optional overrides.
Build and run:
# One-time build
bun run rebuild
# Run the built server
bun run start:stdio
# or
bun run start:http
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security
bun run test # Vitest suite under Bun, then under Node
bun run lint:mcp # Validate MCP definitions against spec
docker build -t faostat-mcp-server .
docker run --rm -p 3010:3010 -v faostat-mirror:/usr/src/app/.faostat-mirror faostat-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/faostat-mcp-server. A dedicated dependency stage installs the production tree for the target platform (DuckDB's prebuilt native binding included), so the slim runtime image carries no build toolchain and a multi-arch build never runs Bun under emulation. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them. Mount a volume at the mirror path to persist the corpus across container recreations, and bootstrap it inside the container:
docker exec <container> bun run mirror:init # one-time bootstrap
docker exec <container> bun run mirror:verify # sync status + sample reads
docker exec <container> bun run mirror:refresh # re-sync updated domains; build missing planner statistics
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
try/catch in tool logicctx.log for request-scoped logging, ctx.state for tenant-scoped storagecreateApp() array in src/index.tsData is sourced from FAOSTAT, the statistics division of the Food and Agriculture Organization of the United Nations (FAO). FAOSTAT data is published under CC BY-4.0; cite FAO as the source in downstream use. This project is not affiliated with or endorsed by the FAO.
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
Apache-2.0 — see LICENSE for details.
UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.
{ "mcpServers": { "io.github.cyanheads-faostat-mcp-server": { "url": "https://faostat.caseyjhand.com/mcp", "headers": {} } }}6 เครื่องมือ
FAQ
| 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 and returns units. Empty |
| faostat_commodity_profile | 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, otherwise a unique rele |
| faostat_dataframe_query | 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 with matching units; d |
| faostat_dataframe_describe | 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 discover the exact tab |
คัดลอกคอนฟิก http สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ผู้เผยแพร่ระบุตัวแปรสภาพแวดล้อมเหล่านี้: FAOSTAT_DOMAINS, FAOSTAT_MIRROR_PATH, FAOSTAT_BULK_BASE_URL, CANVAS_PROVIDER_TYPE, FAOSTAT_DATAFRAME_DROP_ENABLED, FAOSTAT_CLAMP_LIMITS, MCP_LOG_LEVEL, MCP_TRANSPORT_TYPE, MCP_HTTP_HOST, MCP_HTTP_PORT, MCP_HTTP_ENDPOINT_PATH, MCP_AUTH_MODE, FAOSTAT_REFRESH_CRON
Faostat เข้าถึงได้ผ่าน HTTP
ตรวจสอบล่าสุดเมื่อ 2026-11-09 UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.