Un Comtrade MCP Server
UN Comtrade trade flows, balances and partner rankings for goods and services
- Pricing
- Open source
- Platforms
- CLI, self-hosted, API
- Runs
- Locally or Remotely
- Version
- 0.4.0
- Listing updated
- today
Similar MCP servers
About Un Comtrade MCP Server
Un Comtrade MCP Server is an open-source MCP server for analytics and data. It can run locally on your machine or as a hosted remote server.
The server is organised around the questions trade analysts ask. Lookup tools turn country names into Comtrade M49 codes (accepting aliases like UK and ISO codes) and find HS or SITC commodity codes by keyword. Data tools then fetch bilateral flows with value, quantity and weight, compute a country's trade balance, and rank top partners, reporters or commodities.
It also covers services trade using EBOPS codes, and an availability check shows which reporter, period and classification combinations are published. Resources expose the country list and the HS hierarchy, and a workflow guide covers historical classifications and mirror analysis.
A Comtrade subscription key is optional. Without one, tools use the public preview endpoint, which is capped at 500 records. It can run over stdio or streamable HTTP, and a hosted instance is listed.
Install
Run in a terminal
claude mcp add --transport http un-comtrade-mcp-server https://un-comtrade.caseyjhand.com/mcpAdd to Settings → Connectors → Add custom connector
https://un-comtrade.caseyjhand.com/mcpAdd to ~/.cursor/mcp.json
{
"mcpServers": {
"un-comtrade-mcp-server": {
"url": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}Add to .vscode/mcp.json
{
"servers": {
"un-comtrade-mcp-server": {
"type": "http",
"url": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"un-comtrade-mcp-server": {
"serverUrl": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"un-comtrade-mcp-server": {
"type": "http",
"url": "https://un-comtrade.caseyjhand.com/mcp"
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
COMTRADE_SUBSCRIPTION_KEYAzure API Management key from comtradedeveloper.un.org. Optional — without it, tools fall back to the public preview endpoint (500-record cap).MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').MCP_TRANSPORT_TYPESelects the HTTP transport.MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
Tools this server provides (10)
Taken from the project documentation; the running server may differ.
- comtrade_lookup_countries
- Resolve country and area names to Comtrade M49 numeric codes.
- comtrade_search_commodities
- Find HS or SITC commodity codes by keyword, description or prefix.
- comtrade_list_service_categories
- Find service trade categories tagged with their EBOPS schemes.
- comtrade_get_trade_flows
- Fetch bilateral trade flow records with value, quantity and weight.
- comtrade_get_trade_balance
- Compute a country's trade balance across one or more periods.
- comtrade_get_top_partners
- Rank trading partners by trade value.
- comtrade_get_top_reporters
- Rank reporting areas by goods trade value.
- comtrade_get_top_commodities
- Rank commodity categories by trade value.
- comtrade_get_data_availability
- Check which reporter, period and classification combinations have data.
- comtrade_get_services_trade
- Fetch international trade-in-services data.
What it does
- Country and code lookup
- Resolves country names, aliases and ISO codes to Comtrade M49 codes.
- Commodity search
- Finds HS or SITC codes by keyword or code prefix.
- Trade flows
- Fetches bilateral value, quantity and weight by period and partner.
- Rankings and balances
- Ranks partners, reporters and commodities and computes export minus import balance.
- Services trade
- Returns trade-in-services data by EBOPS category.
Good for
- Compute a country's trade balance over several years
- Find the top export partners for a commodity
- Look up the HS code for a product
- Check data availability before building a report
- Compare reported and mirror trade statistics
Pricing
Open source
Free; optional Comtrade subscription key lifts the 500-record preview cap
Un Comtrade MCP Server FAQ
Do I need an API key?
It is optional. Without a subscription key the preview endpoint caps results at 500 records.
How many tools are there?
Ten tools and three resources.
Does it cover services?
Yes, through EBOPS-coded services trade tools.
Is there a hosted instance?
Yes, at un-comtrade.caseyjhand.com.
Is Un Comtrade MCP Server free?
Yes. Un Comtrade MCP Server is open source, so you can use and self-host it for free.
How do I add Un Comtrade MCP Server to Claude Code?
Run this command in your terminal: claude mcp add --transport http un-comtrade-mcp-server https://un-comtrade.caseyjhand.com/mcp
What are the best alternatives to Un Comtrade MCP Server?
The closest alternatives to Un Comtrade MCP Server are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, dashboard-icons, Tapetide - Indian Stock Market MCP and World Monitor.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

