Skip to main content
Glama
mcp-comexstat

mcp-comexstat

by luizzzvictor

Comexstat API 的 MCP 服务器

该项目为 Comexstat API 实现了一个 MCP(模型上下文协议)服务器,允许像 Claude 这样的 AI 模型直接与巴西的外贸数据进行交互。

概述

MCP Comexstat 服务器提供查询巴西出口和进口统计数据的工具,包括:

  • 一般进出口数据

  • 各市町村数据

  • 历史数据(1989-1996年)

  • 带有代码和描述的辅助表

Related MCP server: br-eli-mcp

特征

  • 使用@modelcontextprotocol/sdk实现

  • 使用 TypeScript 进行输入

  • 使用 Zod 进行数据验证

  • 支持通过 stdin/stdout 进行通信(MCP 标准)

  • 强大的 API 错误处理和响应

安装

# 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 build

快速使用

# Execute o servidor MCP
npm start

可用工具

MCP 服务器提供以下工具:

一般数据

  • getLastUpdate() - 获取数据最后更新日期

  • getAvailableYears() - 列出可供查询的年份

  • getAvailableFilters() - 列出可用的过滤器

  • getFilterValues(filter, language?) - 获取特定过滤器的值

  • getAvailableFields() - 列出可用于详细说明的字段

  • getAvailableMetrics() - 列出可用指标

  • queryData(options) - 使用以下参数执行详细查询:

    • flow :“导出”| “进口”

    • period :{从:“YYYY-MM”,到:“YYYY-MM”}

    • monthDetail :布尔值

    • filters :过滤器数组(可选)

    • details :详细信息字段数组

    • metrics :指标数组

    • language :字符串(可选,默认值:“pt”)

各市町村数据

  • queryMunicipalitiesData(options) - 查询以市政当局为重点的数据

史料

  • queryHistoricalData(options) - 查询历史数据(1989-1996)

辅助表

  • getStates() - 列出巴西各州

  • getStateDetails(ufId) - 特定状态的详细信息

  • getCities() - 城市列表

  • getCityDetails(cityId) - 特定城市的详细信息

  • getCountries(search?) - 列出国家

  • getCountryDetails(countryId) - 特定国家的详细信息

  • getEconomicBlocks(options?) - 列出经济区块

  • getHarmonizedSystem(options?) - 协调制度 (HS)

  • getNBM(options?) - 巴西商品命名规则

  • getNBMDetails(coNbm) - 特定 NBM 代码的详细信息

使用示例

// 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"],
});

与克劳德的整合

要将 MCP 服务器与 Claude Desktop 一起使用:

  1. 将配置添加到claude_desktop_config.json文件中:

    {
      "mcpServers": {
        "comexstat": {
          "command": "node",
          "args": ["/caminho/completo/para/mcp-comexstat-easy/dist/index.js"]
        }
      }
    }
  2. 在 Claude Desktop 上,使用以下命令:

    /mcp comexstat

发展

# Executar em modo de desenvolvimento
npm run dev

# Executar testes
npm test

# Verificar cobertura de testes
npm test -- --coverage

执照

麻省理工学院

Available Tools

20 tools
getAuxiliaryTableD

Inputs: table (required), page, pageSize, search.

getAvailableFieldsD

Inputs: no named parameters.

getAvailableFiltersD

Inputs: no named parameters.

getAvailableMetricsD

Inputs: no named parameters.

getAvailableYearsD

Inputs: no named parameters.

getCitiesD

Inputs: no named parameters.

getCityDetailsD

Inputs: cityId (required).

getCountriesD

Inputs: search.

getCountryDetailsD

Inputs: countryId (required).

getEconomicBlocksD

Inputs: add, language, search.

getFilterValuesD

Inputs: filter (required), language.

getHarmonizedSystemD

Inputs: add, language, page, perPage.

getLastUpdateD

Inputs: no named parameters.

getNBMD

Inputs: add, language, page, perPage, +1 more.

getNBMDetailsD

Inputs: coNbm (required).

getStateDetailsD

Inputs: ufId (required).

getStatesD

Inputs: no named parameters.

queryDataD

Inputs: details (required), flow (required), metrics (required), monthDetail (required), +3 more.

queryHistoricalDataD

Inputs: details (required), flow (required), metrics (required), period (required), +3 more.

queryMunicipalitiesDataD

Inputs: details (required), flow (required), metrics (required), period (required), +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    D1.9/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes targeting different data entities (countries, states, cities, NBM, etc.) or metadata (available fields, filters, metrics). However, some pairs like getCities/getMunicipalitiesData and getNBM/getNBMDetails have potential overlap that could cause confusion without descriptions to clarify their boundaries.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'get' or 'query' prefixes, using camelCase uniformly throughout. The naming is highly predictable and readable, with clear conventions for different types of operations (get for metadata/entities, query for data retrieval).

    Tool Count3/5

    With 20 tools, this is borderline heavy for a trade statistics server. While the domain appears broad (covering countries, states, cities, NBM codes, auxiliary tables, etc.), the count feels somewhat inflated with multiple similar metadata tools (getAvailableFields/Filters/Metrics/Years) that might be consolidated.

    Completeness4/5

    The tool set appears to provide comprehensive coverage for trade data exploration and retrieval, including metadata discovery, entity lookups, and data querying across different dimensions (current, historical, municipal). Minor gaps might exist in data modification capabilities, but for a read-only statistical service, the surface seems reasonably complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      MCP Server do SEI Pro para o SEI (Sistema Eletrônico de Informações) via API REST mod-wssei v2 + scraper do frontend web (modo híbrido).
      100
      23
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for the Brazilian Chamber of Deputies open-data API, enabling search and retrieval of federal legislative bills and their status.
      15
      57 PyPI
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the Omie API to list products, consult clients, and create budgets
      MIT