Skip to main content
MCP Server · oilpriceapi-mcp on npm

OilPriceAPI MCP Server

Real-time commodity prices for Claude and AI agents. 26 tools, 70+ commodities — works in Claude Desktop, Claude Code, Cursor, VS Code, and any MCP client.

Try It in 60 Seconds

Pick your client, paste the config, and ask for "the current Brent price". Replace your-api-key-here with your key — or leave it out entirely to run in demo mode.

Claude Desktop

Config file: ~/Library/Application Support/Claude/claude_desktop_config.json (Windows: %APPDATA%\Claude\claude_desktop_config.json)

{
  "mcpServers": {
    "oilpriceapi": {
      "command": "npx",
      "args": ["-y", "oilpriceapi-mcp"],
      "env": {
        "OILPRICEAPI_KEY": "your-api-key-here"
      }
    }
  }
}

Claude Code

Config file: .mcp.json (project root)

{
  "mcpServers": {
    "oilpriceapi": {
      "command": "npx",
      "args": ["-y", "oilpriceapi-mcp"],
      "env": {
        "OILPRICEAPI_KEY": "your-api-key-here"
      }
    }
  }
}

Cursor

Config file: .cursor/mcp.json (project root)

{
  "mcpServers": {
    "oilpriceapi": {
      "command": "npx",
      "args": ["-y", "oilpriceapi-mcp"],
      "env": {
        "OILPRICEAPI_KEY": "your-api-key-here"
      }
    }
  }
}
# Or run it directly to check your setup
npx -y oilpriceapi-mcp
No API Key Required

Demo mode: try it before you sign up

Skip the env block and the server runs in demo mode with a limited commodity set — Brent, WTI, diesel, and gasoline — using live data. A free API key unlocks 40+ commodities plus history, futures, supply data, alerts, and watches.

Get a Free API Key

26 Tools

Every tool is prefixed with opa_ to avoid collisions when multiple MCP servers are loaded. Your AI assistant picks the right tool from your question — no codes to memorize.

Prices & History

opa_get_priceCurrent spot price for a single commodity
opa_market_overviewAll commodity prices in one call, grouped by category
opa_compare_pricesSide-by-side comparison of 2-5 commodities with spread
opa_list_commoditiesFull commodity catalog, fetched live from the API
opa_get_historyHistorical prices with high/low/avg/change (day/week/month/year)

Futures & Spreads

opa_get_futuresFront-month futures (Brent BZ, WTI CL, ICE Gasoil, TTF, JKM, EUA)
opa_get_futures_curveFull forward curve with contango/backwardation analysis
opa_get_spreadRefining and trading spreads (crack, basis, margin)

Supply & Production Data

opa_get_marine_fuelsBunker fuel prices by port and fuel type (VLSFO/MGO/IFO380)
opa_get_rig_countsBaker Hughes US rig count with week-over-week change
opa_get_drillingDrilling intelligence: wells, permits, completions by region
opa_get_diesel_by_stateAAA retail diesel price for any US state (50 states + DC)
opa_get_storageCushing and SPR oil storage and inventory levels
opa_get_opec_productionOPEC country-level production data
opa_get_forecastsEIA STEO energy price forecasts
opa_get_oil_inventoriesEIA weekly petroleum stocks (latest/summary/by product)
opa_get_well_permitsUS well drilling permits (latest/by state/by operator)

Market Brief

opa_get_market_briefMulti-commodity brief: prices, 24h changes, 1-month forecasts, spreads

Price AlertsAPI key required

opa_create_price_alertCreate a persistent alert (commodity, operator, threshold, optional webhook)
opa_list_price_alertsList all alerts on the account
opa_delete_price_alertPermanently delete an alert by id
opa_get_alert_triggersRecent alert trigger activity

Watches & SubscriptionsAPI key required

opa_create_price_subscriptionCreate a recurring price watch (codes, interval like 5m/1h/daily)
opa_list_subscriptionsList all watches on the account
opa_delete_subscriptionPermanently delete a watch by id
opa_get_subscription_eventsPoll for new watch events since a cursor

Frequently Asked Questions

What is MCP?

The Model Context Protocol (MCP) is an open standard that lets AI assistants like Claude connect to external data sources and tools. An MCP server exposes capabilities — here, real-time commodity price tools — that any MCP-compatible client can discover and call. Instead of copy-pasting prices into your chat, your AI assistant fetches live data itself.

Is it free?

The MCP server itself is open source and free to install. Demo mode works without any account. A free API key includes 200 requests/month; paid plans add higher limits and more data. See pricing.

Which clients are supported?

Claude Desktop, Claude Code, Cursor, VS Code (with Cline), Windsurf, and any other client that speaks the MCP protocol. The server runs locally via npx — no hosting required.

Do I need an API key?

Not to try it. Without a key the server runs in demo mode with a limited commodity set (Brent, WTI, diesel, gasoline). A free API key unlocks 40+ commodities plus history, futures, alerts, and watches.

Where is the source code?

On GitHub at github.com/OilpriceAPI/mcp-server (MIT licensed). The npm package is oilpriceapi-mcp.

Give Your Agent Live Commodity Data

Install in 60 seconds. Try it in demo mode, then unlock 40+ commodities with a free key.