comexscope
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.
comexscope
Brazil's foreign-trade data — Comex Stat figures and the vendor's derived readings on top of them — sits behind the hosted Kyrodata MCP service. comexscope is a small local bridge to that service: you can compare exports or imports between like-for-like windows, read a heading's totals and monthly series, rank partner countries, pull a commodity hub's forecast verdict or climate reading, check a supply and demand balance sheet, search the public catalogue, and run the product's pre-built reports.
Nothing is stored or computed on your own machine. This package answers tools/list locally from the captured tool definitions and forwards every tools/call to the hosted service over a streamable-HTTP JSON-RPC session, returning whatever the service sends back unchanged.
The tools
Every tool in this surface reads published Brazil foreign-trade data (Comex Stat) and the vendor's derived readings. kyrodata_get_credit_balance reports the balance and limits of the caller's own API key; no tool writes anything, buys anything, starts a subscription, checks out, or creates an API key.
kyrodata_compare_trade— Compares exports or imports between two equal-length windows, in value (USD FOB) and volume (kg), with the % change of each metric and the monthly series spanning both windows.codesandcountryIdsfilter both windows alike.kyrodata_explain_pyramid_level— Explains the forecast pyramid's arithmetic for one commodity and horizon: the seven levels side by side, or one level followed across all four horizons vialevelKey.kyrodata_fetch— Opens one public trade document by an id fromkyrodata_search(heading:1201,country:160) and returns it as citable prose with a public URL.kyrodata_get_climate_reading— Current climate reading for a commodity: risk level, measured production shock, and projected physical loss in tonnes per horizon, at country, region or state scope.kyrodata_get_credit_balance— The credit balance and limits of the API key making the request: credits left, reset timing, daily ceilings, and which tools the key reaches.kyrodata_get_data_coverage— The calendar of the trade data: first and last published month, whether the current year is partial, the last fully closed month, and the last refresh.kyrodata_get_heading_overview— Structured read of one HS heading (SH4): published-year totals, last closed month against the previous one, and a monthly price-by-volume series.kyrodata_get_hub_summary— The pyramid verdict for a commodity hub: direction, expected move per horizon, the 80% band, which levels drive the verdict, and measured accuracy.kyrodata_get_supply_demand_balance— Published supply and demand balance (in tonnes) for one agricultural hub, season by season, optionally closed seasons only.kyrodata_list_trade_partners— Ranks Brazil's partner countries for exports or imports in a window, with value, volume, price per kg, share, and optional growth.kyrodata_list_trade_series— Brazil's monthly export or import series as rows, narrowed by HS codes and partner countries; gaps stay absent rather than reading as zero.kyrodata_resolve_comparison_window— Resolves an equal-length comparison window and returns only its metadata: from, to, label, months, and whether it crosses a season.kyrodata_resolve_entity— Resolves a free-text name into platform identifiers for filtering other tools: commodity hubs, HS headings, NCM codes and partner countries.kyrodata_run_report— Runs one of the product's pre-built catalogue reports by id and returns its rows, with the report's own parameters and an optional column projection.kyrodata_search— Searches the public Brazilian foreign-trade catalogue and returns document ids forkyrodata_fetch— HS headings and partner countries, each with a public URL.
Related MCP server: kyrodata
Install and run
As an MCP server via npm:
npx -y @reneturcios/comexscope mcpMCP client configuration:
{
"mcpServers": {
"comexscope": {
"command": "npx",
"args": ["-y", "@reneturcios/comexscope", "mcp"]
}
}
}As a container:
docker run -i ghcr.io/cloudcorprecords/comexscope
docker run --rm ghcr.io/cloudcorprecords/comexscope kyrodata_search '{"query":"soja"}'CLI
One binary serves both the command line and the MCP server. Each tool is a subcommand taking a single JSON string with that tool's arguments:
comexscope kyrodata_compare_trade '{"flow":"export","mode":"ytd"}'
comexscope kyrodata_get_heading_overview '{"sh4":"1201","flow":"export"}'
comexscope kyrodata_resolve_entity '{"q":"China"}'
comexscope kyrodata_search '{"query":"soja"}'
comexscope kyrodata_get_data_coverage '{}'
comexscope --versionExit codes: 0 when the forwarded call succeeds, 1 when the upstream result is an error, and 2 for usage problems such as an unknown subcommand or a malformed JSON argument.
Configuration
KYRODATA_MCP_URL— Overrides the upstream endpoint. The default is the pinned hosted endpoint,https://mcp.kyrodata.com/mcp. (The override variable is a reconstruction added by this rebuild.)KYRODATA_API_KEY— When set, its value is sent to the upstream on every request as anAuthorization: Bearer <value>header; the upstream's registry record pins a secretAuthorizationheader on its remote. When it is not set, no key header is sent at all, matching the keyless behaviour the tool surface was captured with. (The env forwarding is a reconstruction added by this rebuild; the captures were keyless.)
Upstream failures — a JSON-RPC error from the service, a non-2xx response, an unreadable body, or a request that fails outright — are reported to the caller as an error result whose text starts with comexscope error:.
How forwarding works
The first forwarded call opens a session: an initialize request (protocol version 2025-03-26), followed by a notifications/initialized notification, then the tools/call itself. If the service answers the initialize request with an Mcp-Session-Id header, that value is carried on every later request, and the open session is reused for the rest of the process. Replies are accepted either as plain JSON or as server-sent events. Successful results pass through verbatim, including any isError flag and any extra fields the service includes.
Development
npm install
npm run build # tsc -> dist/ (dist/cli.js is the bin)
npm test # tsx --test test/*.test.ts — stubbed upstream, no network
npm run dev # run the CLI from sourceThe test suite checks the served tool list against the captured surface tool by tool, exercises the session handshake and its reuse, covers both key-header branches, and verifies that arguments go upstream untouched and results come back untouched.
License
MIT — see LICENSE. Copyright (c) 2026 Rene Turcios.
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
AI-powered commodity price forecasts and Brazil trade intelligence via MCP. Access Brazilian exports and imports from MDIC/ComexStat since 2000, by HS4, HS6 and NCM code, partner country, USD FOB and kilograms — plus crop production, supply & demand, climate data and production forecasts for major commodities including soybeans, coffee, corn, beef and cocoa. Compare trade flows, markets, countries and time periods with like-for-like windows. Every answer identifies the measurement period and data source. 15 read-only tools. Metered in credits. Connect directly via Streamable HTTP — no installation required: https://mcp.kyrodata.com/mcp Authentication: Bearer key or OAuth 2.1 (PKCE). Official MCP registry: com.kyrodata/kyrodata
UN Comtrade international trade statistics via MCP. Country/HS lookups, flows, balances, rankings.
UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.
Remote MCP endpoint for U.S. home forecasts, public benchmark data, and permit or zoning readiness.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA thin stdio-to-HTTP bridge that forwards MCP messages to the hosted Proxycept server, enabling stdio-only MCP clients to access Proxycept's tool catalog.12 npmMIT
- AlicenseAqualityBmaintenanceBrazilian foreign trade from MDIC/ComexStat -- exports and imports since 2000 by HS code (SH4/SH6/NCM) and partner country, in USD FOB and kilograms -- plus crop production, supply-and-demand balances, climate readings and commodity forecasts for hubs such as soybean, coffee and beef. 15 read-only tools, remote at https://mcp.kyrodata.com/mcp; official registry com.kyrodata/kyrodata.151MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients to discover, inspect, and run 2,000+ AI models and data APIs, including search, social, scraping, image, video, and audio tools, through one browser-authorized local bridge. It also surfaces run status, recorded cost, and account balance, and supports rolling back client configuration changes.556,724 npmMIT
- AlicenseBqualityCmaintenanceBridges stdio-only MCP clients to the hosted service and forwards its tools unchanged, letting users check whether their server is ready for MCP directories and get it submitted. Discovery and readiness checks work anonymously, while account-specific servers and submissions require an API key.3259 npmMIT