Skip to main content
Glama
README.md
# 🌍 bbox-mcp-server

**FREE Geospatial tools for AI agents, with results you can inspect on a map.**

Search OpenStreetMap & Overture Maps Places, convert coordinates, generate H3 grids, calculate routes, and sample terrain elevation. **12 MCP tools, no API keys required to get started.** Spatial results include shareable links to the [interactive map](https://vibhorsingh.com/boundingbox/).

[![Node.js](https://img.shields.io/badge/node-%3E%3D18-green)](https://nodejs.org/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)

## Try asking

- “Find cafes near Times Square.”
- “Find commercial coffee shops near Times Square with confidence scores, websites, and phone numbers.”
- “Find me pizza near the Colosseum?”
- “Eiffel Tower to the Louvre: walk or bike? Compare the routes.”
- “Where are Manhattan’s coffee hotspots?”
- “EV road trip: find chargers within 5km of Monterey.”
- “How high up is Denver, really?”
- “Find the route with the fewest traffic lights from Times Square to Central Park.”

## Quick start

Requires **Node.js 18+**. Add this to your MCP client configuration:

```json
{
  "mcpServers": {
    "bbox": {
      "command": "npx",
      "args": ["-y", "bbox-mcp-server"]
    }
  }
}
```

| Client | Configuration file |
|---|---|
| Claude Desktop | `claude_desktop_config.json` |
| Cursor | `.cursor/mcp.json` |
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
| VS Code (GitHub Copilot) | `.vscode/mcp.json` - use `servers` instead of `mcpServers` |

## Tools

| Tool | What it does |
|---|---|
| `get_bounds` | Find, buffer, convert, and project bounding boxes across formats and coordinate systems. |
| `get_h3_indices` | Generate H3 cells for a bounding box or exact polygon boundary, including holes. |
| `generate_share_url` | Create a shareable map link for a bounding box. |
| `reverse_geocode` | Resolve coordinates to an address and OpenStreetMap details. |
| `search_overpass` | Find or count OSM features within an area, bounding box, or radius. |
| `search_places` | Query Overture Maps Places POIs directly with confidence scores, brands, phones, websites, and addresses. |
| `list_osm_tags` | Find OSM tags by category using curated suggestions and Taginfo fallback. |
| `aggregate_overpass_h3` | Group OSM query results into H3 hexagons for density analysis. |
| `calculate_route` | Get driving, walking, or cycling routes with optional waypoints, alternatives, and geometry. |
| `get_elevation` | Get elevation for points, sample terrain grids, analyze 3D line-of-sight with Earth curvature, or compute route elevation/grade profiles using the 90m Copernicus DEM. |
| `spatial_calc` | Calculate geometry relations, point containment, WGS84 ellipsoidal distance/bearing, grid subdivisions, and 3D camera frustum footprints offline. |
| `check_traffic_controls` | Check traffic signals and stop signs at a junction, in a bbox/radius, or along a route. |

Your MCP client discovers each tool's full parameter and output schemas automatically. H3 tools use `resolution` (0–15).

## Inputs and outputs

Tools with a `location` parameter accept place names. Tools with a `bbox` parameter auto-detect raw coordinates, single points, `z/x/y` tiles, WKT, GeoJSON, GeoJSON bboxes, and `ogrinfo` extents.

**Coordinate order:** raw bboxes default to `lat1,lng1,lat2,lng2`; points use `lat,lng`. Use GeoJSON or WKT to avoid ambiguity, for example `{"bbox":[-74.006,40.712,-73.985,40.758]}` in west/south/east/north order. `coord_order` on `get_bounds` controls formatted output only.

`get_bounds` supports 3,900+ bundled projections via `epsg` and nine output formats: `csv`, `wkt`, `geojson-bbox`, `geojson-polygon`, `leaflet`, `overpass`, `ogc-bbox`, `kml`, and `stac-bbox`.

For Overpass searches, supply a selector such as `nwr["amenity"="cafe"]`; the server adds spatial filters. Set `radius_meters` for an explicit distance or omit it to search the area. Use `list_osm_tags` to find selectors by category.

For commercial POIs with confidence scores, brands, phone numbers, and websites, `search_places` queries Overture Maps GeoParquet files directly via HTTP range requests (no Python runtime required).

## Configuration

Place search uses Nominatim with Photon fallback; a Mapbox token is optional. Defaults work without configuration.

<details>
<summary>Optional environment variables</summary>

Add an `env` object alongside `command` and `args` in your server configuration.

| Variable | Purpose / default |
|---|---|
| `OSM_USER_AGENT` | Identify your application and contact; defaults to the server name, version, and repository URL. |
| `NOMINATIM_EMAIL` | Optional contact email for Nominatim requests. |
| `NOMINATIM_API_URL` | Geocoder endpoint; defaults to `https://nominatim.openstreetmap.org`. |
| `PHOTON_API_URL` | Fallback geocoder; defaults to `https://photon.komoot.io`. |
| `MAPBOX_ACCESS_TOKEN` | Optional additional geocoding fallback. |
| `OVERPASS_API_URL` | Custom Overpass endpoint(s); defaults rotate across public instances. |
| `OSRM_API_URL` | Preferred routing endpoint; defaults use public OSRM services. |
| `ELEVATION_API_URL` | Elevation endpoint; defaults to `https://api.open-meteo.com/v1/elevation`. |
| `MAX_H3_CELLS` | H3 generation cap; defaults to `50000`. |
| `OVERTURE_STAC_URL` | Custom Overture Maps STAC root catalog URL; defaults to `https://stac.overturemaps.org/catalog.json`. |
| `OVERTURE_STORAGE_PROVIDER` | Preferred cloud mirror for Overture GeoParquet files (`aws` default, or `azure`). |
| `OVERTURE_MAX_ROW_GROUPS` | Row-group scan safety cap per `search_places` query; defaults to `40`. |

</details>

## For developers

Successful calls return readable `content` and `structuredContent` matching the tool's output schema, including `provenance`, `complete`, and `warnings`. Spatial tools also return `share_url`. Errors use `isError: true`; structured logs go to stderr, keeping stdout reserved for MCP.

To run from source:

```sh
npm install
npm test
npm start
```

`npm test` builds the server and runs the test suite.

## Data and service use

Data © [OpenStreetMap contributors](https://www.openstreetmap.org/copyright) and [Overture Maps Foundation](https://overturemaps.org/) (`CDLA-Permissive-2.0`). Public services have usage limits: avoid bulk scraping and frequent polling, and configure your own endpoints for shared or heavy workloads.

- [Nominatim](https://operations.osmfoundation.org/policies/nominatim/) and [FOSSGIS routing](https://routing.openstreetmap.de/about.html) limit requests to 1 per second. Nominatim also requires application identification, caching, and attribution. The server's per-process queue does not cover traffic across multiple instances.
- [Photon's public endpoint](https://github.com/komoot/photon#demo-server) is a demo service without availability guarantees.
- [Open-Meteo's free API](https://open-meteo.com/en/terms) is for non-commercial use. Elevation grids return sample statistics, not guaranteed terrain-wide extrema or slopes.

[MIT License](./LICENSE)

TDQS

A3.8/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target clearly distinct resources (routing, elevation, H3 indexing, geocoding, traffic controls, tag lookup). A few boundaries are softer: search_places vs search_overpass (different datasets but same 'find POIs' intent), aggregate_overpass_h3 vs get_h3_indices (both H3, one for density binning of Overpass results, one for pure cell enumeration), and get_bounds vs generate_share_url, which both accept the same zoo of coordinate formats. Descriptions do clarify these, so misselection is unlikely but possible.

Naming Consistency4/5

Almost all names follow a snake_case verb_noun pattern (search_places, calculate_route, get_elevation, check_traffic_controls, get_bounds, get_h3_indices, list_osm_tags, reverse_geocode, search_overpass, generate_share_url). The deviations are minor: spatial_calc is noun-based rather than verb_noun, and aggregate_overpass_h3 appends a format suffix to an otherwise verb_noun name.

Tool Count4/5

12 tools is comfortably within a well-scoped range for a geospatial analysis server and each tool maps to a real capability (search, route, elevation, geometry, H3, geocode, tags, sharing). generate_share_url is arguably a cross-cutting utility that many other tools already partially cover by returning map links, which makes the set slightly heavier than strictly necessary.

Completeness4/5

The surface covers a full analysis lifecycle: POI search (Overture and OSM), routing, elevation in four modes, offline geometry math, H3 indexing/aggregation, forward and reverse geocoding, tag discovery, traffic controls, and shareable map output. Gaps are modest: no batch/multi-address geocoding, no isochrone or origin-destination matrix tool, and forward geocoding is buried inside get_bounds rather than exposed directly.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues