Purpose
OpenStreetMap (OSM) MCP Server is an MCP (Model Context Protocol) server implementation based on OpenStreetMap, designed to provide large language models (LLMs) with location services and geospatial data interaction capabilities, enabling LLMs to handle location-based applications.
Main Capabilities
This server provides LLMs with tools for interacting with OpenStreetMap data, supporting the following functions:
- Geocode addresses and place names into coordinates
- Reverse geocode coordinates into addresses
- Find nearby points of interest
- Get route navigation between places
- Search for places by category within a bounding box
- Suggest optimal meeting points for multiple people
- Explore areas and obtain comprehensive location information
- Find nearby schools and educational institutions
- Analyze commuting options between home and work locations
- Find electric vehicle charging stations, with support for connector and power filtering
- Conduct neighborhood livability analysis for real estate
- Find parking facilities, including availability and fee information
The server implements location-based resources:
location://place/{query}: Get place information by name or addresslocation://map/{style}/{z}/{x}/{y}: Get styled map tiles for specified coordinates
The geospatial tools implemented by the server include:
geocode_address: Convert text into geographic coordinatesreverse_geocode: Convert coordinates into human-readable addressesfind_nearby_places: Discover points of interest near a locationget_route_directions: Get turn-by-turn navigation between placessearch_category: Find places of a specific category within an areasuggest_meeting_point: Find the optimal meeting point for multiple peopleexplore_area: Get comprehensive data for a neighborhoodfind_schools_nearby: Locate educational institutions near a specific locationanalyze_commute: Compare transportation options between home and work locationsfind_ev_charging_stations: Locate electric vehicle charging infrastructure with filtering supportanalyze_neighborhood: Evaluate neighborhood livability for real estatefind_parking_facilities: Locate parking options near a destination
Usage
This server can be used in MCP hosts such as Claude Desktop, Cursor, Windsurf, and others.
The main server osm-mcp-server is available for public use, with an example configuration as follows:
"mcpServers": {
"osm-mcp-server": {
"command": "uvx",
"args": [
"osm-mcp-server"
]
}
}
In Claude Desktop, the configuration file is located at:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
Run the server locally:
- Install the package in development mode
- Start the server
The server will start and listen for MCP requests on standard input/output.
The repository contains two example clients in the examples/ directory:
client.pydemonstrates the basic usage of the OSM MCP server: connect to a locally running server, get information about San Francisco, search for restaurants in that area, and retrieve comprehensive map data with progress tracking.llm_client.pyprovides a helper class designed for LLM integration, demonstrating how an LLM can use the location assistant: get location information from text queries, get routes between places, find the optimal meeting point, and explore neighborhoods.
Write your own client:
- Import the MCP client
- Initialize the client with the server URL
- Call tools or access resources
Build and Release
Prepare the distribution package:
- Sync dependencies and update the lock file
- Build the package distribution
- In
dist/Generate source code and wheel distributions in the directory - Publish to PyPI (PyPI credentials need to be set via environment variables or command-line flags)
Debugging
Since the MCP server runs via stdio, debugging can be challenging. Using MCP Inspector is recommended for the best debugging experience. MCP Inspector can be started via an npm command, and once started it will display a URL accessible in a browser for starting debugging.
Limitations
No additional information about pricing, platform compatibility, performance, or usage limitations is provided in the materials.