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.

ClaudeCursorAgentsMCPOpenStreetMap

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_hours strings 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.

bash
pip install "osmfeatures[mcp]"
export MAPLARK_API_KEY="sk-..."
osmfeatures mcp

Cursor / 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.

json
{
  "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".

GroupTools
Placesplaces_search, places_nearby, places_details
Routesroutes_isochrone, routes_path, routes_optimized_path
Generic OSMquery (one page), query_all (tiled pages)
Local (no HTTP)nearest_within, filter_open, point_in_polygon, points_in_polygon
Draw / exportpreview_map, export_geojson

Typical AI questions

Example prompts and the MCP tools the planner should call.

PromptMCP tools
Cafes near meplaces_nearby or places_search with location+radius / bbox
List cafes by distance and cuisine from stockholm central stationplaces_search with location+radius / bbox, then nearest_within
Restaurants within 150 m of a stationtwo places_search, then nearest_within
Bars open after 20:00places_search with as_of (no open_now so closed hits stay), then filter_open
Cafes within a 10-minute bike rideroutes_isochrone + places_search in a covering radius + points_in_polygon
A walking bar crawl in Sodermalm, Stockholmplaces_search + routes_optimized_path (loop=true)
Walk from my hotel to the cafe, then the officeroutes_path with those stops in listed order
Suggest a walk to a bar, a restaurant, and a cafe, no particular orderroutes_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 mappreview_map(collection_id) after a search or route

Connect with your API key

Create a key, then paste it as MAPLARK_API_KEY in the MCP config.