
CommodityPriceAPI
io.github.Commodity-Price-API由 GitHub 帳號 Commodity-Price-API 發布v1.2.3更新於 Oct 29, 2026
Real-time and historical prices for gold, silver, oil, and 130+ other commodities.
發布方自己的服務:PriceWin
概覽
CommodityPriceAPI 官方 MCP 伺服器,讓助理查詢黃金、白銀、原油等 140 多種商品的即時、盤中與歷史價格。
- 可以做什麼
- 取得一個或多個商品代碼的最新報價,並提供黃金、白銀快捷工具,含買賣價與按公克、克拉或托拉計價選項
- 依 1 分鐘到 1 天的間隔取得單一商品的盤中價格,可依起始時間分頁
- 查詢可回溯至 1990 年的某日開高低收、最長一年的每日時間序列,以及兩個日期之間的漲跌幅
- 列出支援的 245 個商品代碼及其名稱、類別、計價單位與更新頻率
- 查看目前 API 金鑰對應的方案、配額與用量
- 適用情境
- 適合想用自然語言詢問金屬、能源或農產品行情時使用,例如目前金價、某段歷史價格,或某商品在一段期間內的漲跌幅度,不必自行撰寫 API 呼叫。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 18 或更新版本及 npx。必須在 COMMODITYPRICEAPI_KEY 環境變數中提供 CommodityPriceAPI 金鑰,官方提供 7 天免費試用、2000 次請求。需要能連線至 CommodityPriceAPI 服務的網路。可用 COMMODITYPRICEAPI_REQUEST_TIMEOUT_MS 調整上游逾時(預設 15000 毫秒)。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 CommodityPriceAPI,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
CommodityPriceAPI MCP Server
[npm version] [GitHub] [Node.js] [License]
Official MCP server for CommodityPriceAPI. Exposes 9 MCP tools for real-time, intraday and historical commodity prices — gold, silver, oil, natural gas, wheat, coffee, and 140+ other commodities. Your AI assistant queries the market in plain English; the MCP server handles the API calls.
Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, Cline, Codex, and any other MCP-compatible client.
Quick Start
-
Get a free CommodityPriceAPI key — free 7-day trial, 2,000 requests, no card required.
-
Cursor users can install in one click:
-
Everyone else: add this to your MCP client config (see Install by Client for the exact file path):
-
Restart your client.
-
Test it: ask "What's the current gold price?"
Table of Contents
- Quick Start
- Install by Client
- Verify It Works
- Tool Reference
- Prompt Examples
- Example Answers and Tool Output
- Error Codes
- How It Works
- Environment Variables
- Building from Source
- Troubleshooting
- Pricing
- Links
- License
Install by Client
Requirements
- Node.js 18 or later
npxavailable in your terminal- A CommodityPriceAPI key — sign up free
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
Restart Claude Desktop after saving.
Claude Code
Start a new Claude Code session after adding the server.
Cursor
One-click install:
Or add to .cursor/mcp.json manually:
Restart Cursor after saving.
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Restart Windsurf after saving.
VS Code / GitHub Copilot
Add to your VS Code settings.json:
Restart VS Code after saving.
Cline
Open MCP Servers panel → Configure → Advanced MCP Settings. Add to cline_mcp_settings.json:
Restart Cline after saving.
Codex CLI
Start a new Codex session after adding the server.
Any Other MCP Client
Use this config:
Verify It Works
Try these after setup:
Tool Reference
All 9 tools map 1:1 to CommodityPriceAPI v3 endpoints. Tools that take symbols accept a comma-separated list; get_intraday_rates takes a single symbol (e.g. XAU,XAG,XPT,BRENTOIL-SPOT). Use list_symbols to look up valid symbols — there are 245 across Metals, Energy, Agriculture, and more.
Precious metals use ISO 4217 codes: XAU (gold), XAG (silver), XPT (platinum), XPD (palladium). Copper is XCU. The retired codes PL, PA, and HG still work on v3 — they are auto-resolved to the new symbol (see the note below).
get_latest_rates
GET /v3/rates/latest — latest rates for one or more symbols. Rates may lag up to 10 minutes depending on plan.
Note on unresolved: v3 appends an unresolved map, keyed by the symbol you typed, in three cases. The same applies to get_intraday_rates, get_historical_rates, get_time_series, and get_fluctuation.
get_gold_price
GET /v3/rates/latest/xau — shortcut for the latest gold (XAU) rate, including bid/ask.
get_silver_price
GET /v3/rates/latest/xag — shortcut for the latest silver (XAG) rate, including bid/ask.
get_intraday_rates
GET /v3/rates/intraday — the rates of one symbol through a single UTC day at a chosen interval, from one minute to one day. Each point is the rate recorded at that exact mark (14:05 is the rate observed at 14:05 UTC), not an OHLC bar. Advanced and Enterprise plans only — other plans get 402.
A result holds at most 100 points. When nextStartTime is not null, call again with startTime set to it to get the next page; from 15m upward a whole day fits in one call. Marks with no recorded rate are left out, so count can be below the window size. Only symbols updated every second, minute, or 10 minutes have intraday data — others return 400 BAD_REQUEST. Rates are in the symbol's own currency; there is no quote parameter.
get_historical_rates
GET /v3/rates/historical — open/high/low/close rates for one or more symbols on a specific past date, available back to 1990-01-01. If no rate exists for that exact date, the API returns the nearest available date.
get_time_series
GET /v3/rates/time-series — daily historical rates for one or more symbols between two dates. Max span: 1 year.
get_fluctuation
GET /v3/rates/fluctuation — how each symbol changed between two dates: start rate, end rate, absolute change, and percent change.
list_symbols
GET /v3/symbols — all supported commodity symbols with name, category, quote currency, unit, and update interval. Takes no parameters. Call this before rate tools when unsure of a symbol.
get_usage
GET /v3/usage — current plan, quota, and usage for the configured API key. Takes no parameters.
Prompt Examples
Live prices
- What's the current gold price?
- What's gold per gram right now?
- Get the latest prices for silver, platinum, copper, and WTI crude.
- What's gold trading at in euros?
Historical data
- What was the price of wheat on January 2nd, 2026?
- Compare gold and silver prices over the last 30 days.
- Show me daily natural gas prices for Q1 2026.
Intraday
- Show gold's hourly price on November 4th, 2026.
- Give me silver's 5-minute rates between 14:00 and 16:00 UTC yesterday.
- When did Brent crude peak during yesterday's session?
Price changes
- How much did Brent crude fluctuate this quarter?
- Did gold go up or down since the start of the year, and by how much?
Discovery and account
- Which commodity symbols do you support for energy?
- How much of my API quota is left this month?
Example Answers and Tool Output
The text answers show what a client might say; exact wording depends on the model. JSON blocks are raw tool output.
Latest gold price
Prompt: What's the current gold price?
Example answer: Gold (XAU) is currently trading at $4,386.23 per troy ounce (bid $4,385.93 / ask $4,386.23).
Historical rate
Prompt: What was the gold price on January 2nd, 2020?
Example answer: On 2020-01-02, gold opened at $1,518.26 and closed at $1,528.76 per troy ounce (high $1,531.31, low $1,517.15).
Intraday rates
Prompt: Show gold's hourly price on October 14th, 2026, from 18:00 UTC.
Example answer: Gold moved between $3,958.84 and $3,967.38 per troy ounce from 18:00 to 23:00 UTC, ending the day at its high of $3,967.38.
Fluctuation
Prompt: How much did gold change between January 2nd and August 12th, 2026?
Example answer: Gold rose from $4,332.01 to $4,400.12 per troy ounce — up $68.11, or +1.57%.
Auto-resolved symbol
Prompt: What's the price of GOLD and platinum?
Example answer: Gold (XAU) is $4,386.23 and platinum (XPT) is $1,412.50 per troy ounce. Note: GOLD isn't a symbol code, so the API returned it under XAU.
Status is 200 — an entry with resolvedTo never downgrades the response.
Error Codes
Tool calls never crash the server. Upstream errors are returned as structured tool results with error, code, message, and a guidance field so the client can explain what went wrong instead of echoing a status code.
Example error result for an invalid symbol:
How It Works
This is a stdio MCP server that wraps the CommodityPriceAPI v3 REST API.
At runtime:
- Your MCP client starts the server process via
npx. - The client reads the tool list.
- When a prompt matches a tool, the client calls it.
- The server validates inputs, calls the CommodityPriceAPI, and returns structured JSON.
The server sends your API key to CommodityPriceAPI via both the x-api-key header and the apiKey query parameter — the upstream API accepts either, so this covers all cases without extra config.
Environment Variables
Building from Source
Run it directly:
Inspect with the MCP Inspector:
Troubleshooting
Client uses an old tool list after updating: Restart the client and confirm it loaded the latest npm version.
401 errors: Check that COMMODITYPRICEAPI_KEY is set in your MCP client config's env block.
A symbol is missing from a multi-symbol response: Look at the unresolved map in the result. If the entry has resolvedTo, nothing is missing — the rate is in rates under that symbol (e.g. GOLD → XAU, PL → XPT). Otherwise each missing symbol has a message and usually suggestions (e.g. OIL → WTIOIL-SPOT, BRENTOIL-SPOT, …). If there are no suggestions, call list_symbols to find the correct symbol.
499 timeouts: The upstream API did not respond in time. Increase COMMODITYPRICEAPI_REQUEST_TIMEOUT_MS (default: 15000 ms).
Pricing
Free 7-day trial with 2,000 requests, no card required. For plan details, see the CommodityPriceAPI pricing page.
Links
- CommodityPriceAPI Website
- API Documentation
- Supported Symbols
- MCP Integration Guide
- Pricing
- Sign Up Free
- GitHub Repository
License
來源:README.md,提交 f666af3
工具
0版本歷史
1- v1.2.3最新Oct 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Price 整合
PriceWin
win.price官方發布者
遠端 MCP 伺服器,可即時比較 Booking.com、Agoda、Trip.com、Traveloka 等平台的飯店與機票價格,並向合作飯店送出訂房請求。

Mcp Amazon Product Price Stock Tracker
com.mambabuilt
透過 Apify actor 依 ASIN 或商品連結讀取 Amazon 價格、庫存、賣家與評分,並在多次執行之間提供變動列。

Postage Stamp Price MCP
由 GitHub 帳號 theluckystrike 發布
遠端 MCP 伺服器,讓助理在呼叫時從 USPS Notice 123 讀取目前美國郵政零售郵資價格,並計算信件郵資。

Silver Price Per Gram MCP
由 GitHub 帳號 theluckystrike 發布
按純度和貨幣檢視每克白銀即時價格、舊銀幣價值以及金銀比。AI 翻譯

Emalls Price Comparison
由 GitHub 帳號 sepehr071 發布
非官方、唯讀的 Emalls(emalls.ir)比價 MCP 伺服器,可搜尋伊朗商家商品、報價、價格歷史與店家資料。