osm-edit-mcp / rules
Cursor rule4 starsChanged 3 months agoMITView on GitHub
ALWAYS ask the user before performing these irreversible operations: Remember: OpenStreetMap is a collaborative project used by millions. Any modifications to the live database should be done with extreme care and proper validation.
- Reads credentials
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,531 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- .cursor/rules/configuration-management.mdcCursor rule
- .cursor/rules/mcp-development.mdcCursor rule
- .cursor/rules/mcp-implementation-patterns.mdcCursor rule
- .cursor/rules/osm-development-safety.mdcCursor rule
- .cursor/rules/osm-mcp-project-structure.mdcCursor rule
- .cursor/rules/testing-and-quality.mdcCursor rule
- osm-edit-mcp-setupSkill
The file
We split this osm-edit-safety.mdc into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
ALWAYS: use dev.openstreetmap.org for testing, not production API
- Distinctive: line 51
Verify API base URL before any write operations
- Distinctive: line 54
Keep client secrets in .env file only
- Distinctive: line 55
Use keyring for persistent token storage
- Distinctive: line 57
Never log full OAuth tokens
- Distinctive: line 67
Check required tags before creating OSM elements
- Distinctive: line 68
Verify changeset exists before adding elements
- Very specific: line 82
Use @app.tool() decorator for MCP tools
- Distinctive: line 90
Always verify OSM API endpoint: before write operations
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: globs: alwaysApply: true --- # OSM Edit MCP Server - Safety and Development Rules ## ⚠️ CRITICAL: Ask Before Irreversible Operations **ALWAYS ask the user before performing these irreversible operations:** ### OpenStreetMap Operations - Creating or closing changesets via OSM API - Uploading nodes, ways, or relations to OSM - Modifying existing OSM map data - Deleting OSM elements - Making any calls to `api.openstreetmap.org` endpoints that modify data - Testing with real OSM data (suggest using dev.openstreetmap.org instead) ### Authentication & Credentials - Revoking or modifying OAuth tokens - Changing OAuth application settings - Exposing credentials in code or commits - Modifying [.env](mdc:.env) file with real credentials ### Repository Operations - Force pushing to git repository - Deleting git history or branches - Publishing package to PyPI - Creating GitHub releases ## Project Structure ### Core Files - [src/osm_edit_mcp/server.py](mdc:src/osm_edit_mcp/server.py) - Main server and `osm-edit-mcp` entry point - [pyproject.toml](mdc:pyproject.toml) - Package configuration and dependencies ### Configuration - [.env](mdc:.env) - **NEVER commit** - Contains real OAuth credentials - [.env.example](mdc:.env.example) - Template for environment variables - [.gitignore](mdc:.gitignore) - Protects sensitive files from git ### Documentation - [README.md](mdc:README.md) - Comprehensive setup and usage guide ## Development Safety Guidelines ### 1. Testing Environment - **ALWAYS** use `dev.openstreetmap.org` for testing, not production API - Set `OSM_USE_DEV_API=true` and use the allowlisted development target - Verify API base URL before any write operations ### 2. OAuth Security - Keep client secrets in [.env](mdc:.env) file only - Use keyring for persistent token storage - Reauthorize expired tokens without exposing callback URLs or token data - Never log full OAuth tokens ### 3. Error Handling - Implement comprehensive error handling for OSM API responses - Validate all input data before sending to OSM - Handle rate limiting (max 10,000 API calls per hour) - Gracefully handle network failures ### 4. Data Validation - Validate coordinates are within valid ranges (lat: -90 to 90, lon: -180 to 180) - Check required tags before creating OSM elements - Verify changeset exists before adding elements - Validate way node references exist ## MCP Server Implementation ### Tools Pattern Each MCP tool in [server.py](mdc:src/osm_edit_mcp/server.py) should: - Validate input parameters - Check authentication status - Log operation details - Handle OSM API errors gracefully - Return structured responses ### FastMCP Usage - Use `@app.tool()` decorator for MCP tools - Implement proper type hints with Pydantic models - Handle async operations correctly - Provide clear tool descriptions ## Security Reminders 1. **Never commit real credentials** to git history 2. **Always verify OSM API endpoint** before write operations 3. **Ask user confirmation** for any data modification 4. **Use development server** for testing 5. **Implement proper error handling** for all API calls ## Testing Strategy - Unit tests for data validation - Integration tests with dev.openstreetmap.org - Mock tests for OAuth flows - End-to-end MCP client testing - **Never use production OSM data for testing** Remember: OpenStreetMap is a collaborative project used by millions. Any modifications to the live database should be done with extreme care and proper validation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

