OilPriceAPI — Real-Time Oil, Gas & Commodity Prices for AI Agents
@OilpriceAPI
About OilPriceAPI — Real-Time Oil, Gas & Commodity Prices for AI Agents
Give your AI agent live energy markets in one install.
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"oilpriceapi": {
"command": "npx",
"args": [
"-y",
"oilpriceapi-mcp"
],
"env": {
"OILPRICEAPI_KEY": "<YOUR_KEY — optional, demo mode works without it>"
}
}
}
}Tools
26Get the current real-time spot price of an energy commodity. Use when the user asks about a single commodity's current price. Accepts natural language ('brent oil', 'diesel') or API codes ('WTI_USD'). Returns price, currency, 24h change, and timestamp. For multiple commodities at once, use opa_market_overview. For price trends, use opa_get_history.
Get current prices for all tracked energy commodities in one call. Use when the user wants a broad market snapshot or asks about overall energy prices. Returns prices grouped by category (oil, gas, coal, refined products, metals, forex) with 24h changes. Supports filtering by category. For a single commodity, use opa_get_price instead.
Compare current prices between 2-5 commodities side by side. Use when the user asks to compare commodities (e.g., 'Brent vs WTI', 'US gas vs EU gas'). Returns each commodity's price with 24h changes, plus the spread if comparing two same-currency commodities. Accepts natural language or codes.
List all available commodities that can be queried for prices. Use when the user asks what commodities are available, what codes to use, or when another tool returns a 'commodity not recognized' error. Returns the full catalog fetched live from the API, grouped by category. No parameters needed.
Get historical price data for a commodity over a time period. Use when the user asks about price trends, historical prices, or how a commodity has performed over time. Returns high, low, average, change, and data point count. Periods: day (24h), week (7d), month (30d), year (365d).
Get the latest front-month futures contract price for energy commodities. Use when the user asks about futures, forward prices, or contract prices. Supports crude oil (BZ/ice-brent = Brent, CL/ice-wti = WTI), ICE Gasoil (ice-gasoil), natural gas (natural-gas), European TTF gas (ttf-gas), LNG JKM (lng-jkm), EUA carbon (eua-carbon), and UK carbon (uk-carbon). For the full forward curve across all contract months, use opa_get_futures_curve instead.
Get the full futures forward curve showing prices across all contract months. Use when the user asks about the forward curve, contango/backwardation, or term structure. Supports crude oil (BZ/ice-brent = Brent, CL/ice-wti = WTI), ICE Gasoil (ice-gasoil), natural gas (natural-gas), European TTF gas (ttf-gas), LNG JKM (lng-jkm), EUA carbon (eua-carbon), and UK carbon (uk-carbon). Returns a table of contract months with settlement prices, plus market structure analysis.
Get latest marine fuel (bunker) prices across major shipping ports. Use when the user asks about bunker fuel, marine fuel, VLSFO, MGO, IFO380, or shipping fuel costs. Can filter by port (e.g., SINGAPORE, ROTTERDAM, HOUSTON) and/or fuel type (VLSFO, MGO, IFO380). Returns a table of port prices.
Get the latest US oil and gas rig count data (Baker Hughes). Use when the user asks about drilling activity, rig counts, or oil field operations. Returns oil rigs, gas rigs, total count, and week-over-week change. No parameters needed.
Get drilling intelligence data including active wells, permits issued, and completions by region. Use when the user asks about drilling activity, well permits, or upstream operations. Returns totals and regional breakdown.
Get the current average retail diesel price for a US state. Use when the user asks about diesel prices in a specific state, diesel fuel costs by state, or state-level fuel prices. Accepts state names ('California') or 2-letter codes ('CA'). Returns the AAA-sourced state average diesel price. Covers all 50 states plus DC.
Get oil storage and inventory levels for Cushing, Oklahoma (WTI delivery hub) and/or the US Strategic Petroleum Reserve (SPR). Use when the user asks about oil inventories, storage levels, Cushing stocks, or the SPR. Returns current inventory levels with changes.
Get the latest OPEC oil production data. Use when the user asks about OPEC output, production quotas, supply cuts, or OPEC+ compliance. Returns country-level production figures. Requires a paid plan with energy intelligence access.
Get energy price forecasts from EIA Short-Term Energy Outlook (STEO) and other sources. Use when the user asks about price predictions, outlooks, or where oil/gas prices are heading. Returns forecast data for key commodities. Requires a paid plan with energy intelligence access.
Get the latest EIA weekly petroleum inventory (stocks) data. Use when the user asks about oil inventories, crude stocks, weekly EIA stocks, inventory builds/draws, or product-level inventory levels. Returns the latest weekly figures; optionally a summary view or a breakdown by petroleum product. Requires a paid plan with energy intelligence access.
Get the latest US oil & gas well drilling permit data. Use when the user asks about well permits, new drilling permits, permitting activity, or upstream permit trends. Returns the latest permits; optionally filtered/aggregated by state or by operator. Requires a paid plan with energy intelligence access.
Get refining and trading spreads: crack spreads (refining margin proxy), basis spreads (regional price differentials), and blending/transport margins. Use when the user asks about crack spreads, 3-2-1 crack, refining margins, basis differentials, or blend/transport margins. Requires a paid plan with energy intelligence access.
Create a PERSISTENT price alert tied to the user's OilPriceAPI account. The alert engine continuously watches live prices and notifies the user (by email, plus webhook if a URL is given) when the commodity price crosses the threshold. Use when the user asks to be alerted/notified when a price goes above or below a level (e.g. 'tell me when Brent drops below $70'). REQUIRES an API key (OILPRICEAPI_KEY) — this writes to the user's account. Alerts persist until deleted; manage them with opa_list_price_alerts and opa_delete_price_alert.
List all PERSISTENT price alerts on the user's OilPriceAPI account. Use when the user asks what alerts they have set up, or to find an alert's id before deleting it. REQUIRES an API key (OILPRICEAPI_KEY) — alerts are account-scoped. No parameters needed.
Permanently delete a price alert from the user's OilPriceAPI account by id. Use when the user wants to remove/cancel/stop an existing alert. Get the id from opa_list_price_alerts first. This permanently removes the alert from the user's account. REQUIRES an API key (OILPRICEAPI_KEY).
Get recent trigger activity for the user's price alerts — which alerts have fired, how many times, and when they last triggered. Use when the user asks whether any alerts have gone off or about recent alert activity. REQUIRES an API key (OILPRICEAPI_KEY). Note: the API tracks trigger history as per-alert counters (trigger_count / last_triggered_at) rather than a separate event feed, so this returns alerts that have triggered.
Get a multi-commodity market brief: latest spot prices, 24h changes, 1-month forecasts (for Brent/WTI/Natural Gas), and notable spreads — for several commodities in ONE call. Use when the user wants a market snapshot, morning brief, or an at-a-glance read across multiple commodities. Set `narrative: true` to also get a plain-English summary plus market context (active supply disruptions, key economic indicators). Accepts natural language ('brent', 'us gas') or API codes. REQUIRES an API key (OILPRICEAPI_KEY); counts as 1 request. Per-tier code limits apply (free: 3 codes). For a single price use opa_get_price; for ongoing recurring monitoring use opa_create_price_subscription.
Create a PERSISTENT, recurring price subscription (a 'watch') tied to the user's OilPriceAPI account. The API snapshots the watched commodities every `interval` and records an event each time — so the agent can come back later and poll for what changed via opa_get_subscription_events. Use when the user wants ONGOING monitoring of one or more commodities (e.g. 'keep watching Brent and WTI every hour'). This is different from a price alert: a watch ALWAYS emits an event every interval (a running log), whereas an alert only fires when a threshold is crossed. REQUIRES an API key (OILPRICEAPI_KEY) — this writes to the user's account. Events are POLLED, not pushed: there is no always-on connection. Manage watches with opa_list_subscriptions and opa_delete_subscription. Per-tier limits apply (free: 1 watch, 3 codes, 1h minimum interval); the API returns the exact limit if exceeded.
List all PERSISTENT price subscriptions ('watches') on the user's OilPriceAPI account. Use when the user asks what they're monitoring, or to find a watch's id before deleting it. Each watch is a recurring, account-tied snapshot job. REQUIRES an API key (OILPRICEAPI_KEY). No parameters needed.
Permanently delete a price subscription ('watch') from the user's OilPriceAPI account by id. Use when the user wants to stop/cancel/remove an ongoing watch. Get the id from opa_list_subscriptions first. This permanently removes the recurring watch (and its event history) from the account. REQUIRES an API key (OILPRICEAPI_KEY).
Poll for new subscription events — the recurring snapshots recorded by the user's watches. Use this to catch up on what changed since the last poll: pass the `since` cursor (the seq number) returned by the previous call to get only newer events. Events are POLLED, not pushed — there is no always-on connection, so call this periodically to stay current. Each event carries a price snapshot plus per-code deltas vs the prior snapshot. The returned `cursor` is what you pass as `since` next time. REQUIRES an API key (OILPRICEAPI_KEY). This poll does NOT count against the monthly request quota.
Overview
What is OilPriceAPI?
OilPriceAPI is a commodity-data MCP server that gives AI agents live energy markets. It serves fintech dashboards, fleet and logistics tools, and maritime compliance platforms, processing over 2 million requests per month.
How to use OilPriceAPI?
Run npx -y oilpriceapi-mcp in any MCP-compatible environment, or install the one-click Claude Desktop extension from the GitHub releases. It works instantly in demo mode with no API key or signup, and a free tier unlocks 40+ commodities.
Key features of OilPriceAPI
- 26 production-grade tools: real-time spot prices, historical ranges, futures curves, alerts, and market briefs
- 70+ commodities including Brent, WTI, natural gas, EU carbon allowances, and gold
- Natural-language lookup — ask for "brent" or "european gas", not ticker codes
- Works instantly in demo mode — no API key or signup required
- Tool annotations (read-only/destructive hints) for agent framework auto-approval
- Automatic retries with backoff and typed error messages
Use cases of OilPriceAPI
- Powering fintech dashboards with live energy and commodity prices
- Informing fleet and logistics cost models with real-time fuel and bunker prices
- Supporting maritime compliance platforms with market data
- Enabling AI agents to fetch commodity price data via natural language queries
FAQ from OilPriceAPI
How do I try OilPriceAPI without signing up?
You can run it in demo mode immediately using npx -y oilpriceapi-mcp — no API key or registration is needed.
What commodities are supported?
Over 70 commodities including Brent, WTI, Dubai crude, natural gas (Henry Hub, TTF, JKM LNG), EU carbon allowances (ETS), diesel, jet fuel, marine bunker fuels (VLSFO), gasoline, heating oil, coal, and gold.
What runtime or dependencies does it require?
It runs via npx (Node.js) and works with any MCP-compatible client framework. There are no other server-side dependencies.
How does authentication work?
The server supports demo mode (no key) and a free API key tier that unlocks 40+ commodities. Keys are obtained from the OilPriceAPI website.
Does it support agent-safe tool calling?
Yes, it provides tool annotations with read-only/destructive hints so agent frameworks can auto-approve safe calls.
More Productivity MCP servers
Computer Control MCP
AB498MCP server that provides computer control capabilities, like mouse, keyboard, OCR, etc. using PyAutoGUI, RapidOCR, ONNXRuntime. Similar to 'computer-use' by Anthropic. With Zero External Dependencies.
Todo List MCP Server
RegiByteAn MCP server for managing todos within LLMs, created for educational purposes
MCP Google Calendar Server
markelaugust74A Model Context Protocol (MCP) server implementation for Google Calendar integration. Create and manage calendar events directly through Claude or other AI assistants.
C++ Excel Automation MCP Server
smileFAaceA MCP server for automatically create, view and modify Excel related file using LLM
Desktop Commander MCP
wonderwhy-erThis is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities
Comments