OilPriceAPI MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> 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:
| Code | What it is | Typical agent use |
| ----------------- | ------------------------ | ------------------------------ |
| BRENT_CRUDE_USD | Brent crude (global) | market briefings, dashboards |
| WTI_USD | WTI crude (US) | trading context, macro models |
| NATURAL_GAS_USD | Henry Hub natural gas | energy analytics |
| DUTCH_TTF_EUR | TTF gas (Europe) | European energy, LNG analysis |
| JKM_LNG_USD | JKM LNG (Asia) | LNG trading & shipping |
| EU_CARBON_EUR | EU ETS carbon allowances | CBAM, maritime compliance, ESG |
| DIESEL_USD | Diesel (Gulf Coast) | fleet & fuel-surcharge math |
| JET_FUEL_USD | Jet fuel | aviation ops |
| VLSFO_USD | Marine bunker fuel | voyage costing |
| GOLD_USD | Gold | macro & portfolio context |
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,