
OilpriceAPI
io.github.OilpriceAPIPublished by GitHub account OilpriceAPIv3.6.0Updated Oct 24, 2026
Source-timestamped energy data and reviewed OilPriceAPI product facts for MCP clients.
Overview
Local MCP server that gives an assistant source-timestamped oil, gas, LNG, carbon and fuel prices, futures, marine fuels and energy market data from OilPriceAPI
- What you can do
- Look up current spot prices, compare 2-5 commodities with spreads, list the commodity catalog and get a grouped market overview, using natural names like brent oil or natural gas instead of codes, with a keyless demo for a limited set of commodities and a reviewed product-facts tool and resource describing the offer, freshness, authentication, entitlement and data rights. Retrieve history and dated ranges, front-month futures, full forward curves with contango/backwardation, and futures OHLC history per contract month. Query marine bunker prices by port and fuel type, the bunkering port directory and marine fuel history, plus US state retail diesel prices and LTL/parcel carrier fuel surcharg
- When to use it
- Use it when an assistant needs energy market context: crude, gas, LNG, carbon, diesel, jet fuel or bunker prices, spread and crack analysis, futures curves, rig counts, OPEC production, storage levels, EIA inventories and forecasts, or well permit and production data. It suits market briefings, fleet and fuel-surcharge math, voyage costing, maritime compliance and macro research. The keyless demo is enough to evaluate whether the data fits before signing up.
- Requirements
- Runs locally over stdio, typically launched with npx from the npm package oilpriceapi-mcp, so Node.js is needed; a container build is also documented. An OilPriceAPI account and API key in OILPRICEAPI_KEY are optional: without it the server runs a limited keyless demo. Optional settings include OILPRICEAPI_BASE_URL, OILPRICEAPI_MCP_SCOPE (read by default), OILPRICEAPI_MCP_PROFILE and OILPRICEAPI_MCP_CATEGORIES. Network access to api.oilpriceapi.com is required.
Installation
In SourceWeft
- Open OilpriceAPI in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit 8a6c36a
Tools
0Version history
4- v3.6.0LatestOct 18, 2026
- v3.5.0Oct 16, 2026
- v3.4.2Oct 3, 2026
- v3.4.1Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts