{"id":50379544,"url":"https://github.com/cyanheads/openstreetmap-mcp-server","last_synced_at":"2026-05-30T11:02:59.514Z","repository":{"id":359898529,"uuid":"1247699872","full_name":"cyanheads/openstreetmap-mcp-server","owner":"cyanheads","description":"Geocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data via MCP. STDIO or Streamable HTTP.","archived":false,"fork":false,"pushed_at":"2026-05-24T23:01:15.000Z","size":438,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T23:07:56.392Z","etag":null,"topics":["ai-agent","bun","cyanheads","geocoding","geolocation","mcp","mcp-server","model-context-protocol","nominatim","openstreetmap","osm","overpass","reverse-geocoding","spatial","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cyanheads/nominatim-mcp-server","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyanheads.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-23T16:58:32.000Z","updated_at":"2026-05-24T23:01:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cyanheads/openstreetmap-mcp-server","commit_stats":null,"previous_names":["cyanheads/nominatim-mcp-server","cyanheads/openstreetmap-mcp-server"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/cyanheads/openstreetmap-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fopenstreetmap-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fopenstreetmap-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fopenstreetmap-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fopenstreetmap-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyanheads","download_url":"https://codeload.github.com/cyanheads/openstreetmap-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyanheads%2Fopenstreetmap-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33689564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","bun","cyanheads","geocoding","geolocation","mcp","mcp-server","model-context-protocol","nominatim","openstreetmap","osm","overpass","reverse-geocoding","spatial","typescript"],"created_at":"2026-05-30T11:02:57.579Z","updated_at":"2026-05-30T11:02:59.509Z","avatar_url":"https://github.com/cyanheads.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e@cyanheads/openstreetmap-mcp-server\u003c/h1\u003e\n  \u003cp\u003e\u003cb\u003eGeocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data via MCP. STDIO or Streamable HTTP.\u003c/b\u003e\n  \u003cdiv\u003e6 Tools\u003c/div\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\n\n[![Version](https://img.shields.io/badge/Version-0.2.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square\u0026logo=docker\u0026logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openstreetmap-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openstreetmap-mcp-server?style=flat-square\u0026logo=npm\u0026logoColor=white)](https://www.npmjs.com/package/@cyanheads/openstreetmap-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge\u0026logo=anthropic\u0026logoColor=white)](https://github.com/cyanheads/openstreetmap-mcp-server/releases/latest/download/openstreetmap-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=openstreetmap-mcp-server\u0026config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvb3BlbnN0cmVldG1hcC1tY3Atc2VydmVyIl19) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge\u0026logo=visualstudiocode\u0026logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22openstreetmap-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fopenstreetmap-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n**Public Hosted Server:** [https://openstreetmap.caseyjhand.com/mcp](https://openstreetmap.caseyjhand.com/mcp)\n\n\u003c/div\u003e\n\n---\n\n## Tools\n\n6 tools for geocoding and spatial queries against OpenStreetMap data:\n\n| Tool | Description |\n|:---|:---|\n| `openstreetmap_geocode` | Convert a place name or address to geographic coordinates and structured place data |\n| `openstreetmap_reverse` | Convert latitude/longitude coordinates to the nearest address or place name |\n| `openstreetmap_lookup` | Fetch address details for one or more known OSM objects by their IDs |\n| `openstreetmap_query_nearby` | Find OSM features within a radius around a geographic point |\n| `openstreetmap_query_bbox` | Find OSM features within a rectangular bounding box |\n| `openstreetmap_query_raw` | Execute a raw Overpass QL query for advanced spatial operations |\n\n### `openstreetmap_geocode`\n\nConvert a place name or address to geographic coordinates via Nominatim/OpenStreetMap.\n\n- Two input modes: free-form query string (e.g., `\"Space Needle Seattle\"`) or structured address fields (street, city, state, country, postal code) — mutually exclusive\n- Country filtering via ISO 3166-1 alpha-2 codes (`countrycodes`)\n- Data layer filtering: address, poi, railway, natural, manmade\n- Feature type restriction: country, state, city, settlement\n- Optional extra OSM tags (phone, website, opening_hours, wikidata)\n- Preferred language override via BCP 47 code\n- Returns results ordered by Nominatim importance score (global prominence)\n- Results include coordinates, structured address, bounding box, OSM type/ID for chaining into `openstreetmap_lookup`\n\n---\n\n### `openstreetmap_reverse`\n\nConvert latitude/longitude to the nearest address or named place.\n\n- Zoom-level control for address detail: 18=building, 16=street, 14=neighbourhood, 12=town, 10=city, 8=county, 5=state, 3=country\n- Layer filtering for matched OSM object type\n- Optional extra OSM tags and language preference\n- Returns structured address breakdown, OSM type/ID, and bounding box\n\n---\n\n### `openstreetmap_lookup`\n\nFetch full Nominatim address records for known OSM object IDs.\n\n- Accepts single ID or array of up to 50 IDs\n- IDs must be prefixed with N (node), W (way), or R (relation): e.g., `\"N240109189\"`, `\"W50637691\"`, `\"R146656\"`\n- Efficient alternative to a full geocoding round-trip when OSM IDs are already known (e.g., from an Overpass result)\n- Reports `not_found` list for IDs that returned no result\n- Optional extra OSM tags and language preference\n\n---\n\n### `openstreetmap_query_nearby`\n\nFind OSM features within a radius around a point via the Overpass API.\n\n- Primary tool for \"what's near X?\" spatial queries\n- Supports `amenity` shortcut for common POI types (hospital, pharmacy, restaurant, cafe, school, atm) or `tag_key` + `tag_value` for any OSM category (leisure=park, shop=supermarket, natural=peak)\n- Configurable radius up to 50km; keep under 5km for dense urban POI queries\n- Element type filtering: node (standalone POIs), way (buildings/areas), relation (complex structures)\n- Limit up to 500 results; `truncated` flag signals when more exist\n- Returns OSM type/ID, coordinates, name, and full tag set for each feature\n\n---\n\n### `openstreetmap_query_bbox`\n\nFind OSM features within a rectangular geographic bounding box.\n\n- Useful for area surveys where proximity to a single point isn't the goal\n- Same `amenity` / `tag_key` + `tag_value` interface as `openstreetmap_query_nearby`\n- Configurable timeout for large bounding boxes or dense areas\n- Limit up to 500 results with `truncated` flag\n\n---\n\n### `openstreetmap_query_raw`\n\nExecute arbitrary Overpass QL for queries the convenience tools don't cover.\n\n- Full Overpass QL expressiveness: multi-type queries, union queries, relation membership, historical queries\n- Query must include `[out:json]`; server injects `[timeout:N]` if absent\n- Returns raw element array — structure varies by query type (nodes have lat/lon, ways have nodes[], relations have members[])\n- Validate complex queries at [overpass-turbo.eu](https://overpass-turbo.eu) before use\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):\n\n- Declarative tool definitions — single file per tool, framework handles registration and validation\n- Unified error handling across all tools\n- Pluggable auth (`none`, `jwt`, `oauth`)\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase\n\nNominatim/Overpass-specific:\n\n- Nominatim usage policy compliance: configurable `User-Agent` via `OSM_USER_AGENT`, rate-limit-aware request handling\n- OSM attribution on every response (`Data © OpenStreetMap contributors, ODbL 1.0`)\n- Private instance support — override `OSM_NOMINATIM_BASE_URL` and `OSM_OVERPASS_BASE_URL` for self-hosted or mirror endpoints\n- Structured error contracts: `no_results`, `no_coverage`, `invalid_id_format`, `invalid_tag`, `query_timeout`, `rate_limited`, `query_error`, `result_too_large` — all with actionable recovery hints\n\nAgent-friendly output:\n\n- Attribution on every response — agents can surface the ODbL license notice as required\n- Structured output contracts — coordinates, OSM IDs, address fields, and tag maps in consistent shapes\n- Cross-tool chaining: Overpass results carry `osm_type` + `osm_id` that feed directly into `openstreetmap_lookup` for full address records\n\n## Getting started\n\n### Self-Hosted / Local\n\nAdd the following to your MCP client configuration file.\n\n```json\n{\n  \"mcpServers\": {\n    \"openstreetmap\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/openstreetmap-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"openstreetmap\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/openstreetmap-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\n### Prerequisites\n\n- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js ≥24.0.0).\n- No API key required — Nominatim and Overpass are public APIs. For heavy use, consider pointing `OSM_NOMINATIM_BASE_URL` and `OSM_OVERPASS_BASE_URL` at self-hosted or mirror instances.\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/openstreetmap-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd openstreetmap-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n## Configuration\n\nAll configuration is validated at startup via Zod schemas in `src/config/server-config.ts`. Key environment variables:\n\n| Variable | Description | Default |\n|:---|:---|:---|\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |\n| `MCP_HTTP_PORT` | HTTP server port | `3010` |\n| `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path where the MCP server is mounted | `/mcp` |\n| `MCP_PUBLIC_URL` | Public origin override for TLS-terminating reverse-proxy deployments | none |\n| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |\n| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |\n| `MCP_GC_PRESSURE_INTERVAL_MS` | Opt-in Bun-only forced-GC pressure loop (ms). Recommended starting point if heap growth is observed: `60000`. | `0` (disabled) |\n| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |\n| `OSM_NOMINATIM_BASE_URL` | Nominatim API base URL. Override for a private or mirror instance. | `https://nominatim.openstreetmap.org` |\n| `OSM_OVERPASS_BASE_URL` | Overpass API endpoint URL. Override for a mirror or private instance. | `https://overpass-api.de/api/interpreter` |\n| `OSM_USER_AGENT` | User-Agent sent to Nominatim and Overpass. Required by usage policy. | `openstreetmap-mcp-server/0.1.8` |\n| `OTEL_ENABLED` | Enable OpenTelemetry | `false` |\n\n## Running the server\n\n### Local development\n\n- **Build and run the production version**:\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:http\n  # or\n  bun run start:stdio\n  ```\n\n- **Run checks and tests**:\n  ```sh\n  bun run devcheck  # Lints, formats, type-checks, and more\n  bun run test      # Runs the test suite\n  ```\n\n## Project structure\n\n| Directory | Purpose |\n|:---|:---|\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Six tools across Nominatim and Overpass. |\n| `src/services/nominatim` | Nominatim service layer — API client, search, reverse, lookup. |\n| `src/services/overpass` | Overpass service layer — query builder, executor, element normalizer. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n\n## Development guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for logging, `ctx.state` for storage\n- Register new tools and resources in the `createApp()` arrays\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.\n\nMap data from [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors, available under the [Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyanheads%2Fopenstreetmap-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyanheads%2Fopenstreetmap-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyanheads%2Fopenstreetmap-mcp-server/lists"}