Oil Price MCP Server for Cursor
Get real-time Brent, WTI, and natural gas prices directly in Cursor. One JSON config file, broad commodity coverage, natural language queries.
Setup in 3 Steps
Get API Key
Sign up for a free API key at oilpriceapi.com. Takes 30 seconds, no credit card required.
Get free key →Add MCP Config
Create .cursor/mcp.json in your project root with the config below.
Ask Cursor
Restart Cursor and ask about commodity prices in natural language. No codes to memorize.
npm install -g oilpriceapi-mcpCursor MCP Configuration
Create this file at .cursor/mcp.json in your project root. Replace your-api-key-here with your actual API key.
{
"mcpServers": {
"oilpriceapi": {
"command": "npx",
"args": ["-y", "oilpriceapi-mcp"],
"env": {
"OILPRICEAPI_KEY": "your-api-key-here"
}
}
}
}How it works: When Cursor starts, it reads the MCP config and launches the OilPriceAPI server via npx oilpriceapi-mcp. The server provides documented tools that Cursor's AI can call to fetch commodity prices. No manual server management needed.
Documented MCP Tools
Once configured, Cursor's AI can call these tools automatically:
get_commodity_price
Get the current price of a specific commodity. Supports natural language input like "brent oil" or formal codes like BRENT_CRUDE_USD.
get_market_overview
Get prices for all commodities, filtered by category: oil, gas, coal, refined products, or all. Returns a complete market snapshot.
compare_prices
Compare 2-5 commodities side by side with spread calculations. Great for Brent-WTI spread analysis or cross-market comparisons.
list_commodities
List all 40+ available commodities with their codes and categories. Useful for discovering what data is available.
Example Queries in Cursor
Ask Cursor's AI assistant about commodity prices in natural language. The MCP server handles the translation.
"What's the current Brent crude price?"
Uses: get_commodity_price
Fetches real-time Brent crude spot price in USD/barrel
"Give me a full energy market overview"
Uses: get_market_overview
Returns all commodity prices grouped by category (oil, gas, coal, refined)
"Compare WTI and Brent oil prices"
Uses: compare_prices
Side-by-side comparison with spread calculation between commodities
"What commodities do you track?"
Uses: list_commodities
Lists all 40+ available commodities with their codes
"What's the price of European natural gas?"
Uses: get_commodity_price
Dutch TTF gas price in EUR/MWh — understands natural language aliases
"How much is gold and diesel right now?"
Uses: compare_prices
Cross-category comparison between precious metals and refined products
Why Developers Use Oil Prices in Cursor
Energy Trading Platforms
Building a CTRM or trading platform? Ask Cursor for current prices while writing code. Validate your API integration against live data without leaving the IDE.
Data Pipeline Development
Developing ETL pipelines for commodity data? Query the MCP server to verify data formats, test edge cases, and validate transformations with real market data.
Financial Dashboards
Building commodity dashboards? Use Cursor with the MCP server to test chart data, verify price feeds, and prototype visualizations with live commodity prices.
Frequently Asked Questions
How do I add the oil price MCP server to Cursor?
Create a .cursor/mcp.json file in your project root with the configuration shown above. Add your API key, restart Cursor, and the MCP server will be available automatically.
What is an MCP server?
MCP (Model Context Protocol) is an open standard created by Anthropic that lets AI tools access external data sources. The OilPriceAPI MCP server gives Cursor's AI real-time access to source-timestamped commodity prices through natural language queries.
Do I need Node.js installed?
Yes, Node.js 18+ is required to run the MCP server. Cursor launches it via npx, which comes with Node.js. If you're using Cursor, you likely already have Node.js installed.
Is it free?
The oilpriceapi-mcp npm package is free and open source. OilPriceAPI offers a free tier with 50 requests per day. Paid plans start at $19/month for 10,000 requests.
Does it work with Cursor's Agent mode?
Yes. MCP tools are available in both Cursor's Chat and Agent modes. In Agent mode, Cursor can automatically decide when to call the oil price tools based on your conversation context.
Start Using Oil Prices in Cursor
Get your free API key, add the MCP config, and start querying commodity prices in Cursor