Un Comtrade MCP Server
UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.
Connect it
Settings → Connectors → Add custom connector
URL: https://un-comtrade.caseyjhand.com/mcpSettings → Apps & Connectors → Advanced → Developer mode
Create connector with URL: https://un-comtrade.caseyjhand.com/mcp{
"mcpServers": {
"un-comtrade-mcp-server": {
"url": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}claude mcp add --transport http un-comtrade-mcp-server https://un-comtrade.caseyjhand.com/mcp{
"servers": {
"un-comtrade-mcp-server": {
"type": "http",
"url": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}{
"mcpServers": {
"un-comtrade-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/un-comtrade-mcp-server@0.2.0"
]
}
}
}claude mcp add un-comtrade-mcp-server -- npx -y @cyanheads/un-comtrade-mcp-server@0.2.09 tools, pulled live
comtrade_lookup_countriesread-onlyResolve 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
comtrade_search_commoditiesread-onlyFind 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 re
comtrade_list_service_categoriesread-onlyList 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.
comtrade_get_trade_flowsread-onlyFetch 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 commod
comtrade_get_trade_balanceread-onlyCompute 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
comtrade_get_top_partnersread-onlyRank 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
comtrade_get_top_commoditiesread-onlyRank 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.
comtrade_get_data_availabilityread-onlyCheck 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
comtrade_get_services_traderead-onlyFetch 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 li
Alternatives in Developer Tools
Compare →LALabelhead Artist MomentumA
Trending hip-hop artist momentum scores across four cultural dimensions.
TLTldrawA
Draw and visually collaborate with your agents on tldraw's canvas.
SHShipSwiftA
40+ production-ready SwiftUI recipes for building full-stack iOS apps via MCP.
SESemioticA
Verified React chart generation: select, validate, repair, render, and inspect charts through MCP.
KLKorean Law MCPA
Korean law: statutes, precedents, ordinances, treaties and citation verification (법제처 API).
amCharts 5A
On-demand access to amCharts 5 docs, code examples, and API reference