npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@braynexservices/nigeria-mcp-trade-intel

v0.3.6

Published

Nigeria Trade Intel MCP — Nigeria import/export trade statistics (UN Comtrade, free/keyless) + HS-code classification, exposed as MCP tools.

Readme

Nigeria Trade Intel MCP

Nigeria import/export trade statistics + HS-code classification, exposed to AI agents as MCP tools.

Status: 🌐 LIVE + free (no API key) Package: @braynexservices/nigeria-mcp-trade-intel v0.3.2 · depends on @braynexservices/nigeria-mcp-core Author: Samuel Orie (Founder) · Owner: Braynex Services Ltd · License: MIT © 2026 Braynex Services Ltd — MIT licensed (copyright retained; see repo-root NOTICE).


What it does

Answers questions about Nigeria's external trade — who Nigeria trades with, in what commodities, for how much — and maps product descriptions to HS codes. Trade data comes live from UN Comtrade's free, keyless API; partner/country names are resolved from Comtrade's own reference data (so they're correct, not guessed). Public macro data only — no PII.

Tools

get_trade_stats

Nigeria import/export flows — by partner, commodity, year, annual or monthly, with value (USD + CIF/FOB), net weight and quantity where reported.

| Param | Required | Notes | |---|---|---| | flow | ✅ | "import" or "export" | | partner | — | country name (China), ISO (CHN/CN), or numeric code; omit to rank all partners by value | | commodity | — | an HS code (85, 2709) or a breakdown level: total (default), chapters (by HS chapter), headings (4-digit), detailed (6-digit) | | year | — | reporting year (default 2023; annual data lags ~1–2y) | | frequency | — | annual (default) or monthly | | month | — | 112, required when frequency: "monthly" |

Each flow returns: reporter, partner, hsCode, commodity, flow, period, year, valueUsd, cifValueUsd, fobValueUsd, netWeightKg, quantity, quantityUnit, source, retrievedAt (CIF is populated for imports, FOB for exports; weight/quantity appear where the reporter filed them.)

Examples (live):

// Top export partners:  get_trade_stats({ "flow": "export" })
//   Netherlands $8.18B · Spain $6.13B · India $5.45B …

// Commodity breakdown:  get_trade_stats({ "flow":"import", "partner":"China", "commodity":"chapters" })
//   HS84 Machinery $3.01B · HS85 Electrical machinery $1.81B · HS87 Vehicles $675M …  (96 chapters)

// Specific commodity, with weight:  get_trade_stats({ "flow":"export", "partner":"India", "commodity":"2709" })
//   { commodity:"Petroleum oils … crude", valueUsd:4.77B, fobValueUsd:4.77B, netWeightKg:6.4B, period:"2023" }

// Monthly:  get_trade_stats({ "flow":"import", "partner":"China", "commodity":"85", "frequency":"monthly", "year":2023, "month":12 })
//   { period:"202312", valueUsd:201M, cifValueUsd:201M }

classify_hs

Suggest an HS code for a product description (free local heuristic; commercial classifier = future paid upgrade).

// → classify_hs({ "product_description": "cocoa beans for export" })
// structuredContent: { query, hsCode: "1801", heading: "Cocoa beans, whole or broken", source: "heuristic", retrievedAt }

Configuration — TRADE_PROVIDER

| Value | Behaviour | |---|---| | mock (default) | Offline deterministic fixtures — zero network, for dev/eval | | opendata | Live UN Comtrade (keyless). Set this to use real data. |

No API key required. (Optional: a free Comtrade key raises the 500-records/call cap — see Limits.)

Run it

npm install && npm run build      # from repo root

# offline smoke (mock) + live check (real API)
npm run smoke      -w @braynexservices/nigeria-mcp-trade-intel
npm run smoke:live -w @braynexservices/nigeria-mcp-trade-intel

# serve over stdio (live data)
TRADE_PROVIDER=opendata npm run start:stdio -w @braynexservices/nigeria-mcp-trade-intel

MCP Inspector (interactive GUI):

TRADE_PROVIDER=opendata npx @modelcontextprotocol/inspector node lanes/trade-intel/dist/stdio.js

Claude Desktop / Code — add to your MCP config (needs Node.js ≥ 20):

{
  "mcpServers": {
    "nigeria-trade-intel": {
      "command": "npx",
      "args": ["-y", "@braynexservices/nigeria-mcp-trade-intel"],
      "env": { "TRADE_PROVIDER": "opendata" }
    }
  }
}

Running from a clone instead: "command": "node", "args": ["/path/to/nigeria-mcp/lanes/trade-intel/dist/stdio.js"]. Then ask, e.g., "What were Nigeria's top crude-oil export partners in 2023?"

Limits & notes

  • Rate limits: the keyless tier caps at 500 records/call and throttles rapid calls (HTTP 429). The adapter caches non-empty results (~6h) so repeat queries don't re-hit the API, retries with backoff on transient failures (throttle, timeout, network), and falls back to an actionable error; mock is always available offline. A free Comtrade key (https://comtradeplus.un.org/) raises limits.
  • Parallel/black-market FX is not here (that's the FX lane); this lane is official trade statistics.
  • Commodity descriptions are best-effort labels for common HS codes; arbitrary codes show HS <code>.
  • Data lag: UN Comtrade annual data trails the current year by ~1–2 years.
  • classify_hs is a keyword heuristic — good for common goods; a commercial classifier (Avalara/Zonos) is the accuracy upgrade.

Verification

npm run verify (repo root) → build + all lane smokes + eval. This lane: offline smoke + smoke:live against the real API, independent code-review, hardened (regime filter, canonical partner codes, 429 retry).