Get the FREE Ultimate OpenClaw Setup Guide →

OSM-GeoJSON

OpenStreetMap(OSM)のデータをGeoJSON形式で取得するMCP(Model Context Protocol)サーバー。

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shimizu-osm-geojson-mcp-server npx -y shimizu-osm-geojson-mcp-server \
  --env CACHE_TTL_MINUTES="15 (default)" \
  --env OSM_OVERPASS_ENDPOINT="https://overpass-api.de/api/interpreter (default)"

How to use

This MCP server provides a suite of Overpass-based tools for pulling OpenStreetMap data and exporting it as GeoJSON. It exposes 12 tools, including building data, roads, amenities, waterways, green spaces, and railways, as well as utility functions for API statistics, connection tests, and data conversion. You can request data within a bounding box, specify types (e.g., residential buildings, motorways, restaurants), and export results directly to GeoJSON or JSON files. The server is designed to handle multi-server fallbacks, caching (with a 15-minute TTL), and robust error handling via MCP protocol conventions.

To use, start the server through the MCP interface (via the npm/npx-based command embedded in mcp_config) and call individual tools through the MCP JSON-RPC protocol. For example, you can fetch buildings in a bounding box by invoking the get_buildings tool with minLon, minLat, maxLon, maxLat, and optional parameters like building_type and limit. You can also test the Overpass connection, convert OSM data to GeoJSON with convert_to_geojson, or download raw OSM data with download_area_all. The tools support file outputs, and many offer limit controls to manage result sizes. The server’s logging and statistics help you monitor usage, cache efficiency, and error rates in real time.

How to install

Prerequisites:

  • Node.js (LTS) and npm installed on your system
  • Internet access to fetch the MCP server package

Steps:

  1. Install prerequisites (if not already installed)
# verify node and npm
node -v
npm -v
  1. Install and run via npx (recommended as per MCP config)
# pull and run the MCP server package (non-interactive, -y confirms defaults)
npx -y shimizu-osm-geojson-mcp-server
  1. Alternative: install locally and run with npm
# install package locally
npm install shimizu-osm-geojson-mcp-server --save

# start server (adjust path if package exposes a CLI)
npm start
  1. Verify installation
# test connection and list available tools via MCP protocol or provided tests
node test/mcp-protocol-verification.js

Note: If your environment restricts npx or you want explicit control, you can instead run via a direct package invocation or build a small launcher around the MCP SDK, but the provided config prefers the npx approach for simplicity.

Additional notes

Tips and considerations:

  • Default cache TTL is 15 minutes; adjust via environment variable CACHE_TTL_MINUTES if supported by the build.
  • The MCP server implements multi-server fallback across up to 3 endpoints; ensure network connectivity to avoid failovers.
  • Use bounding box sizes of 0.005° × 0.005° or smaller for reliable performance in dense urban areas; very large boxes may timeout or be rate-limited by Overpass.
  • For heavy queries, leverage the limit parameter to cap results and avoid large memory usage.
  • Ensure appropriate User-Agent (OSM-MCP/1.0) is used to comply with Overpass rules; enable exponential backoff on 5xx responses.
  • When exporting to GeoJSON, ensure your output_path ends with .geojson or .json as supported by the tool.
  • Check MCP protocol tests (tests under test/) to validate protocol compliance after upgrade or config changes.

Related MCP Servers

Sponsor this space

Reach thousands of developers