Faostat MCP Server logo

Faostat MCP Server

Queries UN FAOSTAT food and agriculture data through MCP, with code resolution, analytical profiles, pagination, and read-only SQL over staged result…

Install Faostat MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "faostat-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@cyanheads/faostat-mcp-server"
      ],
      "env": {
        "FAOSTAT_DATAFRAME_DROP_ENABLED": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env FAOSTAT_DATAFRAME_DROP_ENABLED=YOUR_VALUE_HERE --transport stdio faostat-mcp-server -- npx -y @cyanheads/faostat-mcp-server

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y @cyanheads/faostat-mcp-server

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

faostat-mcp-server connects MCP clients to a local SQLite mirror of the UN FAOSTAT bulk-download corpus. It helps agents discover statistical domains, resolve area, item, and element codes, query observations, and build commodity profiles covering production and trade. Large analytical results can be staged in DataCanvas tables and queried with read-only SQL. Reach for it when an agent needs structured food, agriculture, land-use, food-security, fertilizer, or emissions statistics across FAOSTAT domains.

Use cases

  • Discover FAOSTAT domains and local index availability
  • Resolve commodity, area, and element names into query codes
  • Compare production or trade observations across countries and years
  • Build a commodity profile with producers, trade flows, and trends
  • Run read-only SQL over staged analytical results

Key features

  • UN FAOSTAT data from a local SQLite mirror
  • Domain discovery and code resolution
  • Paged observation queries with filters and quality metadata
  • Commodity production and trade profiles
  • DataCanvas staging with read-only SQL
  • STDIO and Streamable HTTP transport

Tools7

What Faostat MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~336 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 84d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · @cyanheads/faostat-mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads1.8kPackage downloads in the last 30 days.
Last commit15d agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed7Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Faostat MCP Server works

What faostat-mcp-server does

faostat-mcp-server exposes UN FAOSTAT statistics through MCP, using a local SQLite mirror rather than querying the upstream service for every request. The catalog covers domains such as production, trade, food balances, food security, land use, fertilizer, and emissions, with data spanning more than 245 countries and territories from 1961 onward.

The workflow starts with domain discovery. Agents can then resolve natural-language names into the area, item, and element codes required by a query. Observation results include area M49 identifiers, source details where applicable, quality flags, units, and period information. Aggregate areas are excluded by default unless selected explicitly.

How it works

The server supports both STDIO and Streamable HTTP transport. A typical request first calls faostat_list_domains to identify a domain and check whether its local index is ready. faostat_resolve_codes narrows human terms to valid codes within that domain, after which faostat_query_observations retrieves filtered rows by area, item, element, source, and inclusive year range.

Queries return pages, with a maximum offset of 100,000. Results exceeding the requested page size can be staged in DataCanvas when that feature is enabled. The staged table can be inspected with faostat_dataframe_describe and queried using read-only SQL through faostat_dataframe_query. Staged tables expire after two hours.

faostat_commodity_profile provides a higher-level workflow for one commodity. It combines top producers, an annual production trend, and trade flows from the relevant production and trade domains. For live-animal items, the production-side element is Stocks; crops traded mainly as processed products can use a separate TCL trade item for trade rankings.

Setup and configuration

The package can be launched through npx using the @cyanheads/faostat-mcp-server package. Its published client configuration uses npx -y @cyanheads/faostat-mcp-server. Installation links are available for Claude Desktop, Cursor, and VS Code. A hosted MCP endpoint is also available at https://faostat.caseyjhand.com/mcp.

The optional FAOSTAT_DATAFRAME_DROP_ENABLED=true setting enables faostat_dataframe_drop, allowing a staged canvas table to be removed before its two-hour expiry. Without that opt-in setting, the drop operation is unavailable.

Tools and capabilities

  • Discover FAOSTAT domains, update dates, row counts, and local index status.
  • Resolve areas, items, and elements by text, code, or M49 code.
  • Query observations with year, source, area, item, and element filters.
  • Preserve qualifiers, quality flags, units, periods, and source-specific rows.
  • Generate commodity production and trade profiles.
  • Inspect staged canvas schemas and provenance.
  • Run read-only SQL SELECT statements against staged canvas tables.

Limitations and notes

Domain and item/element lookups depend on the relevant local index being ready. Observation pages contain at most 1,000 rows per call, and the query offset cannot exceed 100,000; narrower filters or year partitions are needed for deeper result sets. DataCanvas staging is capped at 50,000 rows. Source-specific observations should be compared separately rather than summed when multiple sources are returned. M49 identifiers follow FAO conventions and are not necessarily ISO numeric country codes.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Faostat MCP Server

faostat-mcp-server is an MCP server that connects AI clients to a local SQLite mirror of UN FAOSTAT food and agriculture statistics. Its main tools discover domains, resolve area/item/element codes, query observations, create commodity production and trade profiles, and run read-only SQL against staged DataCanvas results.

Install it through the npm package with `npx -y @cyanheads/faostat-mcp-server`. The project also provides installation links for Claude Desktop, Cursor, and VS Code, plus a hosted MCP endpoint at `https://faostat.caseyjhand.com/mcp`.

Yes, faostat-mcp-server provides a Cursor installation link. Cursor can launch the package with `npx -y @cyanheads/faostat-mcp-server`.

Start with `faostat_list_domains`, resolve valid area, item, and element codes using `faostat_resolve_codes`, then call `faostat_query_observations` with the domain, filters, and year range. Large matches can be staged for inspection and read-only SQL queries.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFaostat MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/faostat-mcp-server?style=directory)](https://allmcps.com/mcp/faostat-mcp-server)
HTML Embed
<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>