mcp-comexstat

Comexstat API 的 MCP 服务器

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

概述

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

  • 一般进出口数据
  • 各市町村数据
  • 历史数据(1989-1996年)
  • 带有代码和描述的辅助表

特征

  • 使用@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

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

mcp-comexstat

  1. 概述
    1. 特征
      1. 安装
        1. 快速使用
          1. 可用工具
            1. 一般数据
            2. 各市町村数据
            3. 史料
            4. 辅助表
          2. 使用示例
            1. 与克劳德的整合
              1. 发展
                1. 执照

                  Related MCP Servers

                  View all related MCP servers

                  ID: gg0npj9yt8