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.

MCP setup

Claude Desktop, Claude Code, Cursor and VS Code

  1. Install Node.js 18 or newer.
  2. Add the configuration to your client's MCP configuration file.
  3. 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 documentation

2. Configure authentication

Authorization: Token YOUR_API_KEY

3. Verify the first request

/v1/prices/latest?by_code=BRENT_CRUDE_USD

External 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-extension

Set OILPRICEAPI_KEY in your local environment, then review the extension's requested tools before enabling it.