MCP server
commodities.sh serves 30 streamable HTTP MCP tools at https://api.commodities.sh/api/mcp. 7 of them answer with no account and no credential. The rest take a Pro credit key in the Authorization header.
1. Connect
Point any MCP host at the endpoint directly. Nothing to install and no third-party account — this is the whole tool set.
claude mcp add --transport http commodities https://api.commodities.sh/api/mcpCursor takes the same shape in .cursor/mcp.json — the JSON under step 4 below, with or without the headers block.
Claude Desktop
Desktop is the exception: its claude_desktop_config.json takes local command-line servers, so a remote URL does not go there. Add it through the interface instead — Settings (Ctrl+,) → Connectors → Add custom connector — and paste:
https://api.commodities.sh/api/mcpThat gets you the 7 free tools. Custom connectors authenticate with OAuth and have no field for a static key, so a Pro key needs the stdio bridge in step 4.
Published as
io.github.sawftware-apps/commodities-sh in the official MCP Registry, pointing at the same endpoint above. That entry is the canonical record of who publishes this server, and it is what the directories read — but it is a feed rather than a storefront, so the endpoint stays the way to connect. All 30 tools are on it.
2. What works immediately
These 7 need no credential. They are the reference layer — call them before paying for anything, because the paid tools take codes that only these can tell you.
- catalog.listEvery instrument with its unit, freshness class and source
- catalog.searchResolve a commodity name or synonym to an instrument code
- calendar.getEIA, USDA and CFTC release cadence with the next expected date
- trade.codesResolve a country to the M49 code the trade tools require
- minerals.listMineral coverage, curated HS codes and the comparability caveats
- cash.reportsWhich AMS cash grain reports exist, and how fresh each one is
- account.quotaCredits left on this key and the scopes it may read
3. Call a tool
Your agent host does this for you once connected. Over raw JSON-RPC it looks like this — no credential, real response:
curl -s -X POST https://api.commodities.sh/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"catalog.search","arguments":{"q":"crude"}}}'{
"query": "crude",
"results": [
{
"code": "CL",
"name": "WTI Cushing",
"sector": "energy",
"unit": "USD/bbl",
"available": true,
"match": "synonym",
"matched_on": "crude"
}
]
}4. The paid tools, and where the key goes
The other 23 tools need a key. It goes in the transport headers — never in a tool argument, since no tool takes one. Start with a free key at /signup — email, verify, done — which covers the price, FX, stats and spread tools plus a 30-day window of price.history at 50 calls a day. Positioning, inventories, fundamentals, minerals, trade and the packs need a Pro key from /get-started. Both go in the same header, so upgrading changes nothing here:
claude mcp add --transport http commodities https://api.commodities.sh/api/mcp \
--header "Authorization: Bearer cs_live_…"{
"mcpServers": {
"commodities": {
"type": "http",
"url": "https://api.commodities.sh/api/mcp",
"headers": {
"Authorization": "Bearer cs_live_…"
}
}
}
}Claude Desktop cannot send a static header through a custom connector, so route it through the mcp-remote bridge in claude_desktop_config.json. The colon has no space after it on purpose — Desktop on Windows and Cursor mangle spaces inside arguments — and the key lives in env so it stays out of the process list:
{
"mcpServers": {
"commodities": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.commodities.sh/api/mcp",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer cs_live_…"
}
}
}
}Call account.quota to confirm the key is being read — it is free, and it reports the credits left and the scopes the key may read.
5. What failure looks like
A paid tool with no credential answers with a readable tool error — HTTP 200, a normal JSON-RPC result, and a sentence naming the remedy. It used to return a bare HTTP 402 that never reached the tool layer, which is how a customer holding a valid key was told the server wanted a crypto payment. The x402 requirements still travel in structuredContent.accepts for any client that can settle them.
{
"jsonrpc": "2.0", "id": 1,
"result": {
"isError": true,
"content": [{ "type": "text", "text":
"No credential was sent, so price could not be served. Send a Pro credit key
as an HTTP header on this endpoint — Authorization: Bearer cs_live_… — and
the call will be billed against your monthly credits. …" }],
"structuredContent": {
"error": "PAYMENT_REQUIRED", "route": "price", "price_usd": 0.01,
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "10000" }]
}
}
}A key that arrived but is wrong says so in those words — a different answer from sending none at all, which is the distinction you need to tell a transport problem from a credential one:
{
"jsonrpc": "2.0", "id": 1,
"result": {
"isError": true,
"content": [{ "type": "text", "text":
"A key was sent but is not valid, so price was not served and nothing was
charged. … This is different from sending no key at all — the header did
arrive." }],
"structuredContent": { "error": "INVALID_API_KEY", "route": "price" }
}
}Settling x402 per call is still not something a standard MCP host does, even though the requirements now arrive with the error. Per-call payment is built for the REST API; over MCP, use a key.
I connected the server. What now?
Check the tools appear, then call one. 7 of the 30 tools need no credential — start with catalog.search to resolve a commodity name to an instrument code. The other 23 need a key in the Authorization header or an x402 payment; without either they return a 402 rather than data. A free key from /signup covers the price, FX, stats and spread tools. If no tools appeared at all, the server was added but your host has not reloaded it — restart the client, and check the endpoint you pasted ends in /api/mcp.
Do MCP tools require an API key?
The 7 free reference tools do not: catalog.list, catalog.search, calendar.get, trade.codes, minerals.list, cash.reports, account.quota answer immediately. The other 23 require either a Pro credit key sent as "Authorization: Bearer cs_live_…" on the MCP endpoint, or an x402 USDC payment. The header is the practical route for an MCP host; call account.quota to confirm your key is being read.
Where does the API key go in an MCP config?
In the transport headers, not in a tool argument — no tool takes a credential. In Claude Code's .mcp.json or Cursor's .cursor/mcp.json, add a "headers" object alongside "url" with "Authorization": "Bearer cs_live_…". With the Claude Code CLI, pass --header "Authorization: Bearer cs_live_…". Claude Desktop is the exception: its custom connectors authenticate with OAuth and have no field for a static key, so run it through the mcp-remote stdio bridge and pass the header there.
Can an MCP client pay with x402 automatically?
Not automatically. A paid tool called without a credential returns a readable tool error naming what to do, and the x402 payment requirements travel with it in structuredContent.accepts — so a client that can settle has everything it needs, but no standard MCP host does that today. For agent payments use the REST API, which is built for it; over MCP use a Pro credit key in the Authorization header.
What tools does commodities.sh MCP expose?
30 tools at https://api.commodities.sh/api/mcp, covering the catalogue, cash and fundamentals prices, EIA inventories, CFTC positioning, spreads, USDA and USGS fundamentals, cash grain bids, the minerals dossier, release surprises, trade flows, farm-gate prices and decision packs. Each maps to a REST capability and returns the same observation contract.
All 30 tools
- catalog.listfreeEvery instrument with its unit, freshness class and source
- catalog.searchfreeResolve a commodity name or synonym to an instrument code
- calendar.getfreeEIA, USDA and CFTC release cadence with the next expected date
- trade.codesfreeResolve a country to the M49 code the trade tools require
- minerals.listfreeMineral coverage, curated HS codes and the comparability caveats
- cash.reportsfreeWhich AMS cash grain reports exist, and how fresh each one is
- account.quotafreeCredits left on this key and the scopes it may read
- price.latestLatest cash or fundies print for one instrument
- price.bundleLatest prints for up to 20 instruments in one call
- price.historyStored history for one instrument
- price.statsVolatility, change and range over a window
- stats.bundleThe same statistics for up to 20 instruments at once
- fx.latestLatest FX cross rate, for converting a quote
- observation.resolveFetch one observation by its stable id, for citation
- inventory.getEIA weekly stocks with week-on-week and 5-year comparison
- positioning.getCFTC managed-money net positioning by instrument
- spread.getCrack, crush, WTI-Brent basis and calendar structure
- trade.calculateLanded cost, trade margin, break-even or an FX shock
- fundamentals.getWASDE, crop progress, export sales or the USGS summaries
- releases.nextWhen each report is due and what the last one printed
- cash.bidsCash elevator bids and basis across every AMS state report
- trade.flowBilateral trade volume and value between two countries
- trade.partnersEvery trading partner of one country, ranked by value
- trade.rankingEvery country ranked for one commodity, with unit values
- producer.pricesFAOSTAT farm-gate prices by country for one crop
- producer.prices.bundleFarm-gate prices for up to 20 crops in one call
- sourcing.compareFarm-gate against border unit value, country by country
- minerals.dossierMine production, reserves and export flows by country
- snapshot.getOne sector's prices, inventories, positioning and fundies
- decision.getRule-based signal pack with direction and rationale