FuelPriceStation MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FuelPriceStation MCP find cheapest diesel near 52.52, 13.40"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FuelPriceStation MCP
A Model Context Protocol (MCP) server that provides fuel price data from the Tankerkoenig API. Search for nearby fuel stations by coordinates, filtered by availability and sorted by price.
Prerequisites
uv (Python package manager)
Python 3.12+
A Tankerkoenig API key — register here (optional — server runs in demo mode without one)
Related MCP server: gasolineras-mcp
Quickstart
# Clone and enter the project
cd FuelPriceStationMCP
# Copy env file and add your API key
cp .env.example .env
# Edit .env with your FUEL_MCP_TANKERKOENIG_API_KEY
# Install dependencies + set up pre-commit hooks
make dev
# Run all checks (lint, format, type-check, tests)
make check
# Start the MCP server
make runDevelopment
# Run with MCP Inspector + hot-reload
make dev-run
# Run tests only
make test
# Lint + format
make lint
make format
# Type check
make type-checkUsage
MCP Tool: search_fuel_prices
Parameter | Type | Default | Description |
| float | — | Latitude (-90 to 90) |
| float | — | Longitude (-180 to 180) |
| float | 15.0 | Search radius in km (max 25) |
| str |
| Sort by: |
| int | 10 | Max stations returned (max 50) |
Filtering Logic
Open stations only — filters out closed stations
Fuel availability — requires all fuel types, or at minimum E10
Sort by price — lowest price first for the selected fuel type
Architecture
src/fuel_price_mcp/
├── server.py # FastMCP server, tool registration
├── client.py # Tankerkoenig API client (httpx async)
├── models.py # Pydantic v2 models for API data
├── config.py # pydantic-settings with .env loading
├── factory.py # Client factory — real vs demo selection
├── demo.py # Demo client with mock scenarios
├── exceptions.py # Custom exception hierarchy
├── filters.py # Station filtering/sorting (open, fuel availability, price)
└── logging.py # Structured JSON logging to stderrEnvironment Variables
All variables use the FUEL_MCP_ prefix and can be set in .env (local dev) or passed directly by the MCP host.
Variable | Type | Default | Description |
| string |
| API key. When empty, server auto-falls back to demo mode. |
| string |
| Log level: |
| float |
| Default search radius in km |
| float |
| HTTP request timeout in seconds |
| string |
| API base URL |
| bool |
| Force demo mode on (also auto-activates when no API key is set) |
| string |
| Demo scenario: |
Demo Mode
Run the server with mock data — no API key required. Useful for local development, MCP tool integration testing, and agentic eval workflows.
Auto-fallback: Demo mode activates automatically when
FUEL_MCP_TANKERKOENIG_API_KEYis not set — no need to setFUEL_MCP_DEMO_MODE=trueexplicitly.
# Enable demo mode explicitly
FUEL_MCP_DEMO_MODE=true make run
# Use a specific scenario
FUEL_MCP_DEMO_MODE=true FUEL_MCP_DEMO_SCENARIO=empty make runAvailable Scenarios
Scenario | Stations | Description |
| 5 | Realistic Berlin stations with varied prices and distances |
| 0 | No stations found — tests error handling |
| 3 | All stations closed — tests open-filter |
| 1 | One open station with all fuels |
Use Cases
Local dev: iterate on the MCP tool without burning API calls
Agent integration testing: verify an agent correctly interprets structured tool responses
Evals: set a scenario, run the agent, assert on deterministic output (prices never change)
MCP Host Configuration
Add this server to any MCP host that supports stdio transport. Use uv --directory so the project resolves correctly regardless of the host's working directory. The .env file in the project root is auto-loaded by pydantic-settings, so the env block is optional if your .env already contains the API key.
Option 1: Claude Code CLI
Add the server directly from the terminal:
# Add to the current project (writes .mcp.json)
claude mcp add fuel-prices -- uv --directory /path/to/FuelPriceStationMCP run fuel-price-mcp
# Add globally (writes ~/.claude/settings.json)
claude mcp add --global fuel-prices -- uv --directory /path/to/FuelPriceStationMCP run fuel-price-mcp
# With API key as environment variable
claude mcp add -e FUEL_MCP_TANKERKOENIG_API_KEY=your-api-key-here fuel-prices \
-- uv --directory /path/to/FuelPriceStationMCP run fuel-price-mcpOption 2: Project-level .mcp.json (Claude Code)
Place a .mcp.json in any project where you want the fuel price tool available:
{
"mcpServers": {
"fuel-prices": {
"type": "stdio",
"command": "uv",
"args": ["--directory", "/path/to/FuelPriceStationMCP", "run", "fuel-price-mcp"],
"env": {
"FUEL_MCP_TANKERKOENIG_API_KEY": "your-api-key-here"
}
}
}
}Option 3: Global settings.json (Claude Code)
Add to ~/.claude/settings.json to make the server available in all Claude Code sessions:
{
"mcpServers": {
"fuel-prices": {
"type": "stdio",
"command": "uv",
"args": ["--directory", "/path/to/FuelPriceStationMCP", "run", "fuel-price-mcp"],
"env": {
"FUEL_MCP_TANKERKOENIG_API_KEY": "your-api-key-here"
}
}
}
}Option 4: Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"fuel-prices": {
"command": "uv",
"args": ["--directory", "/path/to/FuelPriceStationMCP", "run", "fuel-price-mcp"],
"env": {
"FUEL_MCP_TANKERKOENIG_API_KEY": "your-api-key-here"
}
}
}
}Makefile Targets
Target | Description |
| Install production dependencies |
| Install all deps + pre-commit hooks |
| Run tests with coverage |
| Run ruff linter |
| Run ruff formatter |
| Check formatting without modifying files |
| Run mypy |
| Start the MCP server |
| MCP Inspector with hot-reload |
| Run all checks |
| Remove build artifacts and caches |
Data Attribution
Fuel price data is provided by the Tankerkoenig API and licensed under CC BY 4.0 (Creative Commons Attribution 4.0 International). If you redistribute or display the data, you must give appropriate credit to Tankerkoenig.
License
This project's source code is licensed under the MIT License.
Available Tools
1 toolsearch_fuel_pricesA
Search for fuel stations near given coordinates, sorted by lowest price.
Args: lat: Latitude of the search center (-90 to 90). lng: Longitude of the search center (-180 to 180). radius_km: Search radius in kilometers (default from settings, max 25). fuel_type: Fuel type to sort by — "e5", "e10", or "diesel" (default "e10"). max_results: Maximum number of stations to return (default 10, max 50). ctx: MCP context (injected automatically by FastMCP).
Returns: List of station results with name, address, distance, and fuel prices.
Inputs: lat (required), lng (required), fuel_type, radius_km, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only a single tool there is no possibility of misselection; the tool's purpose (geospatial fuel price search) is clearly stated. An agent cannot confuse it with anything else in the set.
The lone tool follows a clear snake_case verb_noun pattern (search_fuel_prices) with well-named snake_case parameters (lat, lng, radius_km, fuel_type, max_results). No convention mixing exists.
A single tool is thin even for a narrow domain like fuel price lookup. Users may reasonably expect companion operations (e.g. fetch station details, list supported fuel types) rather than one catch-all search.
The core capability — finding stations sorted by cheapest fuel price — is fully covered with sensible filters and limits. Minor gaps exist: no way to retrieve details for a specific station or enumerate supported fuel types/coverage areas, but agents can work around this via search results.
Maintenance
Related MCP Connectors
Tankerkoenig MCP — German real-time fuel prices (Benzinpreise) for all German gas stations…
Real-time fuel prices, alerts, and cheapest gas stations across 38+ countries.
Local businesses across Germany (81 categories) near a postcode or coordinates, with opening status.
Live official fuel station prices for France, Spain, Italy and Western Australia in one schema.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables querying nearby stations and departure boards using the RMV public transport API.1-
- AlicenseAqualityBmaintenanceProvides real-time fuel prices at gas stations in Spain using the government's public API. Enables users to find the cheapest fuel in a municipality or list stations sorted by price.2MIT
- AlicenseNot gradedqualityCmaintenanceProvides German real-time fuel prices (Benzinpreise) for all.51 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to look up real-time fuel prices at over 14,000 German gas stations, find the cheapest E5, E10, or diesel near a place or GPS coordinates, and return only open stations sorted by price.MIT