World Trade MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
World Trade MCP
A provider-agnostic MCP server for querying official international trade, tariff, and macroeconomic datasets from one interface.
The project starts with four official data providers:
Provider | Coverage | Access |
UN Comtrade | Global merchandise and services trade by reporter, partner, product, and period | Anonymous preview (up to 500 rows); registered free API key unlocks the standard data API |
WTO Timeseries | Merchandise trade, services, tariffs, market-access and related indicators | Free API key |
World Bank Indicators | Trade, GDP, development and macro indicators | No API key |
Eurostat | EU trade and other European statistics | No API key |
ITC Trade Map is tracked as a future integration. ITC says its secure API is made available only in specific circumstances; this project will not scrape the Trade Map website or bypass its access controls. A user's Trade Map account does not automatically provide a general-purpose developer API.
What this server exposes
list_data_sources— provider coverage, credential status, and access notes.get_un_comtrade_trade_data— annual or monthly trade records. Uses the public preview automatically when no key is configured.get_un_comtrade_releases— latest Comtrade release information.get_wto_timeseries— WTO indicator time series.get_world_bank_indicator— World Bank country/indicator time series.get_eurostat_dataset— query a public Eurostat dataset using its dataset code and dimension filters.
Provider responses retain their source fields and include provenance metadata. Values from different providers are not silently merged because definitions, reporting bases, currencies, and revisions can differ.
Related MCP server: mcp-comtrade
Quick start
Requirements: Python 3.11+
git clone https://github.com/trehsan1-creator/world-trade-mcp.git
cd world-trade-mcp
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS / Linux
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .envAdd API keys to .env only if you have them. The World Bank and Eurostat tools work without credentials; Comtrade starts in public-preview mode.
Run the MCP server over stdio:
python -m world_trade_mcp.serverFor local MCP clients, configure the server command as python with argument -m world_trade_mcp.server, using the project directory as the working directory.
Environment variables
Variable | Required | Purpose |
| No | Enables the registered Comtrade data API instead of anonymous preview |
| No | Enables WTO Timeseries queries |
| No | HTTP timeout (default: 30) |
| No | Logging level (default: INFO) |
Never commit .env, API keys, cookies, or personal account credentials.
Example tool calls
UN Comtrade exports from China to the world, HS total, 2024:
reporter_code=156partner_code=0(world)period=2024flow_code=Xcmd_code=TOTAL
UN Comtrade imports into the United States from China for HS code 0901 in 2023:
reporter_code=842partner_code=156period=2023flow_code=Mcmd_code=0901
World Bank example indicator: NE.EXP.GNFS.CD (exports of goods and services, current US$).
Data quality and interpretation
Always retain provider, dataset/indicator, reporter, partner, product classification, period, unit, and source notes with a result.
Do not interpret mirror statistics as reporter-submitted statistics.
Do not compare values from different sources until units, coverage, valuation basis, and definitions have been checked.
Product codes are classification- and year-dependent (for example HS revisions); this server does not silently translate between HS editions.
A successful API response is not a guarantee that a country/product/period has reported data.
Development
pytest
ruff check .Official documentation
Roadmap
Add WITS / UNCTAD TRAINS adapter after endpoint and access behavior are validated.
Add national statistical APIs (starting with US Census and selected major trading economies).
Add HS nomenclature and country-code metadata helpers.
Add normalized cross-provider comparison with explicit unit and methodology checks.
Add optional REST/OpenAPI gateway and hosted deployment after the stdio MCP interface is tested.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.
Macroeconomic and other official data from 170+ publishers, resolved from natural language with provenance.
Discover, resolve, and query official Brazilian economic data with semantic search and provenance.
Comtrade MCP — UN Comtrade API for international bilateral trade data
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides query capabilities for global economic and social development data from the World Bank Open Data API.83 npm8MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to UN Comtrade international bilateral trade data via an MCP server, enabling AI agents to query trade statistics through natural language.88 npmMIT
- AlicenseAqualityCmaintenanceEnables querying Brazilian foreign trade data through MCP tools for trade flows, freight costs, code resolution, and dataset caveats, with known data defects corrected in responses.4MIT
- AlicenseAqualityBmaintenanceEnables querying international macro statistics, company identity data via LEI, and FX rates from dozens of free keyless providers through unified tools.12MIT