fuelwatch-mcp
v1.0.0
Published
MCP server for Western Australia's FuelWatch fuel price data
Maintainers
Readme
FuelWatch MCP Server
An MCP server that gives Claude access to real-time fuel prices across Western Australia via the public FuelWatch RSS feed. No API key required.
Install
Claude Code
claude mcp add fuelwatch-mcp -- npx -y fuelwatch-mcpClaude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"fuelwatch-mcp": {
"command": "npx",
"args": ["-y", "fuelwatch-mcp"]
}
}
}From source (requires Bun 1.1.0+)
git clone https://github.com/crabcoder1/fuelwatch-mcp.git
cd fuelwatch-mcp
bun install
bun run src/index.tsTools
| Tool | Description |
|------|-------------|
| get-fuel-prices | Query fuel prices with filters for product, suburb, region, brand, and day |
| cheapest-fuel | Find the cheapest stations sorted by price with statistics |
| compare-brands | Compare average, min, and max prices across brands |
| nearby-stations | Find stations near a GPS coordinate within a given radius |
| price-summary | Get min, max, average, median, and standard deviation |
| list-products | List fuel types (Unleaded, Diesel, LPG, 98 RON, etc.) |
| list-regions | List all 62 WA regions with IDs |
| list-brands | List all 39 fuel brands with IDs |
| list-suburbs | List all 280+ supported suburbs |
Examples
After installing, try asking Claude:
- "What's the cheapest unleaded fuel in Perth right now?"
- "Compare diesel prices across brands in Mandurah"
- "Find fuel stations within 5km of Fremantle"
- "What's the price spread for 98 RON north of the river?"
Architecture
src/
index.ts Server entry point (stdio transport)
client.ts FuelWatch RSS fetch, XML parse, URL builder
constants.ts Products, regions, brands, suburbs reference data
types.ts Station and FuelPriceParams interfaces
utils/
haversine.ts Great-circle distance for nearby-stations
fuzzy-match.ts Levenshtein suburb matching for typo suggestions
tools/
register.ts Shared tool registration for all 9 tools
validation.ts Input validation with helpful error messages
get-fuel-prices.ts Station list formatting
cheapest-fuel.ts Price sorting with statistics
compare-brands.ts Brand aggregation
nearby-stations.ts Distance filtering and sorting
price-summary.ts Statistical summary
list-references.ts Reference data formattingThe server fetches XML from the FuelWatch RSS feed, parses it with fast-xml-parser, validates inputs with zod, and returns structured text via the Model Context Protocol.
Tool handlers are pure functions that accept station data and return formatted text. This separation keeps the handlers testable without network calls and allows the same logic to be reused across different transports.
Development
Requires Bun 1.1.0+. Not needed for the npx install above.
bun install # Install dependencies
bun test # Run 115 tests
bun run start # Start the MCP server (stdio)
bun run build # Bundle for npm distributionData Source
All fuel price data comes from the FuelWatch RSS feed, a free public service provided by the Government of Western Australia. Prices are published daily at 2:30 PM AWST.
License
MIT
