Enables interaction with OpenStreetMap data to search for places and amenities, validate geographic coordinates, explore map regions, and safely perform edits such as creating nodes and managing changesets.
Click on "Install 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 Edit MCP Serverfind coffee shops within 500m of the Empire State Building"
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.
OSM Edit MCP Server
A powerful Model Context Protocol (MCP) server that enables AI assistants to interact with OpenStreetMap data. Read, search, validate, and edit map data safely with built-in protections.
π What Can You Do?
π Search Places: Find restaurants, cafes, hospitals, schools, and more
π Validate Locations: Check coordinates and get detailed location info
πΊοΈ Explore Areas: Discover what's in any geographic region
βοΈ Edit Safely: Make map edits on the development server first
π€ Natural Language: Use plain English to describe what you want
π¦ Prerequisites
Python 3.10+
(Optional) uv for fast dependency management
# Install uv (optional but recommended) curl -LsSf https://astral.sh/uv/install.sh | sh
π Quick Start (5 Minutes)
1οΈβ£ Install
2οΈβ£ Configure
3οΈβ£ Test
4οΈβ£ Connect to MCP Client
Important: MCP servers communicate via stdin/stdout with MCP clients. Don't run main.py directly!
Instead, configure the server in your MCP client:
Cursor IDE: Settings β Features β MCP
Claude Desktop: See MCP Client Setup
VSCode (Cline): Add to settings.json
To test functionality without a client:
π Enable Write Operations (Optional)
To create or edit map data, you need OAuth authentication:
Step 1: Create Dev Account
Visit https://api06.dev.openstreetmap.org and sign up (separate from main OSM).
Step 2: Create OAuth App
Go to your dev account settings β OAuth 2 Applications
Register new application:
Name:
OSM Edit MCP DevRedirect URI:
https://localhost:8080/callbackPermissions: Select all checkboxes
Step 3: Add Credentials
Edit .env and add your OAuth credentials:
Step 4: Authenticate
Step 5: Verify
Expected: β 19/19 tests passing
π Available Tools
π Search & Discovery
Tool | Description | Example |
| Find places around a location | "Find restaurants within 500m" |
| Search places by name | "Where is Central Park?" |
| Text search for any element | "Search for coffee shops" |
| Convert address to coordinates | "10 Downing Street, London" |
π Location Tools
Tool | Description | Example |
| Check if coordinates are valid |
|
| Get all elements in a box | "What's in this area?" |
| Area statistics | "How many restaurants?" |
πΊοΈ OSM Data Access
Tool | Description | Example |
| Get node by ID | Node details |
| Get way by ID | Street/building info |
| Get relation by ID | Complex features |
βοΈ Editing Tools (Requires Auth)
Tool | Description | Example |
| Start editing session | Required for edits |
| Add new point | "Add restaurant here" |
| Natural language creation | "Add coffee shop called Bean There at..." |
π‘ Usage Examples
Find Nearby Restaurants
Validate Coordinates
Natural Language Search
π₯οΈ MCP Client Integration
Quick Setup for Popular Clients
Add to Cursor Settings β Features β MCP
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac)
Add to ~/.continue/config.json
Add to VSCode settings or .vscode/settings.json
π Full MCP Client Setup Guide - Detailed instructions for all clients
Example Queries
"Find restaurants near Times Square"
"What's at coordinates 48.8584, 2.2945?"
"Search for hospitals in Seattle"
π‘οΈ Safety Features
β Development API by default - Safe testing environment
β OAuth protection - Edits require authentication
β Rate limiting - Respects API limits
β Input validation - Prevents invalid data
β Changeset management - Groups edits properly
π Project Status
Version: 0.1.0
Tests: 100% passing (19/19)
Python: 3.10+
License: MIT
π Remote Deployment (Make it Accessible Anywhere)
The OSM Edit MCP Server can be deployed as a web service accessible from anywhere. This is useful for:
Team collaboration
Integration with web applications
Running on cloud servers
Access from multiple devices
π Quick Deploy with Docker
1. Prerequisites
Docker and docker-compose installed
A server with public IP or domain name
SSL certificate (or use the self-signed cert for testing)
2. Deploy Steps
The deploy script will:
Build Docker containers
Generate SSL certificates (self-signed for development)
Start the web server on port 8000
Set up Nginx reverse proxy on port 443
3. Access Your Server
After deployment, access your server at:
https://your-server-ip/(with Nginx SSL)http://your-server-ip:8000/(direct access)API docs:
http://your-server-ip:8000/docs
π‘ API Usage
All MCP functionality is exposed via REST API endpoints. Authenticate with your API key:
π Security Configuration
API Key: Set a strong
API_KEYin your.envfileSSL Certificate: Replace self-signed cert with a real one for production
Firewall: Only expose necessary ports (80, 443)
Rate Limiting: Configured via
RATE_LIMIT_PER_MINUTEin.env
βοΈ Cloud Platform Deployment
π§ Advanced Configuration
Custom Domain & SSL
Environment Variables
All configuration is done via environment variables. Key settings:
OSM_USE_DEV_API: Use dev (true) or production (false) APIAPI_KEY: Authentication key for API accessRATE_LIMIT_PER_MINUTE: API rate limitingLOG_LEVEL: Logging verbosity
Monitoring
π Production Checklist
Use production OSM API (
OSM_USE_DEV_API=false)Set strong
API_KEYInstall real SSL certificate
Configure firewall rules
Set up monitoring/alerts
Enable automated backups
Configure log rotation
Set resource limits in docker-compose.yml
π§ͺ Testing
π¨ Troubleshooting
Issue | Solution |
"Server hangs" when running main.py | This is normal! MCP servers wait for client input. Use |
"401 Unauthorized" | Run |
"Client auth failed" | Check OAuth credentials in |
Import errors | Run |
Can't see changesets | Check dev server URL (not main OSM) |
uv: command not found | Install uv: |
How do I use the server? | Configure in MCP client or run |
π Documentation
Quick Reference Card - All commands on one page
MCP Client Setup - Cursor, Claude, VSCode, etc.
Running the Server - Background, monitoring, auto-restart
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
π Links
Ready to explore the world's map data? Start with the Quick Start above! π