OSM

Model Context Protocol server for OpenStreetMap data
  • python

45

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "wiseman-osm-mcp": {
      "command": "/Users/wiseman/.local/bin/uv",
      "args": [
        "run",
        "--env-file",
        ".env",
        "--with",
        "mcp[cli]",
        "--with",
        "psycopg2",
        "--with-editable",
        "/Users/wiseman/src/mcp-osm",
        "--directory",
        "/Users/wiseman/src/mcp-osm",
        "mcp",
        "run",
        "mcp.py"
      ],
      "env": {
        "PGDB": "osm",
        "PGHOST": "localhost",
        "PGPORT": "5432",
        "PGUSER": "postgres",
        "FLASK_HOST": "127.0.0.1",
        "FLASK_PORT": "8889",
        "PGPASSWORD": "postgres"
      }
    }
  }
}

MCP-OSM lets you query and visualize OpenStreetMap data through an MCP interface. It provides a web-based map viewer, a PostgreSQL/PostGIS query pathway for OSM data, and a set of MCP tools to manipulate the map from your client.

How to use

After you start the MCP server, a web interface is served locally at http://localhost:8889/ where you can interact with the map, add markers, polygons, and lines, or run SQL queries against your OSM database.

From your MCP client, connect to the server to perform actions. You can: set or get the current map view, add markers, draw lines or polygons on the map, and execute SQL queries against the PostgreSQL/PostGIS backend that stores OpenStreetMap data. The tools expose straightforward actions like getting the current view, setting a new view by coordinates or bounds, and adding shapes directly onto the map.

Use the map tools to build interactive visualizations or perform spatial queries, then refine your view to focus on areas of interest. The server streams map updates to clients via Server-Sent Events, so you can see changes in real time as you adjust the map or run queries.

How to install

Prerequisites you need before installing: Python (for the MCP runtime) and a running PostgreSQL database with PostGIS enabled. You will also need a way to start the MCP server process, such as a local runtime like uv.

  1. Prepare your environment variables for PostgreSQL and the local Flask server if you plan to customize host/port and database access. Common defaults are shown for reference.

  2. Create an MCP configuration that defines the MCP server you will run. The example below starts the MCP server runtime and runs the Python-based MCP application that provides the OSM integration.

  3. Start the MCP server. The web interface will be available at http://localhost:8889/ once the server launches.

Below is the exact MCP configuration snippet you should use to start the OSM PostgreSQL server within your MCP environment.

Configuration and runtime details

{
  "mcpServers": {
    "OSM PostgreSQL Server": {
      "command": "/Users/wiseman/.local/bin/uv",
      "args": [
        "run",
        "--env-file",
        ".env",
        "--with",
        "mcp[cli]",
        "--with",
        "psycopg2",
        "--with-editable",
        "/Users/wiseman/src/mcp-osm",
        "--directory",
        "/Users/wiseman/src/mcp-osm",
        "mcp",
        "run",
        "mcp.py"
      ]
    }
  }
}

Available tools

get_map_view

Retrieve the current map view (center coordinates and zoom or bounds) from the MCP client.

set_map_view

Set the map view to specific coordinates, bounds, or zoom level to focus on a region.

set_map_title

Display a title or label on the bottom-right of the map interface.

add_map_marker

Place a marker at specified latitude/longitude on the map.

add_map_line

Draw a polyline defined by a sequence of coordinates on the map.

add_map_polygon

Draw a polygon defined by a sequence of coordinates on the map.

query_osm_postgres

Execute a SQL query against the OpenStreetMap database stored in PostgreSQL/PostGIS.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational