A Model Context Protocol (MCP) server that provides seamless integration between Claude Desktop and the Valhalla Open-Street-Map routing engine. Access professional routing and isochrone capabilities directly from your AI conversations without complex APIs.
Claude Desktop showing a route calculation between two points with detailed GeoJSON response from Valhalla MCP Server
| route tool | /route | Single origin → destination routing with alternatives |
| isochrone tool | /isochrone | Travel time polygons showing reachable areas |
| health resource | /status | Server status and version information |
| tile resource | /tile/{z}/{x}/{y} | Vector tiles for client-side rendering |
| Matrix | Distance/time matrices for multiple origins/destinations | Delivery optimization, logistics planning |
| Map-matching | Match GPS coordinates to road network | GPS trace cleaning, route correction |
| Elevation | Elevation profiles along routes or at points | Hiking routes, difficulty analysis |
| Expansion | Graph traversal visualization | Network analysis, reachability studies |
| Locate | Detailed metadata about nodes and edges | Address geocoding, road attributes |
| Centroid | Optimal convergence point from multiple locations | Meeting point optimization |
| Optimized Route | Multi-stop delivery routing with constraints | Logistics, delivery services |
- auto - Car routing
- bicycle - Bicycle routing
- pedestrian - Walking routes
- taxi - Taxi routing
- bus - Public transit routing
- Node.js 18+
- Claude Desktop
- NPM or Yarn package manager
For production use or custom datasets:
This script will:
- Build the MCP server
- Start local Valhalla with Monaco OSM data
- Wait for services to be ready
- Run integration tests
- Provide Claude Desktop configuration
If you already have a Valhalla server running elsewhere:
- Open Claude Desktop settings
- Add to your MCP configuration:
For Demo API (recommended for testing):
For Local Valhalla Server:
-
Update the cwd path to your actual project location
-
Restart Claude Desktop
Try these commands in Claude Desktop to verify everything works:
Basic routing:
- "Calculate route from Monaco-Ville to Monte Carlo"
- "Get driving directions from 43.7384,7.4246 to 43.7396,7.4263"
- "Calculate bicycle route from 43.7350,7.4200 to 43.7450,7.4300"
Travel time analysis:
- "Show 10-minute drive isochrone from Monaco center"
- "Generate 15-minute bicycle travel polygon from 43.7311,7.4197"
You should receive detailed GeoJSON responses with route geometries and travel statistics!
For development with auto-reload:
The server uses environment variables for configuration. Create a .env file from the template:
Available environment variables:
- VALHALLA_BASE_URL - Base URL for Valhalla service (default: http://localhost:8002)
- DEBUG - Enable debug logging (default: false)
- LOG_LEVEL - Log level: error, warn, info, debug (default: info)
- MCP_SERVER_NAME - MCP server name (default: valhalla-mcp-server)
- MCP_SERVER_VERSION - MCP server version (default: 0.1.0)
Common Valhalla endpoints:
- http://localhost:8002 - Local Docker instance (recommended)
- https://valhalla1.openstreetmap.de - Public demo API (✅ tested and working)
- https://your-server.com:8002 - Custom deployment
Note: The main demo URL https://valhalla.openstreetmap.de serves a web interface. Use https://valhalla1.openstreetmap.de for API access.
The complete stack can be deployed using Docker Compose:
Request a route between two points:
Response includes GeoJSON LineString with route geometry and summary statistics:
Generate a 15-minute travel time polygon:
Access server health information:
Add to your Claude Desktop configuration:
Note: Environment variables in Claude Desktop config override .env file values.
The server implements the standard MCP protocol and works with any compliant client. Use stdio transport for local integration.
Key dependencies:
- @modelcontextprotocol/sdk - Official MCP SDK
- axios - HTTP client for Valhalla API calls
- zod - Runtime type validation
- geojson - GeoJSON type definitions
- dotenv - Environment variable management
The project uses strict TypeScript configuration:
- Route calculation: < 200ms (local Valhalla instance)
- Isochrone generation: < 300ms
- Tile serving: < 30ms
- Health check: < 5ms
Performance depends on Valhalla configuration and available OSM data.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Open an issue on GitHub
- Check the MCP documentation
- Review Valhalla documentation
.png)


