mcp-comexstat
The MCP Server for API Comexstat provides access to Brazilian foreign trade statistics and related auxiliary data. With this server, you can:
Query Trade Data: Retrieve export/import statistics with detailed filters, fields, and metrics
Access Municipal Data: Get trade information specific to Brazilian municipalities
Examine Historical Records: View historical trade data from 1989-1996
Check Update Status: Get the date of the last data update
Retrieve Auxiliary Tables: Access lists and details for states, cities, countries, economic blocks, and trade codes (Harmonized System, NBM)
Perform Custom Queries: Create detailed queries with various parameters including flow type, period, filters, and metrics
List Available Parameters: View available years, filters, fields, and metrics for constructing queries
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-comexstatshow me Brazil's top 5 export partners in 2023"
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 Server for Comexstat API
This project implements an MCP (Model Context Protocol) server for the Comexstat API, allowing AI models like Claude to interact directly with Brazil's foreign trade data.
Overview
The MCP Comexstat server provides tools to query Brazilian export and import statistics, including:
General export and import data
Data by municipalities
Historical data (1989-1996)
Auxiliary tables with codes and descriptions
Related MCP server: mcp-twitter
Features
Implemented using @modelcontextprotocol/sdk
Typing with TypeScript
Data validation with Zod
Support for communication via stdin/stdout (MCP standard)
Robust API error handling and responses
Installation
# Clone o repositório
git clone https://github.com/luizzzvictor/mcp-comexstat-easy.git
cd mcp-comexstat-easy
# Instale as dependências
npm install
# Compile o código TypeScript
npm run buildQuick Use
# Execute o servidor MCP
npm startAvailable Tools
The MCP server provides the following tools:
General Data
getLastUpdate()- Gets the date the data was last updatedgetAvailableYears()- Lists the years available for querygetAvailableFilters()- Lists available filtersgetFilterValues(filter, language?)- Gets values for a specific filtergetAvailableFields()- Lists the fields available for detailinggetAvailableMetrics()- Lists available metricsqueryData(options)- Performs detailed queries with the following parameters:flow: "export" | "import"period: { from: "YYYY-MM", to: "YYYY-MM" }monthDetail: booleanfilters: Array of filters (optional)details: Array of fields for detailingmetrics: Array of metricslanguage: string (optional, default: "pt")
Data by Municipalities
queryMunicipalitiesData(options)- Query data focusing on municipalities
Historical Data
queryHistoricalData(options)- Query historical data (1989-1996)
Auxiliary Tables
getStates()- List Brazilian statesgetStateDetails(ufId)- Details of a specific stategetCities()- List of citiesgetCityDetails(cityId)- Details of a specific citygetCountries(search?)- List countriesgetCountryDetails(countryId)- Details of a specific countrygetEconomicBlocks(options?)- List economic blocksgetHarmonizedSystem(options?)- Harmonized System (HS)getNBM(options?)- Brazilian Nomenclature of GoodsgetNBMDetails(coNbm)- Details of a specific NBM code
Usage Example
// Consultar exportações para os EUA em 2023
const result = await queryData({
flow: "export",
period: { from: "2023-01", to: "2023-12" },
monthDetail: false,
filters: [{ filter: "country", values: [105] }],
details: ["country", "month"],
metrics: ["metricFOB", "metricKG"],
});Integration with Claude
To use the MCP server with Claude Desktop:
Add the configuration to the
claude_desktop_config.jsonfile:{ "mcpServers": { "comexstat": { "command": "node", "args": ["/caminho/completo/para/mcp-comexstat-easy/dist/index.js"] } } }On Claude Desktop, use the command:
/mcp comexstat
Development
# Executar em modo de desenvolvimento
npm run dev
# Executar testes
npm test
# Verificar cobertura de testes
npm test -- --coverageLicense
MIT
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
- AlicenseNot gradedqualityDmaintenanceAn MCP server that standardizes and contextualizes industrial Modbus data.26MIT
- AlicenseNot gradedqualityDmaintenanceThe implementation of Model Context Protocol (MCP) server for VictoriaLogs.94Apache 2.0
- AlicenseAqualityCmaintenanceMathematical Optimization MCP Server with PuLP and OR-Tools support135MIT
Related MCP Connectors
MCP server for live, sourced Brazilian public data from the official IBGE APIs.
MCP server for Brazilian Federal Senate open data (legislative, administrative, e-Cidadania).
Comtrade MCP — UN Comtrade API for international bilateral trade data
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/luizzzvictor/mcp-comexstat'
If you have feedback or need assistance with the MCP directory API, please join our Discord server