MCP Server
Connect to Claude, Cursor, or Copilot to add OpenStreetMap data to your workflows. You can also create your own agents to build custom geospatial workflows, such as finding and booking the best restaurant in town.
Agents cannot look up maps on their own. This server gives them tools to search places, check opening hours, and plan walk or bike routes from a chat prompt.
What an OpenStreetMap MCP server is for
Large language models do not have a live map. They guess street names, invent coordinates, and cannot tell you if a cafe is open or whether the office is a 20-minute walk. The MapLark MCP server is a Model Context Protocol server that connects Claude, Cursor, GitHub Copilot, and custom agents to planet-scale OpenStreetMap data.
You ask in plain language. The agent picks OSM tags and an area. The tools search places, rank by distance, read opening hours, and compute walk or bike routes on the OSM street network. That is the same data as the Places API, Routing API, and OSM Features API, exposed as agent tools instead of HTTP you write by hand.
Problems it solves
- Stale or invented map facts. Model training data goes out of date. The server queries live OpenStreetMap features instead of letting the agent invent a lat/lng.
- Local search without a places SDK. Ask for cafes, restaurants, pharmacies, ATMs, or other OSM amenities near a point or inside a map box, ranked by distance.
- Opening hours the model cannot parse. OSM
opening_hoursstrings are filtered in code, so you can ask for places open now or bars open after 20:00. - Walk and bike reach, not a straight line on a globe. Isochrone, given-order path, and optimized loops run on the OSM walk and bicycle network. Useful for "cafes within a 10-minute bike ride" or "is the office a 20-minute walk."
- Raw OSM when places are not enough. Query buildings, cycleways, parks, and other tagged features with the same filters as the Features API, then preview or export GeoJSON.
Workflows you can build
Typical geospatial agent workflows include a cafe or restaurant finder, a store locator ranked from a station, a nightlife list filtered by opening hours, a walking bar crawl, a multi-stop walk from hotel to cafe to office, and a commute check with a walk or bike isochrone. Developers also pull generic OSM layers (buildings, roads, parks) into Claude or Cursor without standing up Overpass.
Example prompts and the tools they map to are in Typical AI questions below. The same operations exist as HTTP playgrounds if you are not going through an LLM.
Install
Run the stdio server yourself.
pip install "osmfeatures[mcp]"
export MAPLARK_API_KEY="sk-..."
osmfeatures mcpCursor / Claude Desktop
You can also run it in AI agentic tools like Claude, Cursor, or Copilot. Prerequisite: install uv. Then add this to your MCP config.
{
"mcpServers": {
"maplark": {
"command": "uvx",
"args": ["--from", "osmfeatures[mcp]", "osmfeatures", "mcp"],
"env": { "MAPLARK_API_KEY": "YOUR_KEY" }
}
}
}The MCP server is open source. The code is on GitHub: github.com/MapLark/osmfeatures-py
Tools
The LLM picks tags, a bbox or location+radius, budgets, and the next tool. Code computes metres, ranks, network paths, and opening-hours status. There is no geocode tool yet: pass a bbox or lat/lng as "here".
| Group | Tools |
|---|---|
| Places | places_search, places_nearby, places_details |
| Routes | routes_isochrone, routes_path, routes_optimized_path |
| Generic OSM | query (one page), query_all (tiled pages) |
| Local (no HTTP) | nearest_within, filter_open, point_in_polygon, points_in_polygon |
| Draw / export | preview_map, export_geojson |
Typical AI questions
Example prompts and the MCP tools the planner should call.
| Prompt | MCP tools |
|---|---|
| Cafes near me | places_nearby or places_search with location+radius / bbox |
| List cafes by distance and cuisine from stockholm central station | places_search with location+radius / bbox, then nearest_within |
| Restaurants within 150 m of a station | two places_search, then nearest_within |
| Bars open after 20:00 | places_search with as_of (no open_now so closed hits stay), then filter_open |
| Cafes within a 10-minute bike ride | routes_isochrone + places_search in a covering radius + points_in_polygon |
| A walking bar crawl in Sodermalm, Stockholm | places_search + routes_optimized_path (loop=true) |
| Walk from my hotel to the cafe, then the office | routes_path with those stops in listed order |
| Suggest a walk to a bar, a restaurant, and a cafe, no particular order | routes_optimized_path with loop=false |
| Is the office a 20-minute walk from the apartment? | routes_isochrone from A, point_in_polygon for B |
| Show this on a map | preview_map(collection_id) after a search or route |