osmkit-mcp: unofficial OpenStreetMap MCP server
Give Claude, Cursor, VS Code or any MCP client real maps without an API key: geocoding, "what's near here", search inside a city's boundary, routing by car, bike or foot, travel-time matrices, stop ordering and GPS map matching, all from OpenStreetMap. Most OpenStreetMap MCP servers ignore the public servers' usage policies and get their users blocked; osmkit-mcp throttles, caches, sends a real User-Agent and attribution, and works with your own servers too.
This is an unofficial project. It is not made or endorsed by the OpenStreetMap Foundation, Nominatim, Overpass API or OSRM. Map data © OpenStreetMap contributors, available under the ODbL.
uvx osmkit-mcp # or: pip install osmkit-mcp
Set up
Claude Code
claude mcp add osm -e OSMKIT_EMAIL=you@example.com -- uvx osmkit-mcp
Claude Desktop, Cursor, VS Code and others (the usual mcpServers JSON):
{
"mcpServers": {
"osm": {
"command": "uvx",
"args": ["osmkit-mcp"],
"env": { "OSMKIT_EMAIL": "you@example.com" }
}
}
}
No key is needed. OSMKIT_EMAIL is optional, but the Nominatim policy asks for a contact
address for anything beyond light use. Test the setup with uvx osmkit-mcp check.
Then ask things like:
- "What's the address at 48.8584, 2.2945?"
- "Find pharmacies open on Sunday within 1 km of Alexanderplatz."
- "How many EV chargers are there in Amsterdam?"
- "How long is the bike ride from Brandenburger Tor to Tempelhofer Feld, step by step?"
- "Which of our three warehouses is closest by car to each of these customers?"
- "What's the fastest order to visit these 8 addresses, starting and ending at the depot?"
- "Snap this GPS log to the roads and tell me which streets it used."
Tools
All tools are read-only. Places can be names, addresses or lat,lon (latitude first);
results are GeoJSON ([lon, lat] order) with an attribution member.
| Tool | Service | What it does |
|---|---|---|
geocode |
Nominatim | Address or place name to coordinates, address parts, OSM id, bbox; outline=true returns the full polygon or line |
reverse_geocode |
Nominatim | Coordinate to address, or to the street, suburb, city or country it is in |
place_details |
Nominatim | Opening hours, website, phone, wheelchair access, Wikidata... for OSM ids |
find_nearby |
Overpass | Places of a kind around a place, nearest first, with distance |
search_area |
Overpass | Places of a kind inside a city, district, park or bbox (its real boundary), with the total count |
overpass_query |
Overpass | Any Overpass QL query, answered as GeoJSON |
route |
OSRM | Directions by car, bike or foot: distance, time, route line, optional turn-by-turn steps and alternatives |
travel_matrix |
OSRM | Travel time and distance from every origin to every destination |
optimize_stop_order |
OSRM | Fastest order to visit up to 50 stops (round trip or one way) |
match_gps_trace |
OSRM | Map matching: snap a GPS trace to the roads used, drop noisy points |
snap_to_road |
OSRM | Nearest point on a road for a profile |
what in find_nearby and search_area takes plain words (cafe, pharmacy,
ev charging, supermarket, bus stop...), any OSM tag (amenity=cafe, shop=bakery,
cuisine~pizza, wheelchair=*), tags that must all match (cafe, diet:vegan=yes) or
alternatives (cafe | restaurant | bar).
A find_nearby answer looks like this ("cafes within 300 m of Brandenburger Tor", second
cafe left out):
{
"type": "FeatureCollection",
"center": {"type": "Point", "coordinates": [13.377704, 52.516275]},
"place": "Brandenburger Tor, Pariser Platz, Mitte, Berlin, 10117, Deutschland",
"radius_m": 300,
"total": 2,
"shown": 2,
"source": "Overpass",
"features": [
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [13.3789, 52.5161]},
"properties": {
"osm": "node/101",
"name": "Café Tor",
"category": "amenity=cafe",
"distance_m": 83,
"address": "Pariser Platz 1, 10117 Berlin",
"tags": {"amenity": "cafe", "name": "Café Tor", "opening_hours": "Mo-Su 08:00-20:00"}
}
}
],
"attribution": "© OpenStreetMap contributors, ODbL 1.0 (https://www.openstreetmap.org/copyright)"
}
Usage policies, built in
The public servers are run by volunteers. osmkit-mcp follows their rules by default:
- At most 1 request per second to each public server (nominatim.openstreetmap.org,
overpass-api.de, routing.openstreetmap.de, router.project-osrm.org and the other well-known
public instances). This is enforced even if you lower
OSMKIT_MIN_INTERVAL. - Caching: identical requests within 24 hours are answered from memory (
OSMKIT_CACHE_TTL). - A real User-Agent (
osmkit-mcp/<version> (+homepage; your email)), as the Nominatim policy requires. - Attribution in every result, as the ODbL requires.
- Real bike and foot routing. The default OSRM server is routing.openstreetmap.de, the FOSSGIS servers behind openstreetmap.org's directions, with a separate car, bike and foot profile. The often used router.project-osrm.org demo has only the car profile and silently answers bike and foot requests with car routes; osmkit-mcp warns you if you point it there.
Not for bulk geocoding or heavy use. For that, run your own servers and point osmkit-mcp at them (no throttle unless you set one).
Settings
| Setting | Meaning |
|---|---|
OSMKIT_EMAIL |
Your contact address, sent to Nominatim and in the User-Agent. Recommended. |
OSMKIT_NOMINATIM_URL |
Nominatim server (default https://nominatim.openstreetmap.org). |
OSMKIT_OVERPASS_URL |
Overpass interpreter URL (default https://overpass-api.de/api/interpreter). |
OSMKIT_OSRM_URL |
OSRM server; {profile} becomes car, bike or foot (default https://routing.openstreetmap.de/routed-{profile}). |
OSMKIT_OSRM_CAR_URL, OSMKIT_OSRM_BIKE_URL, OSMKIT_OSRM_FOOT_URL |
One OSRM server per profile (self-hosted setups with one profile per port). |
OSMKIT_LANGUAGE |
Preferred language for names, e.g. en (default: local names). |
OSMKIT_USER_AGENT |
Replace the User-Agent completely. |
OSMKIT_CACHE_TTL |
Seconds to cache answers (default 86400; 0 turns caching off). |
OSMKIT_MIN_INTERVAL |
Seconds between requests to your own servers (default 0). |
OSMKIT_TIMEOUT |
Seconds per request (default 30). |
Self-hosted example (Nominatim, Overpass and OSRM in Docker):
OSMKIT_NOMINATIM_URL=http://localhost:8080 \
OSMKIT_OVERPASS_URL=http://localhost:12345/api/interpreter \
OSMKIT_OSRM_CAR_URL=http://localhost:5000 \
OSMKIT_OSRM_FOOT_URL=http://localhost:5001 \
uvx osmkit-mcp check
Use it from Python
from osmkit import OSM
osm = OSM()
print(osm.find_nearby("Alexanderplatz, Berlin", "pharmacy", radius_m=1000)["features"][0])
print(osm.route(["52.5163,13.3777", "52.4730,13.4040"], profile="bike")["features"][0]["properties"])
Limits
- Public servers: 1 request per second, so a
routethrough 5 named places takes about 6 seconds (5 geocodes, then the route). Givelat,lonto skip geocoding. match_gps_tracetakes up to 100 points per call (OSRM's default); split longer traces.travel_matrixtakes up to 50 places in all;optimize_stop_orderup to 50 stops.- Outlines from
geocode(outline=true)over 2,000 points come back as the center point only. find_nearbysorts at most 500 results by distance; use a smaller radius in dense areas.- Overpass queries time out after 25 seconds (60 for
search_area); large areas with common tags (every building in a country) will not finish on the public server. - The cache is in memory and per process.
Why this exists
People keep wiring OpenStreetMap into AI assistants, and the existing servers keep hitting the same problems:
- The most-starred OpenStreetMap MCP server (237 stars) has not been updated since July 2025; its category search fails with HTTP 400 when subcategories are given (open-streetmap-mcp#5).
- Bike and foot directions that are really car routes, because router.project-osrm.org has only the car profile (skill-library-mcp#40).
- Geocoding that returns only a point when people need the outline (osm-mcp#4).
- Tag search that can't be limited to a city's or park's boundary (openstreetmap-mcp-server#71), and tool lists so wordy they cost 15,000 tokens per session (openstreetmap-mcp-server#72); osmkit-mcp's eleven tools list in under 10 KB.
- Few servers respect the Nominatim usage policy, which gets users' IP addresses blocked.
Listed in the official MCP Registry as
io.github.srikrishnal/osmkit-mcp (see server.json).
License
MIT for the code. Data returned by the tools comes from OpenStreetMap under the ODbL: credit "© OpenStreetMap contributors" wherever you show it.
Metadata
Release files for osmkit-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| osmkit_mcp-0.1.0.tar.gz | 39.0 kB | Without provenance | Details for osmkit_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| osmkit_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for osmkit_mcp-0.1.0-py3-none-any.whl |
Total release size: 69.4 kB
Release files / osmkit_mcp-0.1.0.tar.gz
| Download URL | osmkit_mcp-0.1.0.tar.gz |
|---|---|
| Size | 39.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
666e5dd26df379651db13ed8d13096cc9100c6c0eeef273457993dda12b6de67
|
|
BLAKE2b-256 checksum How to use checksums |
3c77822fba59503e79106a110a3fa1a4ea28ba702630b96b7404e345217b34fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / osmkit_mcp-0.1.0-py3-none-any.whl
| Download URL | osmkit_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 30.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3317918b261f47e1e3dbae5eb17bdf916094042bd1643cd57ac5ef2e53b87ad
|
|
BLAKE2b-256 checksum How to use checksums |
02d36a6e46640bddc577ac98c1f096fc49c6ec349120f865fdb8d085a211d246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for osmkit-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.