OpenStreetMap 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 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 you can do with it

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.

What the tools cover

  • Live map facts, not guesses. Every coordinate, distance, and opening-hours verdict comes from a query against live OpenStreetMap features, so the agent has nothing to invent.
  • Local search. Ask for cafes, restaurants, pharmacies, ATMs, or other OSM amenities near a point or inside a map box, ranked by distance.
  • Opening hours. OSM opening_hours strings are parsed in code, in each venue's own timezone, so the agent can ask for places open now or bars open after 20:00 and get a consistent answer.
  • Walk and bike reach, not a straight line. 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 needed. Query buildings, cycleways, parks, and other tagged features with the same filters as the Features API, then preview or export GeoJSON, without standing up Overpass.

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

For why an agent needs a live map, why tool schemas beat prompt engineering, and a worked restaurant-finder, read how MCP gives agents live OpenStreetMap data.

Install

Run the stdio server yourself. You need an API key, and the free tier is enough to build with.

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, an area, budgets, and the next tool. Code computes metres, ranks, network paths, and opening-hours status. If you did not name a place, pass a bbox or lat/lng as "here". If you named a city or neighborhood, the agent calls geocode first and searches in the returned bbox (or lat/lng plus radius when bbox is missing).

GroupToolsWhat it does
GeocodegeocodePlace name to lon/lat and a bounding box. Called first whenever the user names a city or neighborhood.
Placesplaces_search, places_nearby, places_detailsPOIs by OSM tag in a bbox or radius, nearest-first ranking from a point, and full detail for one OSM id.
Routesroutes_isochrone, routes_path, routes_optimized_pathWalk and bike reach polygons, given-order paths, and TSP-ordered tours on the OSM network.
Generic OSMquery, query_allAny tagged feature: buildings, cycleways, parks. One page, or tiled pages over a large bbox.
Local (no HTTP)nearest_within, filter_open, point_in_polygon, points_in_polygonJoins and filters over collections the agent already fetched. Free, instant, and the reason the model never does arithmetic.
Draw / exportpreview_map, export_geojsonRender one or more collection_ids on a map, or hand the raw GeoJSON back to the host.

Tags are plain OpenStreetMap tags: amenity=restaurant, cuisine=italian, shop=supermarket, tourism=hotel, amenity=charging_station. There is no proprietary category tree to learn, and models already know the OSM tag schema.

Typical AI questions

Example prompts and the MCP tools the planner calls.

PromptMCP tools
Open cafes near meplaces_nearby or places_search with location+radius / bbox
Vegan restaurants open after 6pm on a walk from T Centralen to Sodermalm in Stockholmgeocode, routes_path , places_search, filter_open, nearest_within, preview_map
List cafes by distance and cuisine from stockholm central stationgeocode the station, then places_nearby
Restaurants within 150 m of a stationtwo places_search, then nearest_within
Pubs open after 20:00places_search with as_of (no open_now so closed hits stay), then filter_open
Open cafes within a 10-minute bike rideroutes_isochrone + places_search in a covering radius + points_in_polygon
Suggest a bar crawl in Sodermalm, Stockholmgeocode, places_search, then routes_optimized_path (loop=true)
Suggest a walk to a bar, a restaurant, and a cafe, no particular order in Sodermalm, Stockholmgeocode, places_search, then 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
Map every cycleway, building, or park in this neighborhoodgeocode, then query_all over the returned bbox, then preview_map
Show this on a mappreview_map with every collection_id that belongs on the same map

Connect with your API key

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

Cost and limits

Tool calls bill exactly like the HTTP endpoints behind them. Places search, nearby, and details charge the GeoJSON surface. Routing charges after the graph work, and a multi-stop path costs one Dijkstra per leg, so a six-stop tour is not the price of one. The local tools are free. The free tier comfortably covers development.

Three limits are worth knowing before your agent surprises you:

  • Opening hours coverage varies.open_now only returns places where a mapper tagged opening_hours. In a well-mapped European city that is most restaurants. Elsewhere it can be thin, and an empty result may mean "unmapped" rather than "closed". Have the agent retry without the hours filter before telling the user nothing is open.
  • Walk and bike only. There is no driving mode. Car routing needs turn restriction modeling that the query-time router does not do, and we would rather ship nothing than ship a route that ignores a no-left-turn.
  • Spatial caps are per tier. Bounding box area and search radius are capped by your plan. An agent asked to search a whole country will hit that, so scope the area or tile the query with query_all.