L'Atlas / MCP servers / un-comtrade-mcp-server
MCP server

un-comtrade-mcp-server

io.github.cyanheads/un-comtrade-mcp-server

MCP server OK 11 tools

Get a review See pricing

UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.

Technical sheet

Author
cyanheads (registry namespace)
Repository
github.com/cyanheads/un-comtrade-mcp-server
Site
—
Version
0.5.1
Transport
Streamable HTTP stdio
Authentication
None (observed by our test)
Server address
https://un-comtrade.caseyjhand.com/mcp Streamable HTTP
Packages
@cyanheads/un-comtrade-mcp-server 0.5.1 npm stdio
@cyanheads/un-comtrade-mcp-server 0.5.1 npm Streamable HTTP
Tools
11
Categories
—
Last updated
28 Nov 2026
Published
28 Nov 2026

Verified author and popularity

Entry not claimed yet. Is it your project? Claim it

Not “Popular” for now Removed automatically as soon as the criteria are no longer met.

  • Distinct visitors of this entry over 30 days: 0 (30 needed) not yet
  • or install configs copied over 30 days: 0 (5 needed) not yet
  • and a successful test less than 14 days old: tested 28 Nov 2026 met

Badge updates by itself. Always “tested on …”, never “certified”. How it works

MarkdownREADME.md
[![Status on L’Atlas](https://latlas.dev/badge/statut/mcp/io.github.cyanheads/un-comtrade-mcp-server.svg?lang=en)](https://latlas.dev/en/mcp/io.github.cyanheads/un-comtrade-mcp-server)
HTML
<a href="https://latlas.dev/en/mcp/io.github.cyanheads/un-comtrade-mcp-server"><img src="https://latlas.dev/badge/statut/mcp/io.github.cyanheads/un-comtrade-mcp-server.svg?lang=en" alt="Status on L’Atlas" height="20"></a>

Badge for your README

Listed on L’Atlas

Free, for every entry. It links back to this entry and shows “tested OK” as long as our latest test succeeded.

MarkdownREADME.md
[![Listed on L’Atlas](https://latlas.dev/badge/fiche/io.github.cyanheads/un-comtrade-mcp-server.svg?lang=en)](https://latlas.dev/en/mcp/io.github.cyanheads/un-comtrade-mcp-server)
HTML
<a href="https://latlas.dev/en/mcp/io.github.cyanheads/un-comtrade-mcp-server"><img src="https://latlas.dev/badge/fiche/io.github.cyanheads/un-comtrade-mcp-server.svg?lang=en" alt="Listed on L’Atlas" height="20"></a>

Our tests

Every week: initialize then tools/list, without credentials, never calling a tool. Method

Address
https://un-comtrade.caseyjhand.com/mcp
Last result
OK 28 Nov 2026, 09:17
Response time
1,242 ms (initialize + tools/list)
Protocol version
2025-11-25
Announced name
un-comtrade-mcp-server 0.5.0
Tools
11

History

DateResultResponseTools
28 Nov 2026, 09:17OK1,242 ms11

Exposed tools (11, from tools/list, 28 Nov 2026)

comtrade_lookup_countries

Lookup Countries / Areas

Resolve country and area names to Comtrade M49 numeric codes used in all data queries. Accepts a partial or full name, an official name (e.g. "Republic of Korea"), a common name (e.g. "UK", "Turkey"), or an ISO alpha-2/alpha-3 code (e.g. "USA", "US"), ignoring case and accents; exact matches are listed before partial ones. Returns matching entries with their numeric code, ISO identifiers, a validAsReporter flag, and validity dates; within the exact and partial groups, historical entities such as Fed. Rep. of Germany (...1990) are listed after current ones. World (code 0) is a valid partner but not a valid reporter, while some groupings, such as the European Union (97), do report — check validAsReporter. 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.

ParameterTypeRequiredDescription
querystringyesCountry or area to find by name, name fragment, official or common name, or ISO alpha-2/alpha-3 code. Case, accents and surrounding spaces are ignored. Name matching treats St and St. as Saint and accepts straight or curly apostrophes. Examples: "Germany", "DEU", "DE", "south korea", "Turkiye", "St…
roleenum: "reporter" | "partner" | "any"noFilter by role: "reporter" returns only codes valid for reporter_code; "partner" returns only codes valid for partner_code, which include World (0) but not reporter-only groupings such as the European Union (97) and ASEAN (975); "any" returns every match.
include_groupsbooleannoWhether to include regional and economic groupings (e.g. EU, ASEAN). Set to false to return only individual countries and groupings under which a match’s goods trade is published (490 Other Asia, nes for 158 Taiwan, Province of China).

comtrade_search_commodities

Search Commodity Codes

Find HS or SITC commodity codes by keyword, description, or code prefix. A code written with dots, spaces, or hyphens ("0901.11") matches 090111. Exact codes, code prefixes and contiguous description matches rank first, followed by descriptions containing every query term in any order. Default HS searches include historical codes and report which edition catalogs list each code. Use a trade row’s classificationCode or comtrade_get_data_availability to identify the edition, then search that edition for its descriptions. Keyless goods queries use HS for as-reported data. Continue with nextOffset using the same query, classification, and aggr_level.

ParameterTypeRequiredDescription
querystringyesKeyword, partial description, or commodity code prefix. Dots, spaces, and hyphens in a code are ignored, so "0901.11" finds 090111. Examples: "motor vehicles", "8471", "coffee", "84" (HS chapter 84 = machinery).
classificationstringnoGoods reference catalog, case-insensitive: HS uses the default HS.json discovery catalog, whose total identifies H6; it is not an authoritative historical-edition reference. Select H0–H6 for an explicit HS edition, or SS/S1–S4 for SITC.
aggr_levelnumber | number | number | number | number | numbernoNative aggregation level: HS uses 2 (chapter), 4 (heading), 6 (subheading); SITC uses 1–5. Omit to return all matching levels.
limitintegernoMaximum matching codes returned per page; defaults to 50.
offsetintegernoNumber of matching codes to skip; use nextOffset to continue.

comtrade_list_service_categories

List Service Trade Categories (EB)

List service trade categories from the combined EB catalog, including numeric EBOPS and SDMX codes. Returns category codes, descriptions, parent codes, and the EBOPS scheme catalogs that list each code: EB10 (EBOPS 2010), EB10S (EBOPS 2010 SDMX codes), EB02 (EBOPS 2002). Search by keyword or by several terms in any order, or browse direct children of a parent code; "200" lists the EB10 and EB02 top levels. Use the returned id as service_code in comtrade_get_services_trade. Code 3 is transport; SA is manufacturing services. Each page holds up to limit categories; continue with nextOffset using the same query and parent_code.

ParameterTypeRequiredDescription
querystringnoDescription keyword, phrase, whitespace-separated terms, or category code prefix. Description terms match case-insensitively in any order. Codes compare case-insensitively and keep their dots. Examples: "transport", "SA", "3.1", "insurance pension". Omit, or leave blank, to list all EB categories.
parent_codestringnoReturn direct children of this EB category code. Examples: "3" for transport sub-categories, "3.1" for sea transport sub-categories, or "200" for the EB10 and EB02 top-level categories.
limitintegernoMaximum categories returned per page; defaults to 100.
offsetintegernoNumber of matching categories to skip; use nextOffset to continue.

comtrade_get_trade_flows

Get Trade Flow Records

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. Follow nextOffset for remaining records; each page repeats the upstream period requests. Keyless preview makes one request per served period, at least 4 seconds apart, 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.

ParameterTypeRequiredDescription
limitintegernoRecords per page (default 25). Larger requests are limited to 1000 with a notice.
offsetintegernoNumber of retrieved records to skip.
reporter_codeinteger | array<integer>noM49 reporter code or nonempty array (input ceiling 200). Deduplicates and serves the first 20 reporters, disclosing the remainder; served codes of an array that return no records are listed in reportersWithoutRecords. Some codes are partners only (0 World, 250 Metropolitan France, 158 Taiwan, Provi…
flow_codestringyesTrade flow direction: M=imports, X=exports, RX=re-exports, RM=re-imports.
periodarray<string>yesOne or more periods to query, all annual "YYYY" (e.g. ["2022", "2023"]) or all monthly "YYYYMM" (e.g. ["202201", "202202"]); mixed lengths are rejected. Serves the first 8 distinct periods keyless (12 with authenticated access); the rest, and any period whose request is rate limited, fails on a UN…
partner_codeintegernoM49 code of the trade partner. Use 0 to aggregate across all partners (World total). Omitting it can return World alongside the partner breakdown.
cmd_codearray<string>noHS or SITC commodity codes to query. Serves the first 20 distinct codes and discloses the remainder; input ceiling 200. Pass ["TOTAL"] or omit to aggregate all commodities. Use comtrade_search_commodities for codes in the selected HS or SITC edition.
classificationstringnoGoods classification: HS as reported, H0–H6 with authenticated access, or SITC S1–S4/SS.
freqstringnoFrequency: A=annual YYYY, M=monthly YYYYMM (01–12). Omit to infer it from the periods; an explicit value must match them.

comtrade_get_trade_balance

Get Trade Balance

Compute the trade balance for a country over one or more periods — total exports minus total imports — with an optional HS or SITC commodity filter whose codes must not overlap. Keyless preview makes two requests per served period, at least 4 seconds apart; authenticated calls batch periods. Returns the export and import values per period and, when both flows have data, the signed balance (USD) 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.

ParameterTypeRequiredDescription
reporter_codeintegeryesM49 numeric code of the reporting country (0–999). A partner-only code (0 World, 250 Metropolitan France, 158 Taiwan, Province of China) with no data fails with partner_only_reporter, naming the code to query instead when one exists: 251 shares the ISO-3 identity of 250, and UN Comtrade publishes t…
partner_codeintegernoM49 partner code (0–999); defaults to World (0). The balance uses the reporter’s values. A partner code with a reporter-valid counterpart (840 → 842, 158 → 490) that returns no data fails with no_data naming that counterpart.
periodarray<string>yesPeriods, all annual (YYYY) or all monthly (YYYYMM); mixed lengths are rejected. Serves the first 4 distinct periods keyless (12 with authenticated access); the rest, and any period whose export or import request is rate limited, hits a UN Comtrade server error or network failure, or runs out of tim…
cmd_codearray<string>noHS or SITC commodity codes whose values the balance sums; omit for the overall balance across all commodities. Exact duplicates count once. Overlapping codes are rejected because their shared trade would be summed twice: a code beside one of its sub-codes (27 and 2709), TOTAL beside any other entry…
classificationstringnoGoods classification: HS/H0–H6 or SITC S1–S4/SS.
freqstringnoFrequency for both flows: A=annual YYYY, M=monthly YYYYMM (01–12). Omit to infer it from the periods; an explicit value must match them.

comtrade_get_top_partners

Get Top Trading Partners

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. Takes an HS or SITC code in the selected classification; omit cmd_code to rank partners for total trade.

ParameterTypeRequiredDescription
reporter_codeintegeryesM49 numeric code of the reporting country (0–999).
flow_codestringyesTrade flow: M=imports, X=exports.
periodstringyesSingle period: annual YYYY or monthly YYYYMM, month 01–12; frequency is inferred.
cmd_codestringnoSingle goods code in the selected classification: HS (e.g. "84", "8471") or SITC (e.g. "071"). Omit or pass "TOTAL" to rank partners for total merchandise trade.
classificationstringnoGoods classification: HS as reported, H0–H6 with authenticated access, or SITC S1–S4/SS.
limitintegernoNumber of top partners to return; totalPartners counts every partner retrieved.

comtrade_get_top_services_partners

Get Top Services Trading Partners

Rank partners of one reporter by trade value for a single annual EBOPS series. Omit service_code for total services, or use comtrade_list_service_categories to find one category. EB serves original reports, while EB10 and EB02 serve converted series. Shares divide by the sum of eligible retrieved partners before the display limit. Read coverageNotice before interpreting the ranking.

ParameterTypeRequiredDescription
reporter_codeintegeryesM49 numeric code of the reporting area (0–999).
flow_codestringyesTrade flow: M=imports, X=exports.
periodstringyesOne annual period, YYYY.
service_codestringnoOne EBOPS service code. Omit or pass blank for total services.
classificationenum: "EB" | "EB10" | "EB02"noEB for as-reported data (default), or EB10 or EB02 for UN Comtrade’s converted series.
limitintegernoNumber of partners to display. Counts and sums precede the display limit.

comtrade_get_top_reporters

Get Top Goods Reporters

Rank retrieved reporting areas by reported import or export value for one goods code and period. Partner 0 (World) ranks reporters by their trade with all partners. Use a bilateral partner to rank reporters by their trade with that area. Shares use the retrieved reporting areas before the display limit. Use comtrade_get_top_partners to rank the partners of one reporter.

ParameterTypeRequiredDescription
flow_codestringyesTrade flow: M=imports, X=exports.
periodstringyesOne annual YYYY or monthly YYYYMM period. Frequency is inferred.
cmd_codestringnoOne commodity code in the selected HS or SITC classification. Omit or pass TOTAL for total merchandise trade.
classificationstringnoGoods classification: HS as reported, H0–H6 with authenticated access, or SITC S1–S4/SS.
partner_codeintegernoM49 partner code (0–999). Defaults to World (0).
limitintegernoMaximum reporting areas displayed. Totals cover all eligible retrieved reporting areas.

comtrade_get_top_commodities

Get Top Trade Commodities

Rank HS chapters (2-digit) or headings (4-digit) by trade value for one reporter, flow, and annual or monthly period. Set parent_code and a deeper aggr_level to rank headings or subheadings within one chapter or heading. The tool uses matching TOTAL to identify the HS edition and queries explicit commodity codes in chunks, subdividing capped chunks. Shares use matching TOTAL or the reported parent value for a drill-down. Incomplete coverage returns available categories without ranks or shares and identifies unresolved codes. Defaults to World; optionally select one bilateral partner. Counterpart to comtrade_get_top_partners.

ParameterTypeRequiredDescription
reporter_codeintegeryesM49 numeric code of the reporting country (0–999).
flow_codestringyesTrade flow: M=imports, X=exports.
periodstringyesSingle period: annual (YYYY) or monthly (YYYYMM, month 01–12).
aggr_levelnumber | number | numbernoHS aggregation level: 2 = chapter, 4 = heading, 6 = subheading. Level 6 requires parent_code.
parent_codestringnoTwo-digit HS chapter or four-digit heading. Supply a deeper aggr_level. Blank is treated as omitted.
partner_codeintegernoM49 partner code (0–999) for a bilateral relationship; omit for World aggregate (0).
limitintegernoNumber of top commodity categories to return; totalCommodities counts every category retrieved.

comtrade_get_data_availability

Check Data Availability

Check which reporter/period/classification combinations have published data before querying trade. Returns datasets ordered by reporter code, newest period first within each reporter, with classification, record count and release dates where available. Annual data is typically published 3–12 months after the reference year and some reporters skip years. Omit filters to browse the index, 50 rows by default. Continue with nextOffset using the same filters and limit.

ParameterTypeRequiredDescription
limitintegernoMaximum datasets returned per page; defaults to 50.
offsetintegernoNumber of matching datasets to skip; use nextOffset to continue.
reporter_codeintegernoM49 reporter code to check. Omit to browse availability across all reporters.
periodstringnoPeriod to check: YYYY (annual) or YYYYMM (monthly). Omit to see all available periods for the reporter.
freqstringnoFrequency: A=annual YYYY, M=monthly YYYYMM (01–12). Omit to infer it from period, or annual when period is omitted too; an explicit value must match period.
type_codestringnoTrade type: C=commodities (goods), S=services.
classificationstringnoClassification code filter (e.g. "HS", "H6", "EB10"). Omitted or blank defaults to HS for goods and EB10 for services.

comtrade_get_services_trade

Get Services Trade Data

Fetch annual international trade-in-services data. Classification EB (default) serves each reporter-period as reported, in its own scheme (EB10, EB10S or EB02 codes); EB10 or EB02 selects UN Comtrade's conversion of other schemes into that one. Each row names its classification and whether it is original or converted. Same bilateral structure as goods trade: returns flow value in USD, period, and reporter/partner/category metadata for each row. Follow nextOffset for remaining records; each page repeats the upstream period requests. Use comtrade_list_service_categories to find a service code and its scheme before querying. Keyless preview makes one request per served period, at least 4 seconds apart, capped at 500 records per request. Services coverage is more limited than goods trade.

ParameterTypeRequiredDescription
limitintegernoRecords per page (default 25). Larger requests are limited to 1000 with a notice.
offsetintegernoNumber of retrieved records to skip.
reporter_codeintegeryesM49 numeric code of the reporting country (0–999).
flow_codestringyesTrade flow: M=imports (debits), X=exports (credits).
periodarray<string>yesAnnual periods YYYY. Serves the first 8 distinct periods keyless (12 with authenticated access); the rest, and any period whose request is rate limited, fails on a UN Comtrade server error or network failure, or runs out of time, are listed in unservedPeriods. Input ceiling 120.
partner_codeintegernoM49 partner code. Use 0 for all partners combined (World). Omitting it can return World alongside the partner breakdown.
service_codestringnoService category code in one scheme: "7" (EB10), "SG" (EB10S) and "260" (EB02) are each financial services. Under EB a code returns rows only for periods reported in its scheme; comtrade_list_service_categories lists codes with their schemes. Omit to get every category the reporter reported, at mix…
classificationenum: "EB" | "EB10" | "EB02"noServices classification. EB (default): each reporter-period as reported, in its own scheme (EB10, EB10S or EB02 codes). EB10 or EB02: UN Comtrade's conversion of reports from other schemes into that one; reports made in it stay under EB. EB10S has no converted series; its rows are served only under…

Client compatibility

Based on the transports each client documents as supported; this is not a live test inside the client.

ClientDocumented transportsThis serverSource
Claude Codestdio Streamable HTTP SSEtransport accepteddoc
Claude (claude.ai, Claude Desktop, Cowork)stdio Streamable HTTP SSEtransport accepteddoc
ChatGPT (serveurs MCP personnalisés / plugins)Streamable HTTP SSEtransport accepteddoc
Cursorstdio Streamable HTTP SSEtransport accepteddoc
VS Code (GitHub Copilot)stdio Streamable HTTP SSEtransport accepteddoc
Windsurf (documentation redirigée vers Devin Local / Devin CLI)stdio Streamable HTTP SSEtransport accepteddoc
Gemini CLIstdio Streamable HTTP SSEtransport accepteddoc
OpenAI Codex (CLI, extension IDE, app)stdio Streamable HTTPtransport accepteddoc

Ready-to-copy configs

Remote address used: https://un-comtrade.caseyjhand.com/mcp. Formats taken from each client’s documentation.

Claude Code
claude mcp add --transport http un-comtrade-mcp-server https://un-comtrade.caseyjhand.com/mcp
Claude (claude.ai, Claude Desktop, Cowork)
Customize > Connectors > + Add > Add custom connector ; Name : un-comtrade-mcp-server ; URL : https://un-comtrade.caseyjhand.com/mcp
ChatGPT (serveurs MCP personnalisés / plugins)
chatgpt.com/plugins > + > Add custom MCP server ; Name : un-comtrade-mcp-server ; Server URL : https://un-comtrade.caseyjhand.com/mcp ; Create as a plugin
Cursor.cursor/mcp.json (projet) ou ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "un-comtrade-mcp-server": {
      "url": "https://un-comtrade.caseyjhand.com/mcp"
    }
  }
}
VS Code (GitHub Copilot).mcp.json à la racine du workspace, ou ~/.copilot/mcp-config.json ($COPILOT_HOME/mcp-config.json)
{
  "mcpServers": {
    "un-comtrade-mcp-server": {
      "type": "http",
      "url": "https://un-comtrade.caseyjhand.com/mcp",
      "tools": ["*"]
    }
  }
}
Windsurf (documentation redirigée vers Devin Local / Devin CLI).devin/mcp_config.json (projet), .devin/mcp_config.local.json (local), ~/.config/devin/mcp_config.json (utilisateur)
{
  "mcpServers": {
    "un-comtrade-mcp-server": {
      "url": "https://un-comtrade.caseyjhand.com/mcp"
    }
  }
}
Gemini CLI~/.gemini/settings.json (utilisateur) ou .gemini/settings.json (projet)
{
  "mcpServers": {
    "un-comtrade-mcp-server": {
      "httpUrl": "https://un-comtrade.caseyjhand.com/mcp"
    }
  }
}
OpenAI Codex (CLI, extension IDE, app)~/.codex/config.toml (ou .codex/config.toml pour un projet de confiance)
[mcp_servers.un-comtrade-mcp-server]
url = "https://un-comtrade.caseyjhand.com/mcp"

Cite this source

Writing an article or comparison? This entry distinguishes registry information from our measurements. Cite the permanent link and the test date; an OK result is not a security audit or an availability guarantee.

un-comtrade-mcp-server · L’Atlas · Tested on

Markdown
[un-comtrade-mcp-server — L’Atlas](https://latlas.dev/en/mcp/io.github.cyanheads/un-comtrade-mcp-server)
Test methodology and limitations

Source : Registre officiel MCP · retrieved 3 Dec 2026. L’Atlas adds no data beyond this source and its own tests.