{"_id":"@cyanheads/un-comtrade-mcp-server","_rev":"7-8c640274740fde8a19282c74f964023b","name":"@cyanheads/un-comtrade-mcp-server","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.1":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.1","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade"],"license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.1","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"c37bed1e8cf922f85bacd0a06cbb27904485ecdc","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.1.tgz","fileCount":84,"integrity":"sha512-bigLspaJofqwfJ/zfv0xu2jjdRX2g6lIDvtkcCZHM2S7gzF5pSydR4gfyd44qYpAwEIbjQyZTzM1k4Y9v/hcnw==","signatures":[{"sig":"MEUCIEhd8iTGhr8zJf+IWdKkqO6rRqtGsILbshJREoHAoK6vAiEAgvYilzsdlBHuhAsHqkPphCPwYf/iwmTWIgSwBDKNDhQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":261777},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"c37bed1e8cf922f85bacd0a06cbb27904485ecdc","engines":{"bun":">=1.3.0","node":">=24.0.0"},"scripts":{"test":"vitest run","tree":"tsx scripts/tree.ts","build":"tsx scripts/build.ts","clean":"tsx scripts/clean.ts","start":"node dist/index.js","bundle":"npm run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb","format":"biome check --write --unsafe .","rebuild":"tsx scripts/clean.ts && tsx scripts/build.ts","devcheck":"tsx scripts/devcheck.ts","lint:mcp":"tsx scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"tsx scripts/list-skills.ts","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","lint:packaging":"tsx scripts/lint-packaging.ts","changelog:build":"tsx scripts/build-changelog.ts","changelog:check":"tsx scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-bigLspaJofqwfJ/zfv0xu2jjdRX2g6lIDvtkcCZHM2S7gzF5pSydR4gfyd44qYpAwEIbjQyZTzM1k4Y9v/hcnw==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.9.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.22.3","ignore":"^7.0.5","vitest":"^4.1.7","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^25.9.1","@biomejs/biome":"^2.4.15"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.1_1779765364957_0.33919862490622776","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.2","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade"],"license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.2","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"9732a1d21eb84c3a96286969e86bf8c4b9fd17a8","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.2.tgz","fileCount":85,"integrity":"sha512-Q6iIfxQKXLmOMsPdPPvuS7L63Rk+T+nIWuc+tHwtp86lKcW0qGw1rNgSeGDt1OdXPPZnK1AKbXS6W91KWrRsPw==","signatures":[{"sig":"MEQCIF+VF+lzvb237ZlGxyBYQTQ7rWocnaAQ7KdHtxoSc+uYAiA9vlCBxZdmR+ufjJkWz9AuBOWiSJMo07UVCRkt6Ou9cg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":262347},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"9732a1d21eb84c3a96286969e86bf8c4b9fd17a8","engines":{"bun":">=1.3.0","node":">=24.0.0"},"mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"vitest run","tree":"tsx scripts/tree.ts","build":"tsx scripts/build.ts","clean":"tsx scripts/clean.ts","start":"node dist/index.js","bundle":"npm run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb","format":"biome check --write --unsafe .","rebuild":"tsx scripts/clean.ts && tsx scripts/build.ts","devcheck":"tsx scripts/devcheck.ts","lint:mcp":"tsx scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"tsx scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","lint:packaging":"tsx scripts/lint-packaging.ts","changelog:build":"tsx scripts/build-changelog.ts","changelog:check":"tsx scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-Q6iIfxQKXLmOMsPdPPvuS7L63Rk+T+nIWuc+tHwtp86lKcW0qGw1rNgSeGDt1OdXPPZnK1AKbXS6W91KWrRsPw==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.9.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.22.3","ignore":"^7.0.5","vitest":"^4.1.7","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^25.9.1","@biomejs/biome":"^2.4.15"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.2_1779765498929_0.09724142244981704","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.3","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade"],"author":"cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/un-comtrade-mcp-server#readme)","license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.3","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"ea5545195753dd27ae44389fcd31b391042fc45c","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.3.tgz","fileCount":87,"integrity":"sha512-ZfI3Osorat/aeO9b5faLyI23TpSLkfrhTbVx16tBe851hWl6/sx1MNyiVqLisSuiwqkkb2bDcfnMT8Tc427uug==","signatures":[{"sig":"MEUCIQCsxwF21SyPpVW2e1mfQwnfK1MUr7nnC/40y+EB7uuylQIgBf+hDNnFO1J1CAYcSEeHRelueE58wR0iW7fAI5UJaEI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":265693},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"ea5545195753dd27ae44389fcd31b391042fc45c","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"bunx vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"bun ./dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb","format":"biome check --write --unsafe .","rebuild":"bun run scripts/clean.ts && bun run build","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http bun ./dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","lint:packaging":"bun run scripts/lint-packaging.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-ZfI3Osorat/aeO9b5faLyI23TpSLkfrhTbVx16tBe851hWl6/sx1MNyiVqLisSuiwqkkb2bDcfnMT8Tc427uug==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.9.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.0","devDependencies":{"ignore":"^7.0.5","vitest":"^4.1.7","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^25.9.1","@biomejs/biome":"^2.4.15"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.3_1779781674145_0.7298969968703981","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.4","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade"],"author":"cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/un-comtrade-mcp-server#readme)","license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.4","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"2532c325390ad8c55b36c72a8b87d981aebe9589","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.4.tgz","fileCount":88,"integrity":"sha512-gf1wEkNHxzRpKKHXAJtWJodt8s1LscLIlbXw5t5VQo4O0QJYxH7JnQWwLU9tMV802GTR6ILaN1vGWm9/tXBdzw==","signatures":[{"sig":"MEUCIQCNKKjzks3S+HUtD8jwtK/BhKVnmKLjamLM6J/EbQnfNwIgcLrkAf+Jzifieoooop2LCBXSrwEIhX8fZVHqj/BSeeU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":272664},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"2532c325390ad8c55b36c72a8b87d981aebe9589","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"bunx vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"bun ./dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb","format":"biome check --write --unsafe .","rebuild":"bun run scripts/clean.ts && bun run build","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http bun ./dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","lint:packaging":"bun run scripts/lint-packaging.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-gf1wEkNHxzRpKKHXAJtWJodt8s1LscLIlbXw5t5VQo4O0QJYxH7JnQWwLU9tMV802GTR6ILaN1vGWm9/tXBdzw==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.9.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.0","devDependencies":{"ignore":"^7.0.5","vitest":"^4.1.8","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^25.9.2","@biomejs/biome":"^2.4.16"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.4_1781115629523_0.11667335436672244","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.5","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade"],"author":"cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/un-comtrade-mcp-server#readme)","license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.5","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"7084f126557a44b7407138883976feab420e0cea","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.5.tgz","fileCount":89,"integrity":"sha512-rui0x7ixCUmHT8j+CWetZirOpA5JEjEKxaJCLOb7C6JwFCghH9eYYIa15K1ihIANwF6AHeEgqCm75O/3PQudQQ==","signatures":[{"sig":"MEQCIGXCB+AgtCGnGFePFn30Wf8S+gqcigULH12QzJU4H/BXAiAOTFDYBqwNd44wAnYA2ipYLu4YjmBcbiE2IEE0VRFTJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":274869},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"7084f126557a44b7407138883976feab420e0cea","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"bunx vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"bun ./dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/un-comtrade-mcp-server.mcpb","format":"biome check --write --unsafe .","rebuild":"bun run scripts/clean.ts && bun run build","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http bun ./dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","lint:packaging":"bun run scripts/lint-packaging.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-rui0x7ixCUmHT8j+CWetZirOpA5JEjEKxaJCLOb7C6JwFCghH9eYYIa15K1ihIANwF6AHeEgqCm75O/3PQudQQ==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.10.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.0","devDependencies":{"ignore":"^7.0.5","vitest":"^4.1.8","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^25.9.3","@biomejs/biome":"^2.5.0"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.5_1781322898182_0.7752065514512627","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@cyanheads/un-comtrade-mcp-server","version":"0.1.6","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade","stdio","streamable-http"],"author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","license":"Apache-2.0","_id":"@cyanheads/un-comtrade-mcp-server@0.1.6","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"bin":{"un-comtrade-mcp-server":"dist/index.js"},"dist":{"shasum":"c0605c54cb700f26d14441145adaf68181a8a73b","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.6.tgz","fileCount":91,"integrity":"sha512-DqBwb7g+yzjn1uUZXzIQSSsvFqp/gExkSRmpU1RXeAdY9Wz3M1g9jUKVHQ4U1JSGDZuy1+SV7C1PnBogzIOoNg==","signatures":[{"sig":"MEMCH1QbmbvEXzxE4qVFp8QNgLpbxlDwDjFTd3vQT3QpO14CIDQ8Pbuapfv75itlqc2CD5mSBy9C+N5L1McA/MfaS/zG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293730},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"c0605c54cb700f26d14441145adaf68181a8a73b","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"bunx vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"bun ./dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/un-comtrade-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run build","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http bun ./dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-DqBwb7g+yzjn1uUZXzIQSSsvFqp/gExkSRmpU1RXeAdY9Wz3M1g9jUKVHQ4U1JSGDZuy1+SV7C1PnBogzIOoNg==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"zod":"^4.4.3","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.12.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"ignore":"^7.0.6","vitest":"^4.1.11","depcheck":"^1.4.7","tsc-alias":"^1.9.2","typescript":"^7.0.2","@types/node":"^26.2.0","@biomejs/biome":"^2.5.9","@socketsecurity/bun-security-scanner":"^1.1.2"},"_npmOperationalInternal":{"tmp":"tmp/un-comtrade-mcp-server_0.1.6_1787327841674_0.7494121739216897","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"_id":"@cyanheads/un-comtrade-mcp-server@0.1.7","bin":{"un-comtrade-mcp-server":"dist/index.js"},"bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"dist":{"shasum":"a86acac3ea68af5a5ca9c3b4b986ad20743f4792","tarball":"https://registry.npmjs.org/@cyanheads/un-comtrade-mcp-server/-/un-comtrade-mcp-server-0.1.7.tgz","fileCount":93,"integrity":"sha512-vdVZ4H75C11iOlgDQucbHd65w5wRnoNVxSr90sN3a7XQPwNE7A2nlywZS4H+mkDzcuvvUKrgI+0hVigBqBbdtg==","signatures":[{"sig":"MEUCID4Ely7SmmTAA5ILQbKYUBgZccCNqemY8CSxapCdBZJiAiEAzqujYUkId1tdYxhxqv7QfyzhysupZdeEz5LKwEVkwsE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCuGa60jCe+HXZ88NGDo+r4l/V1A/1cz23Wl9G5LaBD4gIgA95eUjAdLKA58e0Fi6cfdY5k5indpaUuUaPHaRmf80w="}],"unpackedSize":320939},"main":"dist/index.js","name":"@cyanheads/un-comtrade-mcp-server","type":"module","types":"dist/index.d.ts","author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","shasum":"a86acac3ea68af5a5ca9c3b4b986ad20743f4792","engines":{"bun":">=1.4.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"license":"Apache-2.0","mcpName":"io.github.cyanheads/un-comtrade-mcp-server","scripts":{"test":"bunx vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"bun ./dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/un-comtrade-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/un-comtrade-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run build","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","audit:fix":"bun audit fix","start:http":"MCP_TRANSPORT_TYPE=http bun ./dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"version":"0.1.7","_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade","stdio","streamable-http"],"_integrity":"sha512-vdVZ4H75C11iOlgDQucbHd65w5wRnoNVxSr90sN3a7XQPwNE7A2nlywZS4H+mkDzcuvvUKrgI+0hVigBqBbdtg==","repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","directories":{},"maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"_nodeVersion":"26.3.0","dependencies":{"zod":"^4.6.5","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.13.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"ignore":"^7.0.9","vitest":"^5.0.1","depcheck":"^1.4.7","tsc-alias":"^1.9.5","typescript":"^7.0.2","@types/node":"^26.6.1","@biomejs/biome":"^2.5.14","@socketsecurity/bun-security-scanner":"^1.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/un-comtrade-mcp-server_0.1.7_1789939903691_0.35322043561802285"}}},"time":{"created":"2026-05-26T03:16:04.751Z","modified":"2026-09-20T21:31:44.000Z","0.1.1":"2026-05-26T03:16:05.087Z","0.1.2":"2026-05-26T03:18:19.115Z","0.1.3":"2026-05-26T07:47:54.286Z","0.1.4":"2026-06-10T18:20:29.668Z","0.1.5":"2026-06-13T03:54:58.355Z","0.1.6":"2026-08-21T15:57:21.834Z","0.1.7":"2026-09-20T21:31:43.830Z"},"bugs":{"url":"https://github.com/cyanheads/un-comtrade-mcp-server/issues"},"author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","license":"Apache-2.0","homepage":"https://github.com/cyanheads/un-comtrade-mcp-server#readme","keywords":["mcp","mcp-server","model-context-protocol","trade","united-nations","comtrade","imports","exports","hs-codes","trade-statistics","commodities","international-trade","stdio","streamable-http"],"repository":{"url":"git+https://github.com/cyanheads/un-comtrade-mcp-server.git","type":"git"},"description":"Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"readme":"<div align=\"center\">\n  <h1>@cyanheads/un-comtrade-mcp-server</h1>\n  <p><b>Access UN Comtrade international merchandise and services trade statistics — country lookups, HS commodity search, bilateral trade flows, balances, rankings, and data availability — via MCP. STDIO or Streamable HTTP.</b>\n  <div>9 Tools • 2 Resources</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n\n\n[![Version](https://img.shields.io/badge/Version-0.1.7-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/un-comtrade-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/un-comtrade-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/un-comtrade-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/un-comtrade-mcp-server/releases/latest/download/un-comtrade-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=un-comtrade-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvdW4tY29tdHJhZGUtbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22un-comtrade-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fun-comtrade-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n---\n\n## Overview\n\nInternational merchandise and services trade statistics from UN Comtrade. Resolve country and HS commodity codes, fetch bilateral trade flows and services trade, and compute balances, partner/commodity rankings, and data availability from any MCP client. Runs as a stdio process or a local Streamable HTTP server.\n\n### Tools\n\n| Tool | Description |\n|:-----|:------------|\n| `comtrade_lookup_countries` | Resolve country and area names to Comtrade M49 numeric codes. |\n| `comtrade_search_commodities` | Find HS commodity codes by keyword, description, or code prefix. |\n| `comtrade_list_service_categories` | List EBOPS 2010 service trade categories by keyword or parent code. |\n| `comtrade_get_trade_flows` | Fetch bilateral trade flow records — value, quantity, and weight per period/commodity/partner. |\n| `comtrade_get_trade_balance` | Compute a country's trade balance (exports minus imports) across one or more periods. |\n| `comtrade_get_top_partners` | Rank trading partners by trade value for a reporter, commodity, and flow direction. |\n| `comtrade_get_top_commodities` | Rank commodity categories by trade value for a reporter and flow direction. |\n| `comtrade_get_data_availability` | Check which reporter/period/classification combinations have published data. |\n| `comtrade_get_services_trade` | Fetch international trade-in-services data (EBOPS 2010). |\n\n### Resources\n\n| Resource | Description |\n|:---------|:------------|\n| `comtrade://countries` | Complete country/area code list with M49 codes, ISO identifiers, and reporter validity. |\n| `comtrade://hs-classification/{level}` | Top-level HS commodity hierarchy at chapter, heading, or subheading level. |\n\nBoth resources are also reachable via tools — `comtrade_lookup_countries` and `comtrade_search_commodities` cover the same data with keyword search.\n\n## Capability reference\n\n### `comtrade_lookup_countries` <sub>tool</sub>\n\n- Accepts a partial or full country name, or an ISO alpha-2/alpha-3 code; `role` filters to `\"reporter\"`, `\"partner\"`, or `\"any\"` (default)\n- `validAsReporter` flag on each match — regional groupings (e.g. World, EU) are valid partners but not valid reporters\n- `include_groups` (default `true`) toggles regional/economic groupings in the results\n- Reference data loads from UN static files at startup — no subscription key required, instant response\n\n---\n\n### `comtrade_search_commodities` <sub>tool</sub>\n\n- Free-text keyword, partial description, or code-prefix search; `classification` selects `HS` (combined dataset, default) or a specific edition `H0`–`H6`\n- `aggr_level` narrows to `2` (chapter), `4` (heading), or `6` (subheading); omit for all levels\n- Up to 200 results per call (`limit`, default 50); `truncated: true` when matches exceed the limit\n- `recommendedQueryCode` on each result — the best code to pass as `cmd_code` in trade queries\n\n---\n\n### `comtrade_list_service_categories` <sub>tool</sub>\n\n- Lists EBOPS 2010 service categories, optionally filtered by keyword or `parent_code`\n- Up to 500 results per call (`limit`, default 100); `truncated: true` when matches exceed the limit\n- Returned `id` is the `service_code` for `comtrade_get_services_trade`\n\n---\n\n### `comtrade_get_trade_flows` <sub>tool</sub>\n\n- Requires `reporter_code`, `flow_code` (`M` import / `X` export / `RX` re-export / `RM` re-import), and 1–12 `period` values (`YYYY` or `YYYYMM`)\n- `partner_code: 0` aggregates all partners (World total); omit for a per-partner breakdown\n- `cmd_code[]` accepts up to 20 HS codes; omit or pass `\"TOTAL\"` for cross-commodity totals\n- Free-tier cap of 500 records per call; `truncated: true` plus a `truncationHint` when the cap is hit\n- `isReported` flags directly-reported rows vs. UN-estimated/aggregated ones; joins country and commodity descriptions from the startup reference cache\n\n---\n\n### `comtrade_get_trade_balance` <sub>tool</sub>\n\n- Runs export (`X`) and import (`M`) fetches in parallel per period, then computes the balance locally\n- Returns `balanceUsd` (signed), `exportsUsd`, `importsUsd`, and `coverageRatio` (exports / imports) per period\n- Optional `cmd_code[]` (up to 20) restricts the balance to specific commodities\n- `mirrorCaveat` on every response — the balance reflects this reporter's own values, not the mirror partner's\n\n---\n\n### `comtrade_get_top_partners` <sub>tool</sub>\n\n- Fetches the full per-partner breakdown for one `reporter_code` + `flow_code` (`M`/`X`) + single `period`, then sorts locally by value\n- Optional single `cmd_code`; omit for total merchandise trade\n- Returns up to `limit` partners (max 50, default 10), each with `rank`, `primaryValueUsd`, and `sharePercent`\n- `truncated: true` when the underlying fetch hit the 500-record cap\n\n---\n\n### `comtrade_get_top_commodities` <sub>tool</sub>\n\n- Ranks commodity categories for one `reporter_code` + `flow_code` + single `period`\n- `aggr_level` selects `2` (HS chapter, default) or `4` (heading); optional `partner_code` scopes to one bilateral relationship\n- Returns up to `limit` categories (max 50, default 10), each with `rank`, `primaryValueUsd`, and `sharePercent`\n- `truncated: true` when the underlying fetch hit the 500-record cap\n\n---\n\n### `comtrade_get_data_availability` <sub>tool</sub>\n\n- All filters optional — `reporter_code`, `period`, `freq` (`A`/`M`, default `A`), `type_code` (`C` goods / `S` services, default `C`), `classification` (default `HS`)\n- Returns per-dataset `totalRecords` and `publicationDate`; omit all filters to browse the full availability index\n- Annual data typically publishes 3–12 months after the reference year — call this before querying recent periods\n\n---\n\n### `comtrade_get_services_trade` <sub>tool</sub>\n\n- Same bilateral shape as `comtrade_get_trade_flows`: `reporter_code`, `flow_code` (`M`/`X`), 1–12 `period` values, optional `partner_code` (`0` for all partners combined)\n- `service_code` filters to one EBOPS category; resolve it with `comtrade_list_service_categories`\n- Free-tier cap of 500 records per call; `truncated: true` plus a `truncationHint` when the cap is hit\n- Services trade has more limited country and period coverage than goods trade\n\n---\n\n### `comtrade://countries` <sub>resource</sub>\n\n- Complete country/area list as `application/json` — M49 code, ISO identifiers, `validAsReporter`, and `isGroup`\n- Loaded from the same startup reference cache `comtrade_lookup_countries` searches\n\n---\n\n### `comtrade://hs-classification/{level}` <sub>resource</sub>\n\n- `level` path param accepts `2` (chapters), `4` (headings), or `6` (subheadings); any other value throws a validation error\n- Returns each code's `description`, `parent`, and `isLeaf`; full leaf enumeration is too large to inject — use `comtrade_search_commodities` for keyword search\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.\n\nComtrade-specific:\n\n- Reference data (country codes, HS hierarchy, EBOPS categories) loaded from UN static files at startup — keyword search with no per-request fetches\n- Authenticated (`data/v1/get`) and public preview (`public/v1/preview`) endpoints — tools fall back to the preview endpoint when no subscription key is set\n- Parallel sub-request execution in workflow tools (`comtrade_get_trade_balance` runs export and import fetches concurrently)\n- Retry with exponential backoff on transient failures, honoring an upstream `Retry-After` header when present\n- Description enrichment — joins country and HS/EBOPS names from the reference cache, covering the preview endpoint's omission of `*Desc` fields\n\nAgent-friendly output:\n\n- `truncated: true` plus a recovery hint on any response capped at the 500-record free-tier limit\n- `isReported` flag on trade flow records distinguishes directly-reported values from UN-estimated/aggregated rows\n- `validAsReporter` on country lookups prevents constructing invalid queries with partner-only area codes\n- `mirrorCaveat` on trade-balance output surfaces the methodological caveat without parsing error text\n\n## Getting started\n\n> **Prerequisites:** A [UN Comtrade subscription key](https://comtradedeveloper.un.org/) is optional but recommended. Without one, tools fall back to the public preview endpoint (500 records/call, lower rate limit). With a free-tier key you get the same record cap but higher request headroom.\n\nAdd the following to your MCP client configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"un-comtrade-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/un-comtrade-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\",\n        \"COMTRADE_SUBSCRIPTION_KEY\": \"your-key-here\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"un-comtrade-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/un-comtrade-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\",\n        \"COMTRADE_SUBSCRIPTION_KEY\": \"your-key-here\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"un-comtrade-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-e\", \"MCP_TRANSPORT_TYPE=stdio\",\n        \"-e\", \"COMTRADE_SUBSCRIPTION_KEY=your-key-here\",\n        \"ghcr.io/cyanheads/un-comtrade-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 COMTRADE_SUBSCRIPTION_KEY=... bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+). Development and Docker images use Bun 1.4.0.\n- Optional: a [UN Comtrade subscription key](https://comtradedeveloper.un.org/) for full API access. Without one, all tools fall back to the public preview endpoint (500 records/call). Reference/lookup tools (`comtrade_lookup_countries`, `comtrade_search_commodities`, `comtrade_list_service_categories`) never require a key — they query static UN reference files.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/un-comtrade-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd un-comtrade-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment:**\n\n```sh\ncp .env.example .env\n# edit .env and set COMTRADE_SUBSCRIPTION_KEY if you have one\n```\n\n## Configuration\n\nAll configuration is validated at startup via Zod schemas in `src/config/server-config.ts`.\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `COMTRADE_SUBSCRIPTION_KEY` | Azure API Management subscription key from [comtradedeveloper.un.org](https://comtradedeveloper.un.org). Without it, tools use the public preview endpoint (500-record cap). | — |\n| `COMTRADE_API_BASE_URL` | Override the Comtrade API base URL. | `https://comtradeapi.un.org` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | HTTP server port. | `3010` |\n| `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path. | `/mcp` |\n| `MCP_PUBLIC_URL` | Public origin override for reverse-proxy deployments. | — |\n| `MCP_SESSION_MODE` | HTTP session posture: `auto`, `stateful`, or `stateless`. No tool asks the caller for input mid-handler, so `src/index.ts` declares `stateless` and every deployment surface restates it. | `stateless` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`). | `info` |\n| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1`. | `in-memory` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n## Running the server\n\n### Local development\n\n- **Build and run:**\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:stdio\n  # or\n  bun run start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck   # Lint, format, typecheck, security\n  bun run test       # Vitest test suite\n  bun run lint:mcp   # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t un-comtrade-mcp-server .\ndocker run --rm -e COMTRADE_SUBSCRIPTION_KEY=your-key -p 3010:3010 un-comtrade-mcp-server\n```\n\nThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/un-comtrade-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.\n\n## Project structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/index.ts` | `createApp()` entry point — registers tools, resources, and inits services. |\n| `src/config` | Environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Nine tools across reference resolution, trade data, and workflow aggregations. |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). Country list and HS hierarchy resources. |\n| `src/services/comtrade-data` | `ComtradeDataService` — authenticated/preview request builder with retry and key fallback. |\n| `src/services/comtrade-reference` | `ComtradeReferenceService` — reference data loader (countries, HS, EBOPS), startup cache, keyword search. |\n| `src/services/comtrade-meta` | `ComtradeMetaService` — data availability and dataset metadata endpoints. |\n| `tests/` | Unit and integration tests mirroring `src/`. |\n\n## Development guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage\n- Register new tools and resources via the barrels in `src/mcp-server/*/definitions/index.ts`\n- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields\n- Reference data (countries, HS codes) joins must pull from the startup cache, not per-request fetches\n\n## Data license\n\nThe UN Comtrade license agreement (§5) prohibits redistributing data without prior written UN permission. Connect with your own Comtrade subscription key.\n\n## Contributing\n\nIssues are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](./LICENSE) for details.\n","readmeFilename":"README.md"}