Agent and assistant integrations
Use OilPriceAPI with Claude, ChatGPT and Gemini
Connect latest available energy data through MCP or the REST API. Returned data includes source timestamps; coverage and refresh cadence depend on the selected dataset and account entitlement.
Claude, Cursor and VS Code
MCP server
Install the maintained npm package and expose price, history, futures, and account-authorized tools to an MCP-compatible client.
ChatGPT
OpenAPI action
Use the versioned API specification and Token authorization in a ChatGPT workspace that supports external actions.
Gemini CLI
Official extension
Install the OilPriceAPI Gemini CLI extension, then provide the same OILPRICEAPI_KEY environment variable.
MCP setup
Claude Desktop, Claude Code, Cursor and VS Code
- Install Node.js 18 or newer.
- Add the configuration to your client's MCP configuration file.
- Restart the client and ask it to list OilPriceAPI tools before making a request.
The package can run in limited demo mode without a key. Account tools and full dataset access require a key and the applicable entitlement.
{
"mcpServers": {
"oilpriceapi": {
"command": "npx",
"args": ["-y", "oilpriceapi-mcp"],
"env": {
"OILPRICEAPI_KEY": "YOUR_API_KEY"
}
}
}
}ChatGPT setup
Connect a workspace action to the versioned REST API
1. Import the API definition
OpenAPI documentation2. Configure authentication
Authorization: Token YOUR_API_KEY3. Verify the first request
/v1/prices/latest?by_code=BRENT_CRUDE_USDExternal actions depend on the capabilities and policy of the selected ChatGPT workspace. OilPriceAPI does not receive the chat prompt; it receives only the API request sent by the configured action.
Gemini CLI
Install the maintained extension
gemini extensions install https://github.com/OilpriceAPI/gemini-extensionSet OILPRICEAPI_KEY in your local environment, then review the extension's requested tools before enabling it.