{"name":"io.github.cyanheads/faostat-mcp-server","slug":"cyanheads-faostat-mcp-server","title":null,"description":"UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.","url":"https://mcp.market/server/cyanheads-faostat-mcp-server","rating":null,"grade":"A","score":86,"certified":false,"status":"active","category":"data","tags":["data"],"presence":{"score":36,"stars":2,"forks":0,"downloads_week":180,"last_push_at":"2026-09-19T17:20:13.000Z","license":"Apache-2.0"},"uptime":{"percent":100,"checks":1,"ok":1,"last_checked_at":"2026-09-19T17:26:21.971Z","last_ok_at":"2026-09-19T17:26:21.971Z","latency_ms":914},"claimed":false,"transport":"mixed","callable_via_gateway":true,"default_price_micros":0,"repository":"https://github.com/cyanheads/faostat-mcp-server","website":null,"version":"0.2.4","remotes":[{"type":"streamable-http","url":"https://faostat.caseyjhand.com/mcp"}],"packages":[{"registryType":"npm","registryBaseUrl":"https://registry.npmjs.org","identifier":"@cyanheads/faostat-mcp-server","version":"0.2.4","runtimeHint":"node","transport":{"type":"stdio"},"packageArguments":[{"value":"run","type":"positional"},{"value":"start:stdio","type":"positional"}],"environmentVariables":[{"description":"Comma-separated FAOSTAT domain codes to index into the local mirror.","format":"string","default":"QCL,TCL,FBS,FS,RL,GLE,RFN,QV","name":"FAOSTAT_DOMAINS"},{"description":"Directory holding the per-domain SQLite mirror databases and the shared dimension database.","format":"string","default":"./.faostat-mirror","name":"FAOSTAT_MIRROR_PATH"},{"description":"FAOSTAT bulk-download service base URL (manifest + per-domain ZIPs).","format":"string","default":"https://bulks-faostat.fao.org/production","name":"FAOSTAT_BULK_BASE_URL"},{"description":"Set to 'duckdb' to enable the DataCanvas SQL surface (default), or 'none' to disable analytical staging.","format":"string","default":"duckdb","name":"CANVAS_PROVIDER_TYPE"},{"description":"Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').","format":"string","default":"info","name":"MCP_LOG_LEVEL"}]},{"registryType":"npm","registryBaseUrl":"https://registry.npmjs.org","identifier":"@cyanheads/faostat-mcp-server","version":"0.2.4","runtimeHint":"node","transport":{"type":"streamable-http","url":"http://localhost:3010/mcp"},"packageArguments":[{"value":"run","type":"positional"},{"value":"start:http","type":"positional"}],"environmentVariables":[{"description":"The hostname for the HTTP server.","format":"string","default":"127.0.0.1","name":"MCP_HTTP_HOST"},{"description":"The port to run the HTTP server on.","format":"string","default":"3010","name":"MCP_HTTP_PORT"},{"description":"The endpoint path for the MCP server.","format":"string","default":"/mcp","name":"MCP_HTTP_ENDPOINT_PATH"},{"description":"Authentication mode to use: 'none', 'jwt', or 'oauth'.","format":"string","default":"none","name":"MCP_AUTH_MODE"},{"description":"Comma-separated FAOSTAT domain codes to index into the local mirror.","format":"string","default":"QCL,TCL,FBS,FS,RL,GLE,RFN,QV","name":"FAOSTAT_DOMAINS"},{"description":"Directory holding the per-domain SQLite mirror databases and the shared dimension database.","format":"string","default":"./.faostat-mirror","name":"FAOSTAT_MIRROR_PATH"},{"description":"FAOSTAT bulk-download service base URL (manifest + per-domain ZIPs).","format":"string","default":"https://bulks-faostat.fao.org/production","name":"FAOSTAT_BULK_BASE_URL"},{"description":"Cron expression for the in-process incremental mirror refresh (HTTP transport only). Omit to disable.","format":"string","name":"FAOSTAT_REFRESH_CRON"},{"description":"Set to 'duckdb' to enable the DataCanvas SQL surface (default), or 'none' to disable analytical staging.","format":"string","default":"duckdb","name":"CANVAS_PROVIDER_TYPE"},{"description":"Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').","format":"string","default":"info","name":"MCP_LOG_LEVEL"}]}],"tools":[{"name":"faostat_commodity_profile","description":"Assemble a global profile for one commodity in a single call: top-producing countries, the annual production trend, and trade flows (top exporters and importers). Accepts a commodity name, resolves it to item codes, then queries the production (QCL) and trade (TCL) domains and merges the results. Each ranking is a per-country sum across the resolved items, taken at that country's own latest year with data and grouped by unit so incomparable quantities are never added. The trend is returned inline as year/value points. Country-level only (aggregates excluded). When a required domain is not indexed locally, returns a partial profile with a notice naming the gap rather than failing. The full merged observation set spills to a DataCanvas table for deeper SQL via faostat_dataframe_query.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"item_query":{"type":"string","minLength":1,"description":"Commodity name to profile (e.g. \"maize\", \"wheat\", \"coffee green\"). Matched by relevance; the 5 best-matching items are folded into one profile, so a broad name such as \"milk\" is narrowed — the response discloses how many items matched in total."},"year_start":{"description":"Inclusive start year for the trend (e.g. 1990).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"year_end":{"description":"Inclusive end year for the trend (e.g. 2022).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"top_n":{"default":10,"description":"Number of top producers / exporters / importers to return. Max 50.","type":"integer","minimum":1,"maximum":50},"canvas_id":{"description":"Canvas ID to stage onto, as returned by a prior faostat_query_observations / faostat_commodity_profile call — exactly 10 characters of letters, digits, hyphens, and underscores. Omit to stage onto this session’s canvas, created on the first spill and reused by every later call, so tables staged earlier in the session sit alongside this one.","type":"string","pattern":"^[A-Za-z0-9_-]{10}$"}},"required":["item_query"],"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}},{"name":"faostat_dataframe_describe","description":"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 table and column names to reference in SQL. Tables are listed newest-first and paged: pass `name` to describe one table outright, or page with `offset` + `limit` — when the response reports `truncated`, pass the returned `nextOffset` to fetch the rest.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"canvas_id":{"description":"Optional canvas ID as returned by a prior faostat_query_observations / faostat_commodity_profile call — exactly 10 characters of letters, digits, hyphens, and underscores. Omit to list the tables staged in this session (the common case).","type":"string","pattern":"^[A-Za-z0-9_-]{10}$"},"name":{"description":"Optional table name (faostat_xxxxxxxx) to describe a single staged table. Takes precedence over `offset` / `limit`, which are ignored for a name lookup (always single-page).","type":"string"},"limit":{"default":20,"description":"Maximum staged tables to return on this page (max 100). Each entry carries a full column schema, so the default keeps a discovery call small.","type":"integer","minimum":1,"maximum":100},"offset":{"default":0,"description":"Zero-based pagination offset into the staged tables (newest first). When the response reports truncated, pass the returned nextOffset here to fetch the next page. Ignored for `name` lookups.","type":"integer","minimum":0,"maximum":9007199254740991}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}},{"name":"faostat_dataframe_query","description":"Run a single-statement SELECT against the canvas tables staged by faostat_query_observations and faostat_commodity_profile (table names look like faostat_xxxxxxxx). Use this for cross-country and cross-item aggregation, GROUP BY rankings, joins, and time-series analysis over the full result set the inline preview only sampled. Standard DuckDB SQL — joins, aggregates, window functions, CTEs all work. Read-only: writes, DDL, DROP, COPY, PRAGMA, ATTACH, and external-file table functions are rejected; system catalogs (information_schema, sqlite_master, duckdb_*) are denied — list staged tables via faostat_dataframe_describe. Every row carries its data-quality `flag` — commonly A=Official, B=time-series break, E=Estimated, I=Imputed, M=Missing (value cannot exist), T=Unofficial, X=from an international organization, plus others FAOSTAT defines per domain — keep it in projections, treat any unrecognized flag as informational, and never assume it is official.","write_action":true,"price_micros":0,"input_schema":{"type":"object","properties":{"canvas_id":{"description":"Optional canvas ID as returned by a prior faostat_query_observations / faostat_commodity_profile call — exactly 10 characters of letters, digits, hyphens, and underscores. Omit to query the tables staged in this session (the common case).","type":"string","pattern":"^[A-Za-z0-9_-]{10}$"},"sql":{"type":"string","minLength":1,"description":"Single-statement read-only SELECT against staged faostat_<id> tables. Columns: area_code, area, item_code, item, element_code, element, year, unit, value, flag. CAST(value AS DOUBLE) for arithmetic."},"row_limit":{"default":1000,"description":"Hard cap on rows in the response. Default 1000, max 10000.","type":"integer","minimum":1,"maximum":10000}},"required":["sql"],"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}},{"name":"faostat_list_domains","description":"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 `indexed` flag tells you which domains are queryable right now; un-indexed domains exist in the catalog but must be added to FAOSTAT_DOMAINS and re-synced before faostat_query_observations can read them. The catalog runs to ~69 domains with long descriptions, so responses are paged: narrow with `topic` / `indexed_only`, pass `code` to fetch one domain outright, or page with `offset` + `limit` — when the response reports `truncated`, pass the returned `nextOffset` to fetch the rest.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"description":"Exact domain code lookup (e.g. \"RL\"), case-insensitive. Returns that one domain's full record on a single page. Takes precedence over `topic` / `indexed_only` when provided.","type":"string"},"topic":{"description":"Case-insensitive substring filter over domain code, name, and topic (e.g. \"trade\", \"emissions\", \"QCL\"). Omit to list the full catalog.","type":"string"},"indexed_only":{"default":false,"description":"When true, return only domains indexed in the local mirror (queryable now).","type":"boolean"},"limit":{"default":20,"description":"Maximum domains to return on this page (max 200 — above the catalog size, so raise it to fetch everything at once). Domain descriptions are long; the default keeps a browse call small.","type":"integer","minimum":1,"maximum":200},"offset":{"default":0,"description":"Zero-based pagination offset into the matching domains (code-sorted). When the response reports truncated, pass the returned nextOffset here to fetch the next page. Ignored for exact-code lookups (always single-page).","type":"integer","minimum":0,"maximum":9007199254740991}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}},{"name":"faostat_query_observations","description":"Query a FAOSTAT domain's data cube by area(s), item(s), element(s), and year range, returning observations (area, item, element, year, value, unit, and the data-quality flag). Resolve codes first with faostat_resolve_codes — the cube is unqueryable without them. Aggregate regions (World, continents, economic groupings) are EXCLUDED by default so a naive SUM does not double-count a region with its member countries; set include_aggregates=true to get the regional roll-ups, or pass explicit area_codes to query exactly what you name. Small result sets return inline; large ones spill to a DataCanvas table (returned canvas_id + table_name) for GROUP BY / ranking / time-series analysis via faostat_dataframe_query. Every row carries its flag — commonly A=Official, B=time-series break, E=Estimated, I=Imputed, M=Missing (value cannot exist), T=Unofficial, X=from an international organization, plus others FAOSTAT defines per domain — so honor it, treat any unrecognized flag as informational, and never assume an estimated, imputed, or unrecognized value is official.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"description":"FAOSTAT domain code (e.g. \"QCL\"). Must be indexed locally."},"area_codes":{"description":"Area codes from faostat_resolve_codes. When set, aggregates are NOT auto-excluded — the codes are honored verbatim.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"item_codes":{"description":"Item codes from faostat_resolve_codes.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"element_codes":{"description":"Element codes from faostat_resolve_codes (e.g. 5510 Production).","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"year_start":{"description":"Inclusive start year (e.g. 2000).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"year_end":{"description":"Inclusive end year (e.g. 2022).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"include_aggregates":{"default":false,"description":"When false (default), exclude aggregate-region rows (codes ≥ 5000 plus a few curated sub-threshold roll-ups such as China=351) so sums are not double-counted. Set true for World/continent/grouping roll-ups. Ignored when explicit area_codes are passed.","type":"boolean"},"limit":{"default":200,"description":"Max observations returned inline — also the preview size when the result stages to a canvas table. Rows past it are never dropped silently: a match larger than limit stages in full to a DataCanvas table (canvas_id + table_name), and when no table is staged the notice reports how many matched so you can raise limit or narrow the filters. Max 1000.","type":"integer","minimum":1,"maximum":1000},"canvas_id":{"description":"Canvas ID to stage onto, as returned by a prior faostat_query_observations / faostat_commodity_profile call — exactly 10 characters of letters, digits, hyphens, and underscores. Omit to stage onto this session’s canvas, created on the first spill and reused by every later call, so tables staged earlier in the session sit alongside this one.","type":"string","pattern":"^[A-Za-z0-9_-]{10}$"}},"required":["domain"],"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}},{"name":"faostat_resolve_codes","description":"Resolve human terms to the opaque integer codes faostat_query_observations needs, within a dimension: areas (countries/regions), items (commodities), or elements (metrics like production, yield, import quantity). Pass `query` for fuzzy full-text matching (\"maize\" → item 56), `name_contains` for a substring filter, or `code` for an exact-code lookup; omit all three to list the whole dimension. Item and element results are scoped to the requested domain — only codes present in that domain's cube are returned, so a resolved code is always queryable there (areas are shared across domains). Page large listings with `offset` + `limit`: when the response reports `truncated`, pass the returned `nextOffset` to fetch the next page. Every area match is flagged `country` or `aggregate` — aggregates (World, continents, economic groupings — codes ≥ 5000 plus a few curated sub-threshold roll-ups such as China=351, which sums mainland + Taiwan + Hong Kong + Macao) double-count if summed with their member countries, so resolve before querying and exclude aggregates unless you want the regional roll-up.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"description":"FAOSTAT domain code (e.g. \"QCL\"). Item and element resolution is scoped to the codes present in this domain's data; area code lists are shared across all indexed domains."},"dimension":{"type":"string","enum":["area","item","element"],"description":"Which dimension to resolve: \"area\" (countries/regions), \"item\" (commodities), or \"element\" (metrics)."},"query":{"description":"Full-text search term, FTS5-matched against the dimension labels with prefix matching (e.g. \"wheat\", \"import quantity\"). Relevance-ranked.","type":"string"},"name_contains":{"description":"Case-insensitive substring filter over the label. Used only when `query` is omitted.","type":"string"},"code":{"description":"Exact code lookup. Takes precedence over `query`/`name_contains` when provided.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":50,"description":"Maximum matches to return (max 200).","type":"integer","minimum":1,"maximum":200},"offset":{"default":0,"description":"Zero-based pagination offset into the match set. When the response reports truncated, pass the returned nextOffset here to fetch the next page. Ignored for exact-code lookups (always single-page).","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["domain","dimension"],"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false}}],"scan":{"score":86,"grade":"A","scanned_at":"2026-09-19T21:08:06.864Z","report":{"scannerVersion":"0.1.8","scannedAt":"2026-09-19T21:08:06.829Z","components":{"code":{"score":25,"max":25,"notes":["38 source files scanned","38 source files scanned"]},"reliability":{"score":20,"max":20,"notes":["remote reachable in 1294ms"]},"poisoning":{"score":15,"max":15,"notes":["6 tool descriptions checked"]},"auth":{"score":3,"max":15,"notes":["open endpoint exposes 1 write-action tools with no auth"]},"maintenance":{"score":15,"max":15,"notes":["last push 0 days ago"]},"identity":{"score":8,"max":10,"notes":["registry namespace matches repository owner","GitHub account older than a year"]}},"findings":[{"id":"auth.open-write","severity":"high","component":"auth","title":"Write-action tools reachable without authentication"}],"inputs":{"probes":[{"url":"https://faostat.caseyjhand.com/mcp","reachable":true,"authRequired":false,"latencyMs":1294,"serverInfo":{"name":"faostat-mcp-server","version":"0.2.4"}}],"packages":[{"registryType":"npm","identifier":"@cyanheads/faostat-mcp-server","version":"0.2.4","found":true,"license":"Apache-2.0","hasInstallScripts":false,"dependencyCount":7,"publishedAt":"2026-09-19T17:59:42.328Z","repositoryUrl":"git+https://github.com/cyanheads/faostat-mcp-server.git","weeklyDownloads":90},{"registryType":"npm","identifier":"@cyanheads/faostat-mcp-server","version":"0.2.4","found":true,"license":"Apache-2.0","hasInstallScripts":false,"dependencyCount":7,"publishedAt":"2026-09-19T17:59:42.328Z","repositoryUrl":"git+https://github.com/cyanheads/faostat-mcp-server.git","weeklyDownloads":90}],"repo":{"found":true,"owner":"cyanheads","repo":"faostat-mcp-server","archived":false,"pushedAt":"2026-09-19T17:20:13Z","stars":2,"forks":0,"openIssues":5,"ownerType":"User","ownerAvatarUrl":"https://avatars.githubusercontent.com/u/10339515?v=4","ownerCreatedAt":"2014-12-29T13:01:12Z","license":"Apache-2.0"},"icon":{"url":"https://avatars.githubusercontent.com/u/10339515?v=4&s=128","source":"registry"},"presence":{"stars":2,"forks":0,"downloadsWeek":180,"license":"Apache-2.0","lastPushAt":"2026-09-19T17:20:13.000Z","score":36}}}},"grade_history":[{"kind":"restore","fromGrade":"C","toGrade":"A","reason":"score 86: Write-action tools reachable without authentication","createdAt":"2026-09-19T21:08:08.343Z"}],"reviews":[]}