MCP.Market

Comtrade MCP server

online · 100% uptime
by pipeworx-io·io.github.pipeworx-io/comtrade·v0.2.1

Comtrade MCP — UN Comtrade API for international bilateral trade data

A87/100grade A
What users say
No reviews yet
Be the first
Safety scan
A87/100

not scanned yet

Adoption
Growing

0 stars

Reviews

Write one

Nobody has reviewed Comtrade yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

Comtrade tools

Tool list not cached yet. `describe` through the gateway fetches it live.

Not scanned yet. New listings are scanned within a day or two of arriving.

How Comtrade compares

Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
87/100
higher than 73% of 48,255 servers
Uptime
100%
of our recent checks; the typical remote server answers 100%
Response time
153 ms
faster than 72% of 30,031 servers

Release history: 8 versions in the registry since 2026-04-22, latest 2026-10-31, typically one every 3 days.

Install Comtrade in Claude Code, Cursor or VS Code

claude mcp add --transport http comtrade https://gateway.pipeworx.io/comtrade/mcp
Add to Cursor

What the publisher says

From the Comtrade repository's README, as published. We do not edit it. Read it on GitHub

UN Comtrade — Bilateral Trade Statistics

The United Nations Statistics Division's Commodity Trade Database. Bilateral trade flows between every reporting country and every partner country, broken down by commodity (HS codes), going back decades. The standard source for "who exports what to whom" at country level.

Part of Pipeworx — an MCP gateway connecting AI agents to 1679+ live data sources.

Why this matters for AI agents

If an agent is answering anything about international trade — bilateral relationships, commodity flows, tariffs in context, supply-chain concentration — Comtrade is the source. The data is structured (HS codes) and harmonized across countries, making cross-country comparison reliable.

Common flows:

  • Bilateral analysis. "US-China trade flows in 2024." → comtradetradedata({reportercode: "842", partnercode: "156", year: "2024"}) → imports + exports + balance.
  • Top commodities. "What does the US import most from China?" → comtradetopcommodities({reportercode, partnercode, flow: "M"}).
  • Top partners. "Who are the top buyers of US semiconductors?" → comtradetoppartners({reportercode, hscode: "8542", flow: "X"}).
  • Country code lookup. ISO 3-digit numeric codes — comtradecountrycodes returns the full mapping.

Used by the tradebilateralanalysis and tradecountryprofile compounds.

Auth

Comtrade has free and premium tiers. The free tier is heavily rate-limited (a few requests per minute). For higher volumes, register at https://comtradeplus.un.org and pass an API key via _apiKey.

Country and commodity codes

comtradecountrycodes returns the full mapping. Most agents pass the 3-digit numeric to avoid name-disambiguation problems.

Update cadence

Comtrade releases data with a substantial lag — typically 6–12 months after the calendar year. The most recent year you can query is usually last calendar year. Pipeworx caches with 30-day TTL since this data is essentially static once published.

Common pitfalls

  • Reporter vs. partner mirror data. Both sides of a trade report it (the US reports imports from China; China reports exports to the US). Numbers don't perfectly match — different valuation methods (CIF vs FOB), shipping treatment, classification differences. Reporter-side is the convention; if you need both, request both.
  • HS revision changes. The HS classification updates every 5 years (HS17, HS22, etc.). Long time-series straddle revisions; codes for the same commodity can shift. Comtrade harmonizes for you in standard queries.
  • Service trade NOT included. Comtrade is goods only. Service trade lives separately (BEA / WTO data). Don't conflate.
  • Re-exports. Hong Kong's "exports to the US" include massive re-exports of Chinese-origin goods. The flow parameter distinguishes; use it explicitly.
  • Currency. Default values are USD — but check the unit field. Some series report quantity (kg, units) only without value.
  • Unreported pairs. Not every country reports to Comtrade every year. Cuba, Iran, North Korea have major gaps. Mirror data from partners can fill the holes — query the partner's reports of trade with that country.

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "comtrade": {
      "url": "https://gateway.pipeworx.io/comtrade/mcp"
    }
  }
}

What this endpoint actually serves

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

Comtrade: common questions

Is Comtrade MCP server safe?
Yes, by our scan: it is graded A (87/100). Read the Comtrade safety report
How do I install Comtrade?
It runs remotely at gateway.pipeworx.io. Add it to Claude Code, Cursor, VS Code or Claude Desktop with the snippets above, or call it through the mcp.market gateway without installing anything.
Does Comtrade need an API key?
Yes. The registry entry asks for PIPEWORX_API_KEY.
Is Comtrade maintained?
The last commit was 40 days ago (2026-09-24). The latest release is v0.2.1.
Is Comtrade up?
100% of our last 28 checks got an answer. We check remote servers about four times a day.
How does Comtrade compare with other MCP servers?
safety score 87/100 (higher than 73% of 48,255 servers); uptime 100% (of our recent checks; the typical remote server answers 100%); response time 153 ms (faster than 72% of 30,031 servers). Full comparison.

More from pipeworx-io →