bbox-mcp-server 1.4.0 β 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -322
- package/dist/index.js +2078 -283
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,322 +1,112 @@
|
|
|
1
|
-
# π bbox-mcp-server
|
|
2
|
-
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"args": ["-y", "bbox-mcp-server"]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
</details>
|
|
119
|
-
|
|
120
|
-
<details>
|
|
121
|
-
<summary><b>VS Code (GitHub Copilot) or Google Antigravity</b> <i>(Click to expand)</i></summary>
|
|
122
|
-
|
|
123
|
-
Add to `.vscode/mcp.json` in your workspace:
|
|
124
|
-
```json
|
|
125
|
-
{
|
|
126
|
-
"servers": {
|
|
127
|
-
"bbox": {
|
|
128
|
-
"command": "npx",
|
|
129
|
-
"args": ["-y", "bbox-mcp-server"]
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
</details>
|
|
135
|
-
|
|
136
|
-
<br/>
|
|
137
|
-
|
|
138
|
-
> Try: *"Find all coffee shops within 500m of Times Square"*
|
|
139
|
-
|
|
140
|
-
### Optional Configuration
|
|
141
|
-
|
|
142
|
-
```json
|
|
143
|
-
{
|
|
144
|
-
"mcpServers": {
|
|
145
|
-
"bbox": {
|
|
146
|
-
"command": "npx",
|
|
147
|
-
"args": ["-y", "bbox-mcp-server"],
|
|
148
|
-
"env": {
|
|
149
|
-
"MAPBOX_ACCESS_TOKEN": "pk.your-token-here",
|
|
150
|
-
"OVERPASS_API_URL": "https://your.custom.overpass.instance/api/interpreter",
|
|
151
|
-
"NOMINATIM_API_URL": "https://your.custom.nominatim.instance"
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
| Variable | Default | Description |
|
|
159
|
-
|---|---|---|
|
|
160
|
-
| `MAPBOX_ACCESS_TOKEN` | β | Enables natural language location search (e.g. *"San Francisco"*) |
|
|
161
|
-
| `OVERPASS_API_URL` | auto | Custom Overpass endpoint. By default, rotates between `overpass-api.de` and `kumi.systems`. |
|
|
162
|
-
| `NOMINATIM_API_URL` | `https://nominatim.openstreetmap.org` | Custom Nominatim endpoint. Set this if hosting as a shared/remote MCP server or using a commercial provider. |
|
|
163
|
-
| `MAX_H3_CELLS` | `50000` | Safety cap for H3 grid generation |
|
|
164
|
-
|
|
165
|
-
*Or install globally: `npm install -g bbox-mcp-server`*
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Tool Reference
|
|
170
|
-
|
|
171
|
-
### `get_bounds`
|
|
172
|
-
|
|
173
|
-
Convert and project a bounding box across 6 input formats, 9 output formats, and 3,900+ coordinate systems. Returns the center point and tile coordinates for the centroid.
|
|
174
|
-
|
|
175
|
-
| Param | Type | Default | Description |
|
|
176
|
-
|---|---|---|---|
|
|
177
|
-
| `bbox` | string | β | Input geometry (coordinates, WKT, GeoJSON, ogrinfo extent) |
|
|
178
|
-
| `epsg` | string | `"4326"` | Target projection. Unknown codes auto-fetched from epsg.io. |
|
|
179
|
-
| `format` | string | `"csv"` | Output: `csv`, `wkt`, `geojson-bbox`, `geojson-polygon`, `leaflet`, `overpass`, `ogc-bbox`, `kml`, `stac-bbox` |
|
|
180
|
-
| `coord_order` | string | `"lng,lat"` | Swap to `"lat,lng"` for APIs that expect latitude first |
|
|
181
|
-
| `zoom` | number | `15` | Zoom level for tile coordinate calculation |
|
|
182
|
-
| `precision` | number | `6` | Decimal places in formatted output |
|
|
183
|
-
|
|
184
|
-
**π‘ Prompt:** *"Get the bounding box for Central Park in WKT format projected to EPSG:32618"*
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
### `get_h3_indices`
|
|
189
|
-
|
|
190
|
-
Generate Uber H3 hexagonal cell indices covering a bounding box.
|
|
191
|
-
|
|
192
|
-
| Param | Type | Default | Description |
|
|
193
|
-
|---|---|---|---|
|
|
194
|
-
| `bbox` | string | β | Input geometry |
|
|
195
|
-
| `resolution` | number | β | H3 resolution (0β15) |
|
|
196
|
-
| `compact` | boolean | `false` | Merge cells into coarser parents where possible |
|
|
197
|
-
| `return_geometry` | boolean | `false` | Include GeoJSON hex boundaries |
|
|
198
|
-
|
|
199
|
-
**π‘ Prompt:** *"Give me H3 cells at resolution 7 for downtown Chicago, include the hex geometries"*
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
### `search_overpass`
|
|
204
|
-
|
|
205
|
-
Execute an Overpass query within a bounding box or radius. Returns structured results with names, coordinates, and tags. The verification link plots each result as a pin on the map.
|
|
206
|
-
|
|
207
|
-
| Param | Type | Default | Description |
|
|
208
|
-
|---|---|---|---|
|
|
209
|
-
| `bbox` | string | β | Input geometry |
|
|
210
|
-
| `query` | string | β | Overpass QL (e.g. `nwr["amenity"="cafe"]`). The server wraps it in the appropriate spatial filter automatically. |
|
|
211
|
-
| `radius_meters` | number | β | Search radius in metres. Use only when the user specifies an explicit distance (e.g. `2000` for "within 2km"). Omit for area/region queries. |
|
|
212
|
-
| `limit` | number | `100` | Max elements returned |
|
|
213
|
-
|
|
214
|
-
**π‘ Prompt:** *"Find all parking within 2km of JFK airport"*
|
|
215
|
-
|
|
216
|
-
**π‘ Prompt:** *"Search for hospitals in Manhattan, limit 50"*
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
### `list_osm_tags`
|
|
221
|
-
|
|
222
|
-
Look up the correct OpenStreetMap tags for a category before writing an Overpass query.
|
|
223
|
-
|
|
224
|
-
| Param | Type | Description |
|
|
225
|
-
|---|---|---|
|
|
226
|
-
| `category` | string | Broad category (e.g. `"food"`, `"health"`, `"transport"`) |
|
|
227
|
-
|
|
228
|
-
**π‘ Prompt:** *"What are the correct OSM tags for supermarkets?"*
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
### `aggregate_overpass_h3`
|
|
233
|
-
|
|
234
|
-
Run an Overpass query and bin results into H3 hexagons for spatial density analysis. Returns counts per cell and GeoJSON hex boundaries.
|
|
235
|
-
|
|
236
|
-
| Param | Type | Default | Description |
|
|
237
|
-
|---|---|---|---|
|
|
238
|
-
| `bbox` | string | β | Input geometry |
|
|
239
|
-
| `query` | string | β | Overpass QL core query |
|
|
240
|
-
| `resolution` | number | `8` | H3 resolution for binning |
|
|
241
|
-
|
|
242
|
-
**π‘ Prompt:** *"Aggregate all hospitals in Seattle into H3 bins at resolution 7"*
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
### `generate_share_url`
|
|
247
|
-
|
|
248
|
-
Generate a shareable link to visualize a bounding box on the interactive map at vibhorsingh.com/boundingbox.
|
|
249
|
-
|
|
250
|
-
| Param | Type | Description |
|
|
251
|
-
|---|---|---|
|
|
252
|
-
| `bbox` | string | Input geometry |
|
|
253
|
-
|
|
254
|
-
**π‘ Prompt:** *"Generate a share link for bbox 40.7128,-74.0060,40.7580,-73.9855"*
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## Supported Input Formats
|
|
259
|
-
|
|
260
|
-
All tools auto-detect the input format. No need to specify which one you're using.
|
|
261
|
-
|
|
262
|
-
| Format | Example |
|
|
263
|
-
|---|---|
|
|
264
|
-
| Raw coordinates | `40.7128,-74.0060,40.7580,-73.9855` |
|
|
265
|
-
| WKT | `POLYGON((-74.006 40.712, -73.985 40.712, ...))` |
|
|
266
|
-
| GeoJSON | `{"type":"Feature","geometry":{...}}` |
|
|
267
|
-
| GeoJSON bbox | `{"bbox":[-74.006,40.712,-73.985,40.758]}` |
|
|
268
|
-
| ogrinfo extent | `Extent: (-74.006, 40.712) - (-73.985, 40.758)` |
|
|
269
|
-
| Space-separated | `40.7128 -74.0060 40.7580 -73.9855` |
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## π€ For AI Agent Developers
|
|
274
|
-
|
|
275
|
-
### Response structure
|
|
276
|
-
|
|
277
|
-
Every tool returns two content blocks:
|
|
278
|
-
|
|
279
|
-
1. **Human-readable text** β formatted output with the map verification link
|
|
280
|
-
2. **Structured JSON** β all computed data, machine-parseable
|
|
281
|
-
|
|
282
|
-
Example `get_bounds` JSON response:
|
|
283
|
-
|
|
284
|
-
```json
|
|
285
|
-
{
|
|
286
|
-
"original_wgs84": { "lat1": 40.7128, "lng1": -74.006, "lat2": 40.758, "lng2": -73.9855 },
|
|
287
|
-
"projected": { "xmin": -8238310.23, "ymin": 4970241.32, "xmax": -8235527.11, "ymax": 4976491.56 },
|
|
288
|
-
"center": { "lat": 40.7354, "lng": -73.99575 },
|
|
289
|
-
"tile_indices": { "z": 15, "x": 9660, "y": 12284 },
|
|
290
|
-
"epsg": "3857",
|
|
291
|
-
"coord_order": "lng,lat",
|
|
292
|
-
"area_km2": 8.681,
|
|
293
|
-
"dimensions": { "width_km": 1.714, "height_km": 5.066 },
|
|
294
|
-
"share_url": "https://vibhorsingh.com/boundingbox/#40.712800,-74.006000,40.758000,-73.985500"
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
### Error handling
|
|
300
|
-
|
|
301
|
-
All errors return `isError: true` with a descriptive message. Invalid coordinates, unknown EPSG codes, and oversized H3 requests all return clean errors β the server never crashes on bad input.
|
|
302
|
-
|
|
303
|
-
### Logging
|
|
304
|
-
|
|
305
|
-
Structured JSON logs go to **stderr** (stdout is reserved for MCP protocol). Each entry includes timestamp, level, and context.
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
## Acknowledgments & Fair Use
|
|
309
|
-
|
|
310
|
-
### OpenStreetMap
|
|
311
|
-
|
|
312
|
-
This tool is built on [OpenStreetMap](https://www.openstreetmap.org/): A global dataset created and maintained by millions of volunteers. Every query you run returns data that someone walked, mapped, or verified by hand. If you find this useful, consider [contributing to OSM](https://wiki.openstreetmap.org/wiki/How_to_contribute).
|
|
313
|
-
|
|
314
|
-
### Responsible Usage
|
|
315
|
-
|
|
316
|
-
The public Overpass and Nominatim API instances are free community resources with limited capacity. Avoid tight loops, excessive polling, or bulk-scraping. If hosting this as a shared/remote MCP server, point `NOMINATIM_API_URL` and `OVERPASS_API_URL` at your own instance or a commercial provider (see [Overpass API installation](https://wiki.openstreetmap.org/wiki/Overpass_API/Installation) and [Nominatim installation](https://nominatim.org/release-docs/latest/admin/Installation/)). The default server rotation for Overpass helps spread load, but it's not a substitute for responsible usage.
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
## License
|
|
320
|
-
MIT
|
|
321
|
-
|
|
322
|
-
[](https://lobehub.com/mcp/iamvibhorsingh-bbox-mcp-server)
|
|
1
|
+
# π bbox-mcp-server
|
|
2
|
+
|
|
3
|
+
**FREE Geospatial tools for AI agents, with results you can inspect on a map.**
|
|
4
|
+
|
|
5
|
+
Search OpenStreetMap, convert coordinates, generate H3 grids, calculate routes, and sample terrain elevation. **10 MCP tools, no API keys required to get started.** Spatial results include shareable links to the [interactive map](https://vibhorsingh.com/boundingbox/).
|
|
6
|
+
|
|
7
|
+
[](https://nodejs.org/) [](./LICENSE)
|
|
8
|
+
|
|
9
|
+
## Try asking
|
|
10
|
+
|
|
11
|
+
- βFind cafes near Times Square.β
|
|
12
|
+
- βFind me pizza near the Colosseum?β
|
|
13
|
+
- βEiffel Tower to the Louvre: walk or bike? Compare the routes.β
|
|
14
|
+
- βWhere are Manhattanβs coffee hotspots?β
|
|
15
|
+
- βEV road trip: find chargers within 5km of Monterey.β
|
|
16
|
+
- βHow high up is Denver, really?β
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
Requires **Node.js 18+**. Add this to your MCP client configuration:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"bbox": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "bbox-mcp-server"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Client | Configuration file |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Claude Desktop | `claude_desktop_config.json` |
|
|
36
|
+
| Cursor | `.cursor/mcp.json` |
|
|
37
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
38
|
+
| VS Code (GitHub Copilot) | `.vscode/mcp.json` - use `servers` instead of `mcpServers` |
|
|
39
|
+
|
|
40
|
+
## Tools
|
|
41
|
+
|
|
42
|
+
| Tool | What it does |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `get_bounds` | Find, buffer, convert, and project bounding boxes across formats and coordinate systems. |
|
|
45
|
+
| `get_h3_indices` | Generate H3 cells for a bounding box or exact polygon boundary, including holes. |
|
|
46
|
+
| `generate_share_url` | Create a shareable map link for a bounding box. |
|
|
47
|
+
| `reverse_geocode` | Resolve coordinates to an address and OpenStreetMap details. |
|
|
48
|
+
| `search_overpass` | Find or count OSM features within an area, bounding box, or radius. |
|
|
49
|
+
| `list_osm_tags` | Find OSM tags by category using curated suggestions and Taginfo fallback. |
|
|
50
|
+
| `aggregate_overpass_h3` | Group OSM query results into H3 hexagons for density analysis. |
|
|
51
|
+
| `calculate_route` | Get driving, walking, or cycling distance, duration, and route geometry. |
|
|
52
|
+
| `get_elevation` | Get elevation for points or sample a terrain grid using the 90m Copernicus DEM. |
|
|
53
|
+
| `spatial_calc` | Calculate geometry relations, point containment, distance/bearing, and grid subdivisions offline. |
|
|
54
|
+
|
|
55
|
+
Your MCP client discovers each tool's full parameter and output schemas automatically. H3 tools use `resolution` (0β15).
|
|
56
|
+
|
|
57
|
+
## Inputs and outputs
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
**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.
|
|
62
|
+
|
|
63
|
+
`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`.
|
|
64
|
+
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
Place search uses Nominatim with Photon fallback; a Mapbox token is optional. Defaults work without configuration.
|
|
70
|
+
|
|
71
|
+
<details>
|
|
72
|
+
<summary>Optional environment variables</summary>
|
|
73
|
+
|
|
74
|
+
Add an `env` object alongside `command` and `args` in your server configuration.
|
|
75
|
+
|
|
76
|
+
| Variable | Purpose / default |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `OSM_USER_AGENT` | Identify your application and contact; defaults to the server name, version, and repository URL. |
|
|
79
|
+
| `NOMINATIM_EMAIL` | Optional contact email for Nominatim requests. |
|
|
80
|
+
| `NOMINATIM_API_URL` | Geocoder endpoint; defaults to `https://nominatim.openstreetmap.org`. |
|
|
81
|
+
| `PHOTON_API_URL` | Fallback geocoder; defaults to `https://photon.komoot.io`. |
|
|
82
|
+
| `MAPBOX_ACCESS_TOKEN` | Optional additional geocoding fallback. |
|
|
83
|
+
| `OVERPASS_API_URL` | Custom Overpass endpoint(s); defaults rotate across public instances. |
|
|
84
|
+
| `OSRM_API_URL` | Preferred routing endpoint; defaults use public OSRM services. |
|
|
85
|
+
| `ELEVATION_API_URL` | Elevation endpoint; defaults to `https://api.open-meteo.com/v1/elevation`. |
|
|
86
|
+
| `MAX_H3_CELLS` | H3 generation cap; defaults to `50000`. |
|
|
87
|
+
|
|
88
|
+
</details>
|
|
89
|
+
|
|
90
|
+
## For developers
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
To run from source:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
npm install
|
|
98
|
+
npm test
|
|
99
|
+
npm start
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`npm test` builds the server and runs the test suite.
|
|
103
|
+
|
|
104
|
+
## Data and service use
|
|
105
|
+
|
|
106
|
+
Data Β© [OpenStreetMap contributors](https://www.openstreetmap.org/copyright). Public services have usage limits: avoid bulk scraping and frequent polling, and configure your own endpoints for shared or heavy workloads.
|
|
107
|
+
|
|
108
|
+
- [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.
|
|
109
|
+
- [Photon's public endpoint](https://github.com/komoot/photon#demo-server) is a demo service without availability guarantees.
|
|
110
|
+
- [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.
|
|
111
|
+
|
|
112
|
+
[MIT License](./LICENSE)
|