home / mcp / osm mcp server

OSM MCP Server

Provides geocoding, routing, quality assurance, and data analysis tools for OpenStreetMap via MCP and HTTP APIs.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "grabosm-osm-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/osm-mcp/dist/index.js"
      ],
      "env": {
        "YOUR_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You have an OpenStreetMap MCP Server that exposes 30 tools for geocoding, routing, quality assurance, and data analysis. It connects AI assistants and tools to OSM data, enabling you to search locations, compute routes and isochrones, validate data quality, and inspect editsβ€”all through a programmable MCP interface.

How to use

You can use this MCP server with your preferred MCP client or RESTful HTTP client to access a wide range of geospatial capabilities. Start the server locally, then invoke tools through the client by sending requests that target the MCP endpoints. Use it to perform location searches, fetch place details, compute routes, analyze edits, check data quality, and explore OSM tag statistics. Tools are organized by capability, so you can chain a geocoding query with a routing query, or run a QA check after a data import.

How to install

Prerequisites: Node.js v18 or higher, npm, and a Unix-like shell.

# Step 1: Clone the project repository
git clone https://github.com/GRABOSM/osm-mcp.git

# Step 2: Change into the project directory
cd osm-mcp

# Step 3: Install dependencies
npm install

# Step 4: Build the project
npm run build

Additional setup steps

Configure your MCP client to connect to the local server. If you are using a local AI tool, you can run the server and point the client to its stdio entry or to the HTTP API if you expose it. The provided commands below assume a local path to the built distribution.

# Start the MCP server via a local execution path
node /absolute/path/to/osm-mcp/dist/index.js

Examples of how to start using

After starting the server, you can ask capabilities like: - Find places or addresses near a location - Get driving directions and isochrones - Inspect recent changes or data quality issues - Retrieve tags usage statistics and tag suggestions

Available tools

search_location

Search for places and addresses globally.

reverse_geocode

Get an address from geographic coordinates.

search_structured

Search by structured fields like street, city, country, etc.

get_place_details

Fetch full details of an OpenStreetMap element.

search_pois

General point-of-interest search for amenities, shops, and more.

search_pois_smart

Smart POI search with intelligent category detection.

find_amenities_nearby

Locate facilities within a defined radius of a point.

get_osrm_route

Provide detailed turn-by-turn directions between points.

get_distance_matrix

Calculate travel times and distances between multiple points.

optimize_route

Optimize a route through multiple stops (TSP-like).

map_match_gps

Snap GPS traces to the road network.

calculate_isochrone

Compute area reachable within a time limit.

search_highways_smart

Smart search for roads and motorways.

get_elements_in_bounds

Retrieve all data within a bounding box.

search_by_tags

Find elements by specific OSM tags.

get_route_data

Extract road geometry for custom use.

execute_overpass_query

Run advanced Overpass QL queries.

snap_to_roads

Find the nearest road for a given point.

get_changeset

Details of a specific mapping edit.

search_changesets

Find edits by user, time, or location.

get_changeset_diff

View exact changes made in an edit.

osmose_search_issues

Find data errors with filters.

osmose_get_issue_details

Details of a specific quality issue.

osmose_get_issues_by_country

Quality issues by nation.

osmose_get_issues_by_user

Issues related to a specific user.

osmose_get_stats

Data quality metrics and charts.

osmose_get_items

List of detectable issue categories.

get_tag_suggestions

Autocomplete suggestions for OSM tags.

get_tag_stats

Usage statistics for any OSM tag.

validate_osm_tag

Check if a tag combination is proper.