mcp-comex-brasil
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-comex-brasilCompare freight cost per kg from China to Brazil by air and sea in 2026"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-comex-brasil
MCP server for Brazilian foreign-trade data — with the dataset's traps corrected in the response.
Four tools that don't lie, instead of forty that don't know.
The problem this server solves
An MCP server that merely exposes a dataset hands the agent a clean API to a wrong number. The plumbing doesn't know the field lies.
Comex Stat — the official Brazilian foreign-trade database, published by the Foreign Trade Secretariat / Federal Revenue Service — has a defect that no documentation warns about:
Filtering the transport-mode field by
AÉREAreturns 139.6 million kg of Chinese imports in 2026 (Jan–Jul). Cross-referencing these same records with the clearance point, only 34.0 million (24%) passed through an airport. The other 89.7 million cleared at seaports and are ammonium sulfate and phosphatic fertilizers — cargo that does not fly, at US$0.29/kg freight.Uncorrected: air weight overstated 4.1× and freight per kg understated by 70%. The error is silent — nothing in the query flags it.
This server applies the correction, and returns the evidence for why it is needed.
Related MCP server: mcp-comtrade
The two guarantees
Every response carries the known defects that apply to that query, with measured evidence and verification provenance.
The critical correction is applied to the result, not merely warned about. The
airchannel already means "air mode cleared at an airport". The contaminated block remains queryable asair_declared_at_port, deliberately — for anyone who wants to inspect it.
What the dataset has that published summaries discard
The import files carry VL_FRETE and VL_SEGURO — freight and insurance as declared to
customs. It is the best systematic measure of realized cost available publicly, and almost
nobody uses it.
China → Brazil, Jan–Jul 2026, already corrected:
Channel | Weight (kg) | Freight US$/kg | Freight % of FOB | Value density |
Air (airport) | 33,993,130 | 10.81 | 9.37% | US$115.36/kg |
Sea | 16,074,641,185 | 0.142 | 5.68% | US$2.51/kg |
Air costs 76× more per kilogram and only 1.65× more per dollar of goods. This corridor's modal split is not a freight decision — it is a value-density decision.
Install
Requires Node ≥ 22.5 (uses the built-in SQLite — zero native dependencies, no node-gyp).
git clone <repo> && cd mcp-comex-brasil
npm install && npm run build
npm run db:build -- --years 2025,2026 # baixa da fonte oficial e monta o SQLitedb:build fetches the files straight from balanca.economia.gov.br. No data is
redistributed by this package — the database is built on your machine, always fresh from the
source.
Useful options:
npm run db:build -- --years 2026 --countries 160 # só China, base pequena e rápida
npm run db:build -- --years 2024,2025,2026 --flows import,exportConfiguring the MCP client
{
"mcpServers": {
"comex": {
"command": "node",
"args": ["--experimental-sqlite", "/caminho/para/mcp-comex-brasil/dist/index.js"],
"env": { "COMEX_LANG": "pt" }
}
}
}COMEX_LANG accepts pt (default) or en. COMEX_DB overrides the database path.
The four tools
Tool | What it does |
| Value, weight and value density by year, month, country, HS code and channel. The |
| Declared freight and insurance per channel: US$/kg and % of FOB. Imports only. |
| The dataset's known defects, with evidence, correction rule and pre-publication checklist. |
| Resolves country, HS code, transport mode and clearance unit (with airport/seaport/other classification). |
The caveats that accompany the responses
id | Severity | Corrected? |
| critical | ✅ automatic (cross-reference with the clearance point) |
| critical | ❌ impossible — the data does not exist in the source |
| info | — |
| warning | ❌ requires year-over-year comparison |
About simplified_regime_absent: there are transport-mode codes for POSTAL and COURIER, but
they are empty (13 records and 72 kg for China in all of 2026, versus ~180 million
international parcels reported). Low-value shipments go through the simplified regime and do
not enter trade statistics. Formal statistics and parcel volume are disjoint universes — do
not add, do not compare arithmetically.
Verification
The aggregates were validated by cross-implementation: the same slice processed by a single
awk pass over the raw CSV and by this server's SQL view produces identical figures to the
last digit (349,250 records, 7 channels, freight and weight values).
npm test # 12 testes da lógica de classificação e do registro de caveatsLicense and source
MIT. Data: Comex Stat, Foreign Trade Secretariat / Federal Revenue Service of Brazil
(balanca.economia.gov.br) — public source, consulted at database build time.
Author: Luis Delfin
English
MCP server for Brazilian foreign-trade data — with the dataset's traps corrected in the response.
Four tools that don't lie, instead of forty that don't know.
The problem
An MCP server that merely exposes a dataset hands the agent a clean API to a wrong number. The plumbing doesn't know the field lies.
Brazil's official trade dataset (Comex Stat, published by the Foreign Trade Secretariat / Federal Revenue Service) has a defect no documentation warns about:
Filtering the transport-mode field by
AIRreturns 139.6 million kg of Chinese imports for Jan–Jul 2026. Cross-referencing those same records against their clearance point, only 34.0 million (24%) passed through an airport. The other 89.7 million cleared at seaports and consist of ammonium sulphate and phosphatic fertilisers — cargo that does not fly, at US$0.29/kg freight.Uncorrected: air weight overstated 4.1× and freight per kg understated by 70%. The error is silent — nothing in the query flags it.
This server applies the correction, and returns the evidence for why it is needed.
Two guarantees
Every response carries the known defects that apply to that query, with measured evidence and verification provenance.
The critical correction is applied, not merely warned about. The
airchannel already means "air mode cleared at an airport". The contaminated block stays queryable asair_declared_at_port, deliberately — for anyone who wants to inspect it.
What the dataset has that published summaries discard
The import files carry VL_FRETE and VL_SEGURO — freight and insurance as declared to
customs. It is the best systematic measure of realised cost available publicly, and almost
nobody uses it.
China → Brazil, Jan–Jul 2026, corrected:
Channel | Weight (kg) | Freight US$/kg | Freight % of FOB | Value density |
Air (airport-cleared) | 33,993,130 | 10.81 | 9.37% | US$115.36/kg |
Sea | 16,074,641,185 | 0.142 | 5.68% | US$2.51/kg |
Air costs 76× more per kilogram and only 1.65× more per dollar of goods. This corridor's modal split is not a freight decision — it is a value-density decision.
Install
Requires Node ≥ 22.5 (uses built-in SQLite — zero native dependencies, no node-gyp).
npm install && npm run build
npm run db:build -- --years 2025,2026 # fetches from the official source, builds SQLitedb:build pulls the files straight from balanca.economia.gov.br. No data is redistributed
by this package — the database is built on your machine, always fresh from the source.
The four tools
Tool | What it does |
| Value, weight and value density by year, month, country, HS code and channel. |
| Declared freight and insurance per channel: US$/kg and % of FOB. Imports only. |
| The dataset's known defects, with evidence, correction rule and a pre-publication checklist. |
| Resolves country, HS code, transport mode and clearance unit (with airport/seaport classification). |
Verification
Aggregates were validated by cross-implementation: the same slice processed by a single
awk pass over the raw CSV and by this server's SQL view produces identical figures to the
last digit (349,250 records, 7 channels, freight and weight values).
npm test # 12 tests covering the classification logic and the caveat registryMIT. Data: Comex Stat, Brazilian Foreign Trade Secretariat / Federal Revenue Service. Author: Luis Delfin
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseDqualityCmaintenanceServidor MCP para a API do ComexStat, ferramenta de acesso às estatísticas de comércio exterior do Brasil.2092MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to UN Comtrade international bilateral trade data via an MCP server, enabling AI agents to query trade statistics through natural language.16MIT

mcp-fasofficial
AlicenseNot gradedqualityCmaintenanceEnables access to USDA Foreign Agricultural Service trade and global production data through MCP, supporting natural language queries and tool-based data retrieval.19MIT- AlicenseNot gradedqualityAmaintenanceAccess UN Comtrade international merchandise and services trade statistics via MCP tools for country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability.1073Apache 2.0
Related MCP Connectors
Comtrade MCP — UN Comtrade API for international bilateral trade data
Census Trade MCP — US Census Bureau International Trade data
Brazilian legal stack in one MCP: lawsuits, court publications, case law, tenders, certificates.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PHIAI-IO/mcp-comex-brasil'
If you have feedback or need assistance with the MCP directory API, please join our Discord server