OSM Overpass MCP Server
Provides a tool to run Overpass QL queries against the OpenStreetMap Overpass API, returning raw Overpass responses or GeoJSON FeatureCollections.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OSM Overpass MCP Server run: node[amenity=pharmacy](50.0,19.9,50.1,20.0);out; as geojson"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@gander-mcp/osm-overpass-mcp
An MCP server that exposes the OpenStreetMap
Overpass API as a single
tool, so an LLM client can run Overpass QL queries and get back the raw response
or a GeoJSON FeatureCollection.
Requires Node.js >= 26.
The same package is also published as osm-overpass-mcp, so
npx osm-overpass-mcp works too.
Tool
overpass_query
Argument | Type | Default | Description |
| string (required) | — | The full Overpass QL query text, e.g. |
|
|
|
|
An empty query is rejected without a network call. On Overpass rate limiting
(HTTP 429/406) the server honours Retry-After (or waits 30s) and retries up to
OVERPASS_MAX_RETRIES times before returning a structured error. Query syntax
errors (HTTP 400) are returned immediately, not retried.
Related MCP server: mcp-overpass
Running
# stdio (default) — for clients that launch the server as a subprocess
npx @gander-mcp/osm-overpass-mcp
npx @gander-mcp/osm-overpass-mcp --transport stdio
# Streamable HTTP — binds to loopback only by default
npx @gander-mcp/osm-overpass-mcp --transport httpAn unknown --transport value exits non-zero and prints the valid choices.
stdio client config
{
"mcpServers": {
"overpass": {
"command": "npx",
"args": ["-y", "@gander-mcp/osm-overpass-mcp"]
}
}
}Configuration
All configuration is via environment variables; each has a default.
Variable | Default | Description |
|
| Overpass API endpoint to query. Point this at a mirror or your own instance if the public one is rate-limiting you. |
|
|
|
|
| Per-request timeout in milliseconds. Must be a positive integer. |
|
| Retries after the first attempt on rate limit / timeout. Must be a non-negative integer. |
|
| HTTP transport bind address. Namespaced to avoid the common |
|
| HTTP transport port. |
The HTTP path is always /mcp.
Remote HTTP use
The HTTP transport binds to 127.0.0.1 by default and has no authentication.
To expose it beyond localhost, set OVERPASS_MCP_HOST explicitly and put it
behind your own TLS-terminating reverse proxy and access control.
Development
npm install # also installs the lefthook git hooks (prepare script)
npm run dev # run from source with --watch
npm test # unit + integration tests (mocked Overpass endpoint)
npm run check # typecheck + lint + test
npm run fix # apply Biome autofixes + formatting
npm run build # compile to dist/ with tsc
npm run test:smoke # live smoke test against the real Overpass API (network)npm test never hits the network. The live smoke test is excluded from it and
also runs daily (and on demand) via the non-blocking Live Smoke workflow.
lefthook runs Biome + typecheck on pre-commit and the test suite on
pre-push, mirroring the Code workflow so CI failures surface locally first.
Repository variables (Settings → Secrets and variables → Actions)
Variable | Default | What it does |
|
|
|
Releasing
Releaseworkflow (manual, pickpatch/minor/major): release-it bumps the version, updatesCHANGELOG.md, tagsvX.Y.Z, creates the GitHub Release and then startsPublish NPMfor that tag.Publish NPMworkflow: stages the package on npm with provenance (Trusted Publishing, no token) under both names,@gander-mcp/osm-overpass-mcpandosm-overpass-mcp. Each becomes installable once a maintainer approves it with 2FA:npm stage list,npm stage approve <stage-id>.
First publication (manual, once)
Staged publishing also creates new packages. Until approval, npm shows a public
0.0.0-stage placeholder under the name. Requires 2FA on the npm account.
npm login
npm ci
npm run build
npm stage publish --provenance=false --access public
npm pkg set name=osm-overpass-mcp
npm stage publish --provenance=false --access public
git checkout package.json
npm stage list
npm stage approve <stage-id> # once for each package
VERSION=$(node -p "require('./package.json').version")
git tag "v$VERSION" && git push origin "v$VERSION"Then on npmjs.com, in the settings of both packages, add a Trusted Publisher: GitHub
Actions, repository gander-mcp/osm-overpass-mcp, workflow publish-npm.yml,
with staged publishing allowed. Provenance requires a public repository.
Writing Overpass queries
See docs/overpass-references.md for Overpass QL
syntax, guides, and testing tools.
License
Available Tools
1 tooloverpass_queryA
Run an Overpass QL query against the OpenStreetMap Overpass API and return the result. Set format to 'geojson' to get a GeoJSON FeatureCollection instead of the raw Overpass response.
Inputs: query (required), format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With a single tool there is no possibility of misselection; every request maps unambiguously to overpass_query.
The lone tool uses a clear snake_case verb_noun name (overpass_query) that matches the server's domain, so there is no convention mixing.
A single parameterized tool is defensible because Overpass QL is a general-purpose query language covering the whole API, though the thin surface means agents get no higher-level helpers.
The general query tool plus optional geojson output covers essentially the entire Overpass API, leaving only niceties like query validation, presets, or result pagination absent.
Maintenance
Related MCP Connectors
Geocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data.
Query OpenStreetMap with Overpass QL, find water and food stops along routes, and check weather at arrival time. Free API key: 500 requests/day, including commercial use. [Setup and examples](https://geo.runningcat.dev/mcp?utm_source=glama&utm_medium=referral&utm_campaign=mcp_directory).
OpenStreetMap Overpass MCP — programmatic queries against the OSM database
OpenStreetMap queries, maps/styles, search, routing, terrain, analysis, pipelines, and rendering.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables querying OpenStreetMap data (buildings, roads, amenities, etc.) via Overpass API and converts them to GeoJSON format for GIS analysis and visualization.86MIT
- AlicenseNot gradedqualityCmaintenanceEnables programmatic queries against the OpenStreetMap database using the Overpass API.91 npmMIT
- AlicenseAqualityCmaintenanceProvides MCP clients with direct, metered access to full-planet OpenStreetMap data through the hosted Overpass API, offering tools for raw Overpass QL queries, nearby and bounding-box searches, feature counting, and usage checks.543 npmMIT
- AlicenseAqualityDmaintenanceEnables LLMs to geocode and reverse geocode places, find nearby points of interest, search categories within an area, get turn-by-turn routing, suggest meeting points, and analyze neighborhoods, commutes, schools, EV charging, and parking through OpenStreetMap data services. It also serves place and map tile resources over stdio, SSE, or Streamable HTTP transports.12MIT