OpenStreetMap MCP
Allows AI assistants to read and edit OpenStreetMap via the OSM API v0.6, including retrieving elements, changesets, users, and map notes; creating/updating/deleting elements; uploading atomic diffs; and managing changesets and notes with OAuth 2.0 authentication.
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., "@OpenStreetMap MCP what OSM nodes are near 51.5007, -0.1246?"
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.
OpenStreetMap MCP
A Model Context Protocol server that lets AI assistants read and edit OpenStreetMap through the OSM API v0.6, authenticating with OAuth 2.0 (authorization code + PKCE).
⚠️ Edits are public, permanent and attributed to your OSM account. Practise on the sandbox server (
OSM_ENV=dev) and follow the OSM editing guidelines. Don't run bulk or automated edits without following the automated edits code of conduct.
Quick start
Reading works with no setup. Editing needs an OAuth app.
1. Register an OAuth 2 application (for editing)
On openstreetmap.org/oauth2/applications (or the sandbox) create an app:
Redirect URI:
http://127.0.0.1:8787/callbackConfidential application: leave unchecked (public client using PKCE, no secret needed)
Permissions:
read_prefs,write_api,write_notes(add others if you setOSM_SCOPES)
Copy the Client ID.
2. Add to your MCP client
{
"mcpServers": {
"openstreetmap": {
"command": "npx",
"args": ["-y", "openstreetmap-mcp"],
"env": { "OSM_CLIENT_ID": "<your client id>" }
}
}
}Claude Code: claude mcp add openstreetmap -e OSM_CLIENT_ID=<id> -- npx -y openstreetmap-mcp
3. Log in
Ask the assistant to call osm_login. It returns a URL; open it, approve, and the token is stored in ~/.config/openstreetmap-mcp/ (mode 0600). Confirm with osm_whoami.
Related MCP server: architecture-map MCP server
Configuration
Variable | Default | Purpose |
| – | OAuth 2 client ID (needed for |
| – | Only for confidential apps |
| – | Use a pre-made token instead of the login flow |
|
|
|
|
| Space/comma separated OAuth scopes |
|
| Loopback port; must match the registered redirect URI |
| per env | Override hosts |
|
| Sent on every request (OSM requires one) |
|
| Token storage |
Tools
Auth: osm_login, osm_logout, osm_whoami
Read (no login needed): osm_capabilities, osm_get_element, osm_get_elements, osm_get_element_full, osm_element_history, osm_element_parents, osm_get_bbox, osm_get_changeset, osm_get_changeset_diff, osm_search_changesets, osm_get_user
Edit (login required): osm_create_changeset, osm_update_changeset_tags, osm_close_changeset, osm_comment_changeset, osm_create_element, osm_update_element, osm_delete_element, osm_upload_diff
Map notes: read — osm_get_notes_in_bbox, osm_search_notes, osm_get_note; write — osm_create_note, osm_comment_note, osm_close_note, osm_reopen_note
Typical edit flow
osm_login → osm_create_changeset → osm_get_element (current version) → osm_update_element (full replace, so send all tags) → osm_close_changeset.
For many related changes use osm_upload_diff, which applies creates/modifies/deletes atomically and lets new elements reference each other via negative ids.
Development
npm install
npm run typecheck && npm test
npm run dev # stdio server from sourceSee AGENTS.md for architecture and workflow, and CONTRIBUTING.md. Work is tracked in GitHub issues.
License
MIT. OpenStreetMap data is © OpenStreetMap contributors, ODbL.
Available Tools
29 toolsosm_capabilitiesARead-only
Get API capabilities and limits of the connected OSM server (max bbox area, changeset size, timeouts).
Inputs: no named parameters.
osm_close_changesetA
Close a changeset you own. Changesets also close automatically after an hour of inactivity.
Inputs: id (required).
osm_close_noteA
Close a map note (optionally with a closing comment). Requires auth with the write_notes scope.
Inputs: id (required), text.
osm_comment_changesetB
Post a comment on a changeset's discussion (any changeset, not only yours).
Inputs: id (required), text (required).
osm_comment_noteA
Add a comment to an open map note. Requires auth with the write_notes scope.
Inputs: id (required), text (required).
osm_create_changesetA
Open a new changeset. All edits must belong to an open changeset; give it a meaningful comment. Returns the changeset id. Edits are public and attributed to the authenticated OSM user. Follow the OSM editing guidelines; use OSM_ENV=dev to practise on the sandbox server.
Inputs: comment (required), source, extra_tags.
osm_create_elementA
Create one node, way, or relation inside an open changeset. Returns the new id (version is 1). Referenced nodes/members must already exist; for many related creations use osm_upload_diff. Edits are public and attributed to the authenticated OSM user. Follow the OSM editing guidelines; use OSM_ENV=dev to practise on the sandbox server.
Inputs: element (required), changeset_id (required).
osm_create_noteB
Create a map note at a location. Requires auth with the write_notes scope. Public and visible to everyone.
Inputs: lat (required), lon (required), text (required).
osm_delete_elementADestructive
Delete an element. Fails with 412 if it is still referenced by a way or relation. Nodes need their current lat/lon. Returns the new version. Edits are public and attributed to the authenticated OSM user. Follow the OSM editing guidelines; use OSM_ENV=dev to practise on the sandbox server.
Inputs: element (required), changeset_id (required).
osm_element_historyBRead-only
List all versions of an element, oldest first. Useful to see who changed what.
Inputs: id (required), type (required).
osm_element_parentsBRead-only
Find what uses an element: relations containing any element, or ways containing a node.
Inputs: id (required), type (required), parent.
osm_get_bboxARead-only
Download all data in a bounding box. The API limits the area (see osm_capabilities, default 0.25 square degrees) and node count; keep boxes small.
Inputs: max_lat (required), max_lon (required), min_lat (required), min_lon (required).
osm_get_changesetBRead-only
Read a changeset's metadata, optionally with its discussion comments.
Inputs: id (required), include_discussion.
osm_get_changeset_diffARead-only
Get the osmChange (XML) describing everything a changeset created, modified, or deleted.
Inputs: id (required).
osm_get_elementARead-only
Read a single node, way, or relation (current version, or a specific version).
Inputs: id (required), type (required), version.
osm_get_element_fullARead-only
Read a way or relation together with all the elements it references (nodes of a way; members of a relation).
Inputs: id (required), type (required).
osm_get_elementsARead-only
Read several elements of one type in a single call (current versions).
Inputs: ids (required), type (required).
osm_get_noteARead-only
Read one map note with its full comment thread.
Inputs: id (required).
osm_get_notes_in_bboxCRead-only
List map notes (user-reported map problems) in a bounding box. Max bbox area is limited by the server.
Inputs: max_lat (required), max_lon (required), min_lat (required), min_lon (required), +2 more.
osm_get_userBRead-only
Get public profile details of a user by numeric id.
Inputs: id (required).
osm_loginA
Start OAuth 2.0 login (authorization code + PKCE). Returns a URL the user must open in a browser and approve; the token is then captured automatically by a temporary local listener (5 minute window). Afterwards call osm_whoami to confirm. Needed before any editing or note-writing tool.
Inputs: no named parameters.
osm_logoutA
Revoke the stored OAuth token and delete it from disk.
Inputs: no named parameters.
osm_reopen_noteA
Reopen a closed map note (optionally with a comment). Requires auth with the write_notes scope.
Inputs: id (required), text.
osm_search_changesetsARead-only
Search changesets. All filters are optional and combined with AND. Returns newest first, max 100.
Inputs: bbox, open, time, user, +5 more.
osm_search_notesCRead-only
Full-text search of map notes and their comments.
Inputs: q (required), sort, limit, order, +1 more.
osm_update_changeset_tagsA
Replace all tags on an open changeset you own (include existing ones you want to keep).
Inputs: id (required), tags (required).
osm_update_elementA
Replace an element's tags and geometry. This is a full replace, not a patch: first read the element with osm_get_element, change what you need, and send back everything including unchanged tags. Returns the new version. Edits are public and attributed to the authenticated OSM user. Follow the OSM editing guidelines; use OSM_ENV=dev to practise on the sandbox server.
Inputs: element (required), changeset_id (required).
osm_upload_diffADestructive
Apply many creates/modifies/deletes atomically in one request (osmChange). Use negative ids for new elements and reference them from ways/relations in the same diff; the result maps placeholder ids to real ones. Order: creates, then modifies, then deletes. Edits are public and attributed to the authenticated OSM user. Follow the OSM editing guidelines; use OSM_ENV=dev to practise on the sandbox server.
Inputs: changeset_id (required), create, delete, modify.
osm_whoamiARead-only
Show the server being used and the authenticated user (if any), including permissions.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools target clearly distinct resources or lifecycle stages: element reads/writes, changeset operations, notes, auth, and capabilities. The main ambiguity is among the element-read family (osm_get_element, osm_get_elements, osm_get_element_full, osm_element_history, osm_element_parents), but their descriptions make the boundaries reasonably clear.
The tool set mostly follows a predictable osm_verb_noun pattern such as osm_get_element, osm_create_changeset, and osm_close_note. Minor deviations exist, notably osm_element_history and osm_element_parents missing a get_ prefix and a few noun/command-style names like osm_whoami and osm_capabilities.
At 29 tools this is a heavy surface, exceeding the typical well-scoped range. The OSM domain is broad enough to justify many operations, but some closely related read tools could potentially be consolidated to reduce selection burden.
The server covers element CRUD, batch osmChange uploads, history, parent lookup, bounding-box reads, changeset lifecycle/search/diff/comments, note lifecycle/search, authentication, and capabilities. This is a very complete surface for interacting with the OpenStreetMap API.
Maintenance
Related MCP Connectors
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Connect AI assistants to JustRoadmap to list, read and update workspaces, roadmaps, lanes and items. OAuth sign-in with read-only or read-and-change access per workspace. No delete tools.
Web search, data extraction and controlled browser automation for AI assistants via OAuth.
AI phone receptionist for small businesses: calls, transcripts, recordings, contacts, appointments, texts and outbound AI calls. OAuth 2.1 with PKCE and dynamic client registration; the account owner picks what the assistant may do.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI assistants to search, validate, and edit OpenStreetMap data through natural language commands and built-in safety protections. It supports discovery of nearby amenities, geographic data exploration, and secure map editing via OAuth authentication.455MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible AI agents to read and write architecture-map projects and diagrams with per-project access controls via OAuth 2.1/PKCE.13 npm1ISC
- AlicenseAqualityBmaintenanceA read-only MCP server for OpenStreetMap offering geocoding, routing, route optimization, isochrones, and POI search—requiring no API key and built for AI travel planning.11428 npm6MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI clients to securely access a user's profile, orders, invoices, subscriptions, and usage stats through OAuth 2.1 with PKCE.-