oilpriceapi-mcp on npmOilPriceAPI 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"
}
}
}
}npx -y oilpriceapi-mcpDemo 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.
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_price | Current spot price for a single commodity |
opa_market_overview | All commodity prices in one call, grouped by category |
opa_compare_prices | Side-by-side comparison of 2-5 commodities with spread |
opa_list_commodities | Full commodity catalog, fetched live from the API |
opa_get_history | Historical prices with high/low/avg/change (day/week/month/year) |
Futures & Spreads
opa_get_futures | Front-month futures (Brent BZ, WTI CL, ICE Gasoil, TTF, JKM, EUA) |
opa_get_futures_curve | Full forward curve with contango/backwardation analysis |
opa_get_spread | Refining and trading spreads (crack, basis, margin) |
Supply & Production Data
opa_get_marine_fuels | Bunker fuel prices by port and fuel type (VLSFO/MGO/IFO380) |
opa_get_rig_counts | Baker Hughes US rig count with week-over-week change |
opa_get_drilling | Drilling intelligence: wells, permits, completions by region |
opa_get_diesel_by_state | AAA retail diesel price for any US state (50 states + DC) |
opa_get_storage | Cushing and SPR oil storage and inventory levels |
opa_get_opec_production | OPEC country-level production data |
opa_get_forecasts | EIA STEO energy price forecasts |
opa_get_oil_inventories | EIA weekly petroleum stocks (latest/summary/by product) |
opa_get_well_permits | US well drilling permits (latest/by state/by operator) |
Market Brief
opa_get_market_brief | Multi-commodity brief: prices, 24h changes, 1-month forecasts, spreads |
Price AlertsAPI key required
opa_create_price_alert | Create a persistent alert (commodity, operator, threshold, optional webhook) |
opa_list_price_alerts | List all alerts on the account |
opa_delete_price_alert | Permanently delete an alert by id |
opa_get_alert_triggers | Recent alert trigger activity |
Watches & SubscriptionsAPI key required
opa_create_price_subscription | Create a recurring price watch (codes, interval like 5m/1h/daily) |
opa_list_subscriptions | List all watches on the account |
opa_delete_subscription | Permanently delete a watch by id |
opa_get_subscription_events | Poll 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.