io. github. cyanheads/ un-comtrade-mcp-server
by cyanheads · remote · local (npm) · no sign-in to list tools · v0.2.0 · published by GitHub user cyanheads
UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.
9 tools: 9 only read.
Scanned Oct 21, 2026
- Deletes or cancels0Claude Code: deny
- Can't be undone0Claude Code: ask
- Changes things0Claude Code: ask
- Only reads9Claude Code: allow: see these tools
No check matched anything in the tool definitions. No finding is not a safety guarantee. How the checks work.
claude mcp add --transport http un-comtrade https://un-comtrade.caseyjhand.com/mcpTools
Open a tool for its reasons and full description. Descriptions are the publisher's own words, shown as they are.
9 tools
Only reads 9Claude Code: allow
comtrade_get_data_availabilityCheck which reporter/period/classification combinations have published data before constructing expensive trade queries.No findings
Why it is in this group
- The name "comtrade_get_data_availability" says "get": a word for reading.
Description, as the server wrote it Check which reporter/period/classification combinations have published data before constructing expensive trade queries. Returns dataset records with period, classification, record count, and first/latest release dates. Call this before querying recent periods — annual data is typically published 3–12 months after the reference year and not all countries report every year. Omit all parameters to browse the full availability index.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: false
comtrade_get_services_tradeFetch international trade-in-services data (EBOPS 2010 classification).No findings
Why it is in this group
- The name "comtrade_get_services_trade" says "get": a word for reading.
Description, as the server wrote it Fetch international trade-in-services data (EBOPS 2010 classification). Same bilateral structure as goods trade: returns flow value in USD, period, and reporter/partner/category metadata for each row. Use comtrade_list_service_categories to find the right service code before querying. Preview makes one paced request per served period, capped at 500 records per request. Services coverage is more limited than goods trade.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: true
comtrade_get_top_commoditiesRank commodity categories for a reporter by trade value for a given flow direction and period.No findings
Why it is in this group
- The name "comtrade_get_top_commodities" says "get": a word for reading.
Description, as the server wrote it Rank commodity categories for a reporter by trade value for a given flow direction and period. Returns the top N HS chapters (2-digit) or headings (4-digit) sorted by descending value — answers "what does country X mainly export?" or "what does country X mainly import?". Symmetric counterpart to comtrade_get_top_partners. Optionally filter to a single partner country.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: true
comtrade_get_top_partnersRank trading partners for a reporter by trade value for a given commodity and flow direction.No findings
Why it is in this group
- The name "comtrade_get_top_partners" says "get": a word for reading.
Description, as the server wrote it Rank trading partners for a reporter by trade value for a given commodity and flow direction. Returns the top N partners sorted by descending value — answers "who does country X mainly export product Y to?" or "where does country X mainly import product Z from?" for a single period. Fetches a disaggregated breakdown across all partners then sorts locally. Omit cmd_code to rank partners for total trade.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: true
comtrade_get_trade_balanceCompute the trade balance for a country over one or more periods — total exports minus total imports — with optional HS or SITC commodity filter.No findings
Why it is in this group
- The name "comtrade_get_trade_balance" says "get": a word for reading.
Description, as the server wrote it Compute the trade balance for a country over one or more periods — total exports minus total imports — with optional HS or SITC commodity filter. Preview makes two paced requests per served period; authenticated calls batch periods. Returns the signed balance (USD), export value, import value, and coverage ratio (exports / imports). Note: mirror asymmetry is common — balance reflects values as reported by this country; the same flow may be recorded differently by the partner. Uses comtrade_lookup_countries to resolve reporter codes.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: true
comtrade_get_trade_flowsFetch bilateral trade flow records — the primary data retrieval tool.No findings
Why it is in this group
- The name "comtrade_get_trade_flows" says "get": a word for reading.
Description, as the server wrote it Fetch bilateral trade flow records — the primary data retrieval tool. Returns trade value in USD (primaryValue — FOB for exports, CIF for imports), quantity, net weight, and period/commodity/partner metadata for each row. Accepts multiple periods and commodity codes per call; pass partner_code 0 to get totals aggregated across all partners. Omit cmd_code or pass "TOTAL" to aggregate all commodities. Preview makes one paced request per served period, with a 500-record cap per request. Use comtrade_lookup_countries to resolve reporter/partner codes and comtrade_search_commodities to resolve HS codes. For SITC, supply codes from the selected SITC revision.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: true
comtrade_list_service_categoriesList EBOPS 2010 service trade categories — the equivalent of comtrade_search_commodities for the services domain.No findings
Why it is in this group
- The name "comtrade_list_service_categories" says "list": a word for reading.
Description, as the server wrote it List EBOPS 2010 service trade categories — the equivalent of comtrade_search_commodities for the services domain. Returns category codes, descriptions, and parent codes. Filter by keyword to find a specific service type (e.g. "transport", "financial", "travel"), or browse from a parent category code. Use the returned id as service_code in comtrade_get_services_trade.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: false
comtrade_lookup_countriesResolve country and area names to Comtrade M49 numeric codes used in all data queries.No findings
Why it is in this group
- The name "comtrade_lookup_countries" says "lookup": a word for reading.
Description, as the server wrote it Resolve country and area names to Comtrade M49 numeric codes used in all data queries. Accepts a partial name, full name, or ISO alpha-2/alpha-3 code (e.g. "United States", "USA", "US"). Returns matching entries with their numeric code, ISO identifiers, and a validAsReporter flag — regional groupings like "World" (code 0) are valid partners but not valid reporters. Use this before any trade data tool that requires reporter_code or partner_code. To aggregate across all partners, use partner code 0 (World) — no lookup needed.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: false
comtrade_search_commoditiesFind HS commodity codes by keyword, partial description, or known code prefix.No findings
Why it is in this group
- The name "comtrade_search_commodities" says "search": a word for reading.
Description, as the server wrote it Find HS commodity codes by keyword, partial description, or known code prefix. Returns matched codes at the requested aggregation level (2-, 4-, or 6-digit) with full descriptions, parent code, leaf status, and a recommended_query_code field indicating the best code level for subsequent trade queries (2-digit chapter for broad analysis, 4- or 6-digit for specific products). This is the critical resolution step — agents cannot derive HS codes from product names without this tool. Use aggr_level 2 to start broad; narrow with aggr_level 4 or 6 once you have a chapter. To get all commodities for an entire chapter, pass the 2-digit code as cmd_code in trade tools.
Annotations the server declares
- readOnlyHint: true
- openWorldHint: false
This is not a safety rating, and no finding is not a safety guarantee. The groups and findings come from fixed checks of the tool definitions the server returned on the date shown, not from its code or what it does when called. How the checks work.
Install
Pinned to version 0.2.0. Values in angle brackets are yours to fill in.
claude mcp add --transport http un-comtrade https://un-comtrade.caseyjhand.com/mcpRun in a terminal.
Claude Code permissions
Allow the reads, ask before a change, deny the deletes. Paste into .claude/settings.json.
{
"permissions": {
"allow": [
"mcp__un-comtrade__comtrade_lookup_countries",
"mcp__un-comtrade__comtrade_search_commodities",
"mcp__un-comtrade__comtrade_list_service_categories",
"mcp__un-comtrade__comtrade_get_trade_flows",
"mcp__un-comtrade__comtrade_get_trade_balance",
"mcp__un-comtrade__comtrade_get_top_partners",
"mcp__un-comtrade__comtrade_get_top_commodities",
"mcp__un-comtrade__comtrade_get_data_availability",
"mcp__un-comtrade__comtrade_get_services_trade"
],
"ask": [],
"deny": []
}
}Tools that only read are allowed, tools that change things ask first, tools that delete or cancel are denied. It assumes the server is installed as un-comtrade. Review it before you use it.
