
OilpriceAPI
io.github.OilpriceAPI由 GitHub 帳號 OilpriceAPI 發布v3.6.0更新於 Oct 24, 2026
Source-timestamped energy data and reviewed OilPriceAPI product facts for MCP clients.
概覽
本機 MCP 伺服器,讓助理取得附來源時間戳的石油、天然氣、LNG、碳與燃料價格、期貨、船用燃料及能源市場資料
- 可以做什麼
- 查詢單一商品的目前現貨價格,比較 2-5 種商品及價差,列出商品目錄並取得依類別分組的市場概況,可直接使用 brent oil、natural gas 等自然名稱而非代碼;無金鑰時可用有限商品的示範模式,另有經審閱的產品事實工具與資源,說明報價、時效、驗證、權益與資料權利。取得歷史價格與依日期區間的小時到月度資料、近月期貨、含正逆價差分析的完整遠期曲線,以及依合約月份的期貨 OHLC 歷史。查詢依港口與燃料類型劃分的船用燃料價格、加油港口目錄與船用燃料歷史,以及美國各州零售柴油價格和零擔與包裹承運商燃油附加費。
- 適用情境
- 當助理需要能源市場背景時使用:原油、天然氣、LNG、碳、柴油、航空燃油或船用燃料價格,價差與裂解價差分析,期貨曲線,鑽機數量,OPEC 產量,庫存水位,EIA 庫存與預測,或鑽井許可與產量資料。適用於市場簡報、車隊與燃油附加費計算、航次成本、海事法規遵循與宏觀研究。無金鑰示範足以在註冊前評估資料是否合適。
- 執行需求
- 透過 stdio 在本機執行,通常以 npx 從 npm 套件 oilpriceapi-mcp 啟動,因此需要 Node.js;也提供容器建置方式。OilPriceAPI 帳戶與 OILPRICEAPI_KEY 中的 API 金鑰為選用:未提供時伺服器執行有限的免金鑰示範。選用設定包括 OILPRICEAPI_BASE_URL、OILPRICEAPI_MCP_SCOPE(預設 read)、OILPRICEAPI_MCP_PROFILE 與 OILPRICEAPI_MCP_CATEGORIES。需要連線至 api.oilpriceapi.com 的網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 OilpriceAPI,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
OilPriceAPI MCP Server
Give compatible AI clients source-timestamped oil, gas, LNG, carbon, fuel, and related energy data through MCP. No API key is needed to try the limited demo.
Get a Free API Key · Documentation · API Explorer · Pricing
Backed by OilPriceAPI, a normalized REST API for energy dashboards, fleet and logistics tools, maritime workflows, and market research.
Canonical sources: Public product facts · Official MCP Registry record
Features
- Reviewed product facts — a keyless read-only tool and stable resource for offer, freshness, authentication, catalog, entitlement, and data-rights questions
- Data and workflow tools — latest values, history, futures, marine fuels, fuel surcharges, energy intelligence, alerts, market briefs, and persistent watches
- Resources — the reviewed product contract plus subscribable price snapshots
- Prompts — analyst templates for briefings, spread analysis, gas markets, diesel costs, and supply analysis
- Natural language — ask for "brent oil" or "natural gas", not codes
- Broad catalog — oil, gas, coal, refined products, metals, forex, bunker fuels, state diesel, and selected energy-intelligence datasets; access varies by plan and account
- Smart errors — unrecognized commodities get suggestions, not silent fallbacks
Quick Start
The default scope is read-only. Account mutations are not listed and direct mutation calls are rejected unless write scope is explicitly enabled:
Inspect the package without opening an MCP stdio session:
--config generates client-native, copy/paste-valid JSON for
claude-desktop, claude-code, cursor, vscode, cline, or windsurf.
It never reads or prints the configured API key. Claude Code, VS Code, and
Windsurf outputs use their supported environment or secure-input references;
Claude Desktop, Cursor, and Cline use an explicit local replacement marker.
Add --demo to omit API-key configuration entirely. Scope, profile, and
category options are preserved in the generated server arguments.
What can your agent get?
Example commodity codes:
Installation
Try it without an API key
The server works out of the box in keyless demo mode — just omit OILPRICEAPI_KEY from the configs below. The price tools (opa_get_price, opa_compare_prices, opa_list_commodities, opa_market_overview) serve latest available values for a limited demo commodity set, and every other data tool explains its account requirements. Demo responses are marked with a footer. For the broader account-enabled catalog, history, futures, and alerts, get a free API key and add it to your config.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code
Add to your project's .mcp.json:
Cursor
Add to .cursor/mcp.json in your project root:
VS Code + Cline
Add to .vscode/mcp.json:
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Global Install
Build the Container
Container builds require the source revision and commit timestamp so the image, capability manifest, and build metadata are traceable to the same checkout:
The runtime image uses the unprivileged node user. Omit OILPRICEAPI_KEY for
the limited keyless demo, or inject it with your container platform's secret
manager. Do not bake credentials into the image.
Transport
This server runs locally over stdio only. Its MCP Registry record lists the npm package and no remote endpoint.
The hosted connector at https://mcp.oilpriceapi.com/mcp is not this server.
It is a separate, smaller set of energy_* tools with OAuth account linking,
used by hosted clients that cannot launch a local process. Use this package for
the full opa_* tool set.
Environment Variables
Tool Scope and Profiles
read scope includes all non-mutating tools, including alert history,
subscription listing, and subscription event polling. The four create/delete
tools require --scope write or OILPRICEAPI_MCP_SCOPE=write. Unknown scope,
profile, or category values fail closed before stdio starts.
Profiles reduce tool overload without replacing first-class MCP actions:
For example, a read-only price and product-facts server can use:
Doctor and Capability Contract
doctor checks the Node runtime, package entry point, API reachability, key
validity, current plan, and reported feature gates. doctor --demo performs a
bounded keyless request. Failures distinguish missing configuration, 401, 402,
403, 429, timeout, DNS/TLS, and upstream 5xx responses. The API key is never
printed.
Every package includes build/capabilities.json. It is generated from the same
SDK registry used by tools/list and records the package/version/source commit,
minimum Node version, scopes, profiles, exact inventories, per-tool annotations,
key/entitlement requirements, resources, commands, and support URLs. Website and
docs consumers should pin a package version, validate schemaVersion and
sourceCommit, and update the artifact only through an explicit dependency
upgrade. They should not scrape CLI prose or hard-code tool counts.
API-to-MCP capability ledger
capability-ledger.json records an explicit decision for every operation in
the published OilPriceAPI contract (https://api.oilpriceapi.com/openapi.json).
Each operation is either exposed, naming the registered tool(s), or
not_exposed with a disposition (selected, deferred, alias,
unsupported, internal) and a one-line reason. Families group operations into
workflows, including preview API families the server calls that are not in the
canonical contract yet.
npm run build && npm run check:capability-ledger compares the ledger with the
live contract, build/capabilities.json and the REST paths src/index.ts
calls. It exits 1 on drift, such as a new API operation with no decision, a
removed one, or an unrecorded tool or path. It exits 2 when it cannot check: the
contract is unreachable, the build manifest is missing, or the route-policy
snapshot is older than its stated threshold. CI runs it on every pull request
and daily. When a decision changes, bump ledgerVersion, append to changes,
and link that change from the release notes.
Tools
All tools are prefixed with opa_ to avoid name collisions when multiple MCP servers are loaded.
Price Alert Tools (authenticated)
These tools create and manage persistent price alerts tied to your OilPriceAPI account, so they require an API key (OILPRICEAPI_KEY). The alert engine evaluates eligible source updates and notifies you (by email, plus webhook if you provide one) when a condition is met.
Market Brief & Subscription Tools (authenticated)
The market brief gives a multi-commodity snapshot in one call. Subscriptions ("watches") are persistent, recurring snapshots tied to your account — the API records an event every interval, and the agent polls for new events via a per-user cursor (events are polled, not pushed — there is no always-on connection). These require an API key (OILPRICEAPI_KEY). A subscription differs from an alert: a watch always emits an event each interval (a running log), whereas an alert fires only on a threshold crossing. Per-account code, watch, and cadence limits apply; the API response is authoritative and returns the current limit when exceeded.
Example Questions
Resources
Subscribable price data (JSON):
Product Facts and Model Knowledge
opa_get_product_facts and oilpriceapi://product-facts improve accuracy for a connected MCP session. They do not retrain a model or update its general knowledge. The server prefers the canonical keyless contract, uses a bounded cache, and labels any checksum-verified package fallback with source and warning metadata.
Prompts
Pre-built analyst templates:
Natural Language Support
Development
Breaking Changes in v3.0.0
- The default tool scope is now read-only. Create/delete alert and subscription
tools require explicit
--scope writeorOILPRICEAPI_MCP_SCOPE=write. - Invalid scope/profile/category configuration now fails before MCP stdio starts.
- Use
--list-tools --jsonor--capabilities --jsoninstead of relying on a hard-coded inventory.
Breaking Changes in v2.0.0
- All tool names now use
opa_prefix (e.g.,get_commodity_price->opa_get_price) - Unrecognized commodity names now return an error with suggestions instead of silently defaulting to Brent
list_commoditiesnow fetches live from the API (falls back to static list if unavailable)
The whole OilPriceAPI toolbox
Same data, every stack:
Explore the API
- 🧭 Interactive explorer: api.oilpriceapi.com/swagger — try every endpoint in the browser (demo mode, no key needed)
- 📜 OpenAPI spec: swagger.json
Privacy Policy
This MCP server runs locally on your machine and only communicates with the OilPriceAPI service:
- What is sent: tool requests are translated into HTTPS calls to
api.oilpriceapi.com(commodity codes, query parameters such as time period or state, carrier slugs and service-level inputs for fuel surcharges, and — for alert/subscription tools — the alert parameters you specify), authenticated with your API key. No conversation content is transmitted — only the structured tool inputs above. - API key storage: your key is stored locally in your MCP client's configuration (or the
OILPRICEAPI_KEYenvironment variable). It is sent only toapi.oilpriceapi.comas an Authorization header. - Logging and demand telemetry: each tool emits a local structured hit/miss event to stderr and attributes its API request with the tool name plus a deliberately lossy argument shape. Commodity codes, intervals, state codes, and bounded numeric controls may be retained; free text, prompts, names, IDs, API well numbers, coordinates, and thresholds are reduced to
provided. API request logging follows the OilPriceAPI Privacy Policy. - Third parties: no data is shared with third parties beyond what that policy describes.
- Demo mode: without an API key, price tools call the keyless demo endpoint on the same host; no key or account data is involved.
Questions: [email protected]
Pricing Boundary (HTTP 402)
Where the free/paid line sits for this server (#10):
- Always open: the MCP server itself (MIT), setup, docs, discovery (tool listing), and keyless demo mode for low-volume evaluation.
- API key: use the public product facts and your account response for the current trial, allowance, reset window, and dataset entitlement. Keyless demo mode remains available for a limited dataset.
- Behind the paywall: high-volume usage and premium datasets (futures, energy intelligence, well permits/production, alerts at scale). When a request crosses that boundary the API returns a standard HTTP 402/403/429 with the exact limit or feature gate in the body, and this server surfaces that message plus an upgrade link — agents get a machine-readable stop, never a silent failure.
- x402 protocol: per-request crypto micropayments via the x402 protocol are not currently supported — payment is by account plan (Stripe), authenticated with your API key.
License
MIT
Links
Also Available As
- Python SDK - Python client with Pandas integration
- Node.js SDK - TypeScript/JavaScript SDK
- Go SDK - Idiomatic Go client
- OpenBB Integration - OpenBB Platform provider
來源:README.md,提交 8a6c36a
工具
0版本歷史
4- v3.6.0最新Oct 18, 2026
- v3.5.0Oct 16, 2026
- v3.4.2Oct 3, 2026
- v3.4.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分