================== /// MCP /// /// OPE /// ================== [server:online] [protocol:ready]
open-streetmap-mcp
by jagan-shanmugam
An OpenStreetMap MCP server implementation that enhances LLM capabilities with location-based services and geospatial data.
88
21
Open SourceInstallation
1. Clone the repository
git clone https://github.com/jagan-shanmugam/open-streetmap-mcp.git && cd open-streetmap-mcp
2. Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
3. Install Python dependencies
pip install -U pip
pip install -r requirements.txt
4. Provision the spatial database
# With Docker (quick start)
docker compose up -d db
# Or manually create a PostgreSQL database with PostGIS enabled
createdb osm_mcp
psql -d osm_mcp -c "CREATE EXTENSION postgis;"
5. Import OpenStreetMap data (PBF file)
wget https://download.geofabrik.de/your-region-latest.osm.pbf
osm2pgsql -d osm_mcp your-region-latest.osm.pbf --slim --hstore --create
6. Configure runtime settings (env vars or .env file)
OSM_DB_URL=postgresql+psycopg2://user:password@localhost/osm_mcp
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
# (Optional) LLM provider keys if you plan to chain with an LLM
OPENAI_API_KEY=sk-...
7. Run database migrations (if alembic is used)
alembic upgrade head
8. Start the MCP server
uvicorn mcp.main:app --host 0.0.0.0 --port 8000 # hot-reload: add --reload
9. Verify
curl http://localhost:8000/healthz
# Should return {"status":"ok"}
Docker one-liner:
docker compose up --build
The server will be reachable at http://localhost:8000 .
Documentation
License: MIT License
Updated 7/30/2025