anwb-mcp

Een Model Context Protocol (MCP) server voor ANWB verkeersinformatie, routeplanning en locatiezoeken in Nederland. Krijg realtime file-informatie, bereken routes met stapsgewijze routebeschrijvingen en zoek locaties — allemaal via natuurlijke taal in je AI-app.
Let op: Dit is een onofficieel, community-onderhouden project en is niet verbonden aan of goedgekeurd door ANWB. Deze server gebruikt publiek toegankelijke ANWB API-endpoints — geen API-key nodig.
A community-built Model Context Protocol (MCP) server for ANWB traffic information, route planning, and location search in the Netherlands. Get real-time traffic incidents, calculate routes with turn-by-turn directions, and search for locations — all through natural language via any MCP-compatible AI client.
The server supports MCP specification 2026-07-28. Clients that use the 2025 handshake also work.
Note: This is an unofficial, community-maintained project and is not affiliated with or endorsed by ANWB. This server uses publicly accessible ANWB API endpoints — no API key required.
Snel starten
Je hoeft deze repo niet te clonen.
- Zorg dat Node.js 20+ is geïnstalleerd (je AI-app draait
npx op je machine)
- Voeg de server toe als MCP server in je AI-app (kopieer onderstaande configuratie)
- Stel vragen in gewoon Nederlands (zie Voorbeelden)
Quick Start (Non-Developers)
You do not need to clone this repo.
- Make sure Node.js 20+ is installed (your AI app will run
npx on your machine)
- Add the server to your AI app as an MCP server (copy/paste config below)
- Ask questions in plain language (see Example Usage)
Add To Claude Desktop (Also Works In Cowork)
Cowork runs inside Claude Desktop and uses the same connected MCP servers and permissions.
- Open your Claude Desktop MCP config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Add this server entry (or merge it into your existing
mcpServers):
{
"mcpServers": {
"anwb-mcp": {
"command": "npx",
"args": ["-y", "anwb-mcp"]
}
}
}
- Restart Claude Desktop
Add To Other AI Apps
Most MCP apps have a screen like "Add MCP Server" where you can fill in:
- Command:
npx
- Args:
-y anwb-mcp
If your app wants JSON, paste this and adapt the top-level key name to your client (common ones are mcpServers, servers, or context_servers):
{
"<servers-key>": {
"anwb-mcp": {
"command": "npx",
"args": ["-y", "anwb-mcp"]
}
}
}
Troubleshooting
- Error:
npx: command not found or server fails to start
- Fix: install Node.js 20+ and restart your app.
- Empty results or connection errors
- The ANWB API may be temporarily unavailable. Wait a moment and retry.
Features
- 6 tools across 3 categories covering traffic, routing, and location search
- Location search — find addresses, cities, streets, and points of interest with coordinates
- Route planning — calculate routes by car, caravan, bike (regular or e-bike), or on foot with distance, duration, turn-by-turn directions, toll info, and alternative routes
- EV route planning — plan electric vehicle routes with battery consumption, charging stops, and cost savings vs fuel
- EV car database — browse 1500+ electric vehicle models with battery specs for EV route planning
- Road avoidance — avoid toll roads, motorways, ferries, or unpaved roads
- Traffic incidents — real-time jams, road closures, roadworks, and speed camera locations on Dutch highways
- Traffic summary — compact overview of current traffic conditions across all highways
- No API key required — uses publicly accessible ANWB endpoints
- Input validation via Zod schemas on every tool for safe, predictable operations
- Response caching with configurable TTL (60s for routes and incidents, 300s for locations)
- Rate limit handling with exponential backoff and
Retry-After header support
- Toolset filtering to expose only the tool categories you need
- Docker support for containerized deployments via GHCR
- Actionable error messages with context-aware recovery suggestions
Supported Clients
This MCP server is not tied to one coding agent. It works with any MCP-compatible client or agent runtime that can start a stdio MCP server.
Setup (Power Users)
If Quick Start worked in your client, you can skip this section.
Generic MCP Server Config
Use this in any MCP host that supports stdio servers:
- Command:
npx
- Args:
["-y", "anwb-mcp"]
- Optional env vars:
ANWB_CACHE_TTL, ANWB_MAX_RETRIES, ANWB_TOOLSETS (see Configuration)
Host key mapping:
| Host |
Top-level key |
Notes |
| VS Code |
servers |
Add "type": "stdio" on the server object |
| Claude Desktop / Cursor / Windsurf / Cline |
mcpServers |
Same command/args block |
| Zed |
context_servers |
Same command/args block |
| Codex CLI (TOML) |
mcp_servers |
Uses TOML, shown below |
Claude Ecosystem Notes
Claude currently has multiple MCP-related concepts that are easy to mix up:
- Local MCP servers (Claude Desktop): defined in
claude_desktop_config.json and started on your machine (docs).
- Cowork: reuses the MCP servers connected in Claude Desktop (docs).
- Connectors: remote MCP integrations managed in Claude (docs).
- Cowork plugins: Claude-specific workflow packaging (instructions + tools/data integrations) (docs). Useful in Claude, but not portable as a generic MCP server config for other agent clients.
Verified against vendor docs on 2026-03-05.
Claude Code
claude mcp add --scope user anwb-mcp -- npx -y anwb-mcp
Codex CLI (OpenAI)
codex mcp add anwb-mcp -- npx -y anwb-mcp
Gemini CLI (Google)
gemini mcp add anwb-mcp -- npx -y anwb-mcp
VS Code (Copilot)
Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) > MCP: Add Server > Command (stdio), or use .vscode/mcp.json with top-level key servers and the canonical command/args block from Generic MCP Server Config.
Claude Desktop + Cowork / Cursor / Windsurf / Cline / Zed
Cowork runs inside Claude Desktop and uses the same connected MCP servers and permissions. Configure once in Claude Desktop, then the server is available in Cowork.
Use the canonical config block and place it in the host file below with the matching top-level key.
| Client |
Config location |
Top-level key |
| Claude Desktop (macOS) |
~/Library/Application Support/Claude/claude_desktop_config.json |
mcpServers |
| Claude Desktop (Windows) |
%APPDATA%\\Claude\\claude_desktop_config.json |
mcpServers |
| Cursor (project) |
.cursor/mcp.json |
mcpServers |
| Cursor (global) |
~/.cursor/mcp.json |
mcpServers |
| Windsurf |
~/.codeium/windsurf/mcp_config.json |
mcpServers |
| Cline |
MCP settings UI |
mcpServers |
| Zed (macOS/Linux) |
~/.zed/settings.json or ~/.config/zed/settings.json |
context_servers |
Docker
docker run -i --rm ghcr.io/bartwaardenburg/anwb-mcp
Codex CLI (TOML config alternative)
[mcp_servers.anwb-mcp]
command = "npx"
args = ["-y", "anwb-mcp"]
Other MCP Clients
Use the values from Generic MCP Server Config.
Terminology
What is portable across hosts:
- MCP server runtime settings (
command, args, env)
- Transport model (
stdio command server)
- Tool names and tool schemas exposed by this server
What is host/vendor-specific (not portable as-is):
Security Notes
- Trust model: Any prompt or agent allowed to call this MCP server can execute ANWB API actions on behalf of the user.
- No credentials required: This server uses publicly accessible ANWB endpoints, so there are no secrets to protect. However, route queries may reveal location data.
- Team config governance: Keep shared MCP config in version control and require review for changes to command/args/env/toolset filtering.
Configuration
No API key is required. The following optional environment variables are available:
| Variable |
Description |
Default |
ANWB_CACHE_TTL |
Cache TTL in seconds (set to 0 to disable). Routes/incidents use 60s, locations use 300s. |
unset |
ANWB_MAX_RETRIES |
Maximum retry attempts for rate-limited (429) requests with exponential backoff. |
3 |
ANWB_TOOLSETS |
Comma-separated list of tool categories to enable (see Toolset Filtering). |
All toolsets |
Available Tools
Locations
| Tool |
Description |
find_locations |
Search for locations, addresses, streets, cities, and POIs. Returns coordinates useful for route planning. Supports filtering by geographic area and index set. |
Routes
| Tool |
Description |
calculate_route |
Calculate a route between two or more locations by car, caravan, bike (regular/e-bike), or on foot. Returns distance, duration, turn-by-turn directions, toll info (car/caravan), and alternative routes. Supports avoiding toll roads, motorways, ferries, and unpaved roads. |
calculate_ev_route |
Plan an electric vehicle route with battery consumption, charging stops, and charging station recommendations. Requires EV car model ID, battery capacity, and state of charge. |
list_ev_cars |
Browse available electric vehicle models from the ANWB database. Filter by make (brand) or search by model name. Returns car IDs for use with calculate_ev_route. |
Incidents
| Tool |
Description |
get_traffic_incidents |
Get current traffic incidents on Dutch highways — jams, closures, roadworks, and speed cameras. Filter by road and/or category. |
get_traffic_summary |
Get a compact summary of traffic conditions — total counts of jams, closures, roadworks, and radars across all highways. |
Toolset Filtering
Reduce context window usage by enabling only the tool categories you need. Set the ANWB_TOOLSETS environment variable to a comma-separated list:
ANWB_TOOLSETS=routes,incidents