MCP.so
Sign In
Servers

MCP Server for OSM

@tpp6me

MCP server for Nominatim and OSRM applications

Overview

What is MCP Server for OSM?

MCP Server for OSM is an MCP (Model Context Protocol) server that provides access to OpenStreetMap functions including geocoding and reverse geocoding via Nominatim, route distance via OSRM, and a built-in Haversine distance calculation. It is intended for developers learning about MCP servers or needing light geolocation capabilities.

How to use MCP Server for OSM?

Install Node.js version 20 or higher, then run npm install (or npm install @modelcontextprotocol/sdk). Configure the server in a mcp.json file inside a .vscode or .cursor directory (for VSCode/Cursor) or add it to claude_desktop_config.json for Claude Desktop. The configuration requires the absolute paths to node and index.js.

Key features of MCP Server for OSM

  • Geocoding (address to coordinates) via Nominatim API
  • Reverse geocoding (coordinates to address) via Nominatim API
  • Route distance between two points using OSRM
  • Haversine (straight‑line) distance between two points

Use cases of MCP Server for OSM

  • Get the coordinates of a city or landmark
  • Retrieve the address for given latitude/longitude
  • Calculate the straight‑line and route distance between two locations (e.g., San Jose and San Francisco)
  • Use as a simple starter project to understand MCP server implementation

FAQ from MCP Server for OSM

What APIs does this server call?

It uses the open Nominatim API for geocoding and reverse geocoding, and the OSRM API for routing. It also includes a non‑API Haversine distance calculation.

What are the runtime requirements?

Node.js version 20 or higher is required.

Can I use my own Nominatim or OSRM servers?

Yes. Edit the NOMINATIM_BASE_URL and OSRM_BASE_URL constants at the top of index.js to point to your custom servers.

Is this suitable for production use?

The README advises using the open servers lightly and fairly. For production, consider installing and hosting your own Nominatim and OSRM servers.

What sample prompts work with this server?

Example prompts include “Give coordinates of New York”, “Give address of (12.77, 78.32)”, and asking for the distance between San Jose and San Francisco.

More from Other