Documentation / Geospatial tools for agents
Geospatial tools for agents
Query OpenStreetMap, search places, build maps, calculate routes and read weather data through one remote MCP connection and subscription key.
On this page
Connect a client
Add Mapsource directly as a remote MCP server when your client supports Streamable HTTP and secret transport headers.
Loading MCP tools…
Configure the header using your client’s secret storage. Client-specific environment substitution differs; a literal $MAPSOURCE_API_KEY string is not automatically expanded by every client. Mapsource subscription authentication is a Bearer key, not an OAuth sign-in flow.
The MCP endpoint is https://api.mapsource.io/mcp. Agents calling REST directly use the same host, for example https://api.mapsource.io/interpreter; an /api prefix also works.
For stdio-first clients, use the official local adapter. It reads the key from the process environment, forwards calls to the hosted service over HTTPS, and discovers the live tool list when it connects.
npm i mapsource-mcp{
"mcpServers": {
"mapsource": {
"command": "npx",
"args": ["-y", "mapsource-mcp"],
"env": { "MAPSOURCE_API_KEY": "your-key-from-secret-storage" }
}
}
}Keep credentials out of the MCP URL and client configuration files committed to source control.
TypeScript SDK example
Install @modelcontextprotocol/sdk. This Node.js example connects to the server, lists available tools, and requests service status.
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const key = process.env.MAPSOURCE_API_KEY;
if (!key) throw new Error("Set MAPSOURCE_API_KEY securely");
const client = new Client({ name: "my-mapsource-client", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(
new URL("https://mapsource.io/mcp"),
{ requestInit: { headers: { Authorization: "Bearer " + key } } }
);
try {
await client.connect(transport);
const tools = await client.listTools();
console.log(tools.tools.map(tool => tool.name));
const status = await client.callTool({ name: "service_status", arguments: {} });
console.log(status.content);
} finally {
await client.close();
}Tools and inputs
| Tool | Operations | Description |
|---|---|---|
geo_analyze | analyze, pipeline, result | Spatial measurements, geometry operations, and multi-step pipelines with result-handle support. |
geo_data | basemaps, contours, elevation, metrics, status, terrain, usage | Operational and terrain data: service state and freshness, basemap catalogue, elevation, contours, usage and metrics. |
geo_jobs | cancel, list, status, submit | Submit a durable Overpass job; List this key's Overpass jobs; Inspect an Overpass job; Cancel an Overpass job |
geo_navigate | isochrone, map_match, matrix, optimize, route, snap | Routing, travel-time matrices, isochrones, GPS trace matching, snapping, and stop-order optimization. |
geo_render | static | Static PNG maps with geometry overlays, style information, and source dataset metadata. |
geo_search | autocomplete, details, discover, entity, geocode, lookup, nearby, overpass, resolve, reverse, search | Place search, autocomplete, nearby features, reverse geocoding, OSM object lookup, and entity resolution. |
geo_style | delete, diff, explain, fonts, intent, list, preview, revisions, save, schema, upload_font | Style schemas, semantic layer properties, compilation, saved profiles, and revision management. |
geo_weather | alerts, asset_metadata, assets, catalog, forecast, inventory, model, models, run, runs, source, sources, status, variables | Read the weather service catalog and delivery capabilities; List source families and their concrete redistribution approvals; Inspect a source family's eligibility and approved products; Read the reference variable dictionary without assuming model availability; Read measured per-source weather availability and observation ages; List forecast and analysis model products; Inspect a native weather model product; Discover native source run directories for a date; List source prefixes and assets within a discovered run; Read actual native GRIB message index fields and byte ranges; Discover native objects under an approved product prefix; Validate native asset format and pin its source version; Read the native NWS forecast for a supported U.S. point; Read native active NWS alerts for an area or point |
Select an action with the operation argument. Use tools/list or the server card for tool input schemas. The API reference lists related REST endpoints and access requirements.
Direct tools are also available for individual queries:
| Tool | Description |
|---|---|
service_status | Read Overpass engine readiness, dataset timestamp, billing and payment mode. Free; use geo_data with operation status for the full subsystem report. |
basemap_catalog | Read raster and vector tile templates, source zoom ranges and attribution. The catalog is free; tile requests require a subscription key. |
elevation | Sample surface elevation at latitude and longitude, including the raw elevation reading and bathymetry tile reference. Requires a subscription key. |
find_features | Find mapped features by category within an ordered bounding box at most 0.5 degrees per axis. Returns OSM geometry and tags, with a limit of 1 to 500 objects. Requires a subscription key or approved x402 payment. |
route | Compute a route between 2 to 10 waypoints, with maneuver instructions and an optional terrain elevation profile. Requires a subscription key. |
isochrone | Compute reachable-area polygons from one coordinate for up to four travel-time bands. Requires a subscription key. |
overpass_query | Execute a bounded Overpass QL query over OSM nodes, ways, relations, tags and geometry. Requires a subscription key or approved x402 payment; historical attic queries are not supported. |
Use local lookup for a search bar or routing destination picker. Provide the current map/GPS coordinates as a bias. Do not select a destination automatically when the response reports ambiguity.
await client.callTool({
name: "geo_search",
arguments: { operation: "lookup", q: "Starbucks", lat: 45.52, lon: -122.68, limit: 8 }
});
// Businesses reachable within 15 minutes on foot, ordered by travel time.
await client.callTool({
name: "geo_search",
arguments: {
operation: "discover", category: "coffee",
lat: 45.52, lon: -122.68, minutes: 15,
costing: "pedestrian", rankBy: "travel_time", limit: 8
}
});Discovery combines the local OSM query engine, polygon filtering and navigation services. It can also consume an existing isochrone in region. Read regional limits and pagination before enumerating a large area.
Use lookup for new address, business and brand integrations; geocode retains the older provider-backed response format. Lookup and discovery are included in all subscription plans. They require a subscription key; paying for an Overpass query with x402 does not unlock search. See shared quota accounting for internal Overpass, isochrone and matrix calls.
await client.callTool({
name: "geo_search",
arguments: {
operation: "nearby",
lat: 47.6062, lon: -122.3321,
category: "cafe", radius: 800, limit: 25
}
});Supported tools return large results as handles containing an ID, count, and bounding box. Pass the handle to subsequent operations or retrieve its payload when needed. See result handles for expiry and storage limits.
Weather and environmental data
Use geo_weather to discover approved environmental products and read native U.S. forecasts or active weather alerts. The catalog describes coverage, source rights and the formats each product can deliver.
await client.callTool({ name: "geo_weather", arguments: { operation: "catalog" } });
await client.callTool({
name: "geo_weather",
arguments: { operation: "forecast", lat: 40.7128, lon: -74.0060 }
});Download native model files through the REST asset endpoints using their version and byte-range headers. Aurora JSON and fire-detection CSV use the REST snapshot endpoint. Keep large source files out of the model context and use a compatible decoder for scientific grids. See the weather and environmental API guide and live weather examples.
Background jobs without large model responses
Use geo_jobs to submit JSON Overpass work and inspect compact metadata. Its operations are submit, list, status and cancel. Save the idempotency key before the first attempt and reuse it for retries of the same input.
const idempotencyKey = crypto.randomUUID(); // Persist before submitting.
await client.callTool({
name: "geo_jobs",
arguments: {
operation: "submit", idempotencyKey,
data: '[out:json];nwr["amenity"="cafe"](47.60,-122.34,47.62,-122.31);out geom 100;'
}
});
// Set jobId to the id returned by submission; respect Retry-After when polling.
await client.callTool({ name: "geo_jobs", arguments: { operation: "status", id: jobId } });One newly accepted job uses one request from the subscription allowance even if execution fails or you cancel it. Idempotent retries, internal execution retries, status, listing, cancellation and downloads do not add another request charge. Background jobs require a subscription key and its discovery scope; x402 query payment does not grant job access.
A successful job returns result metadata including its byte count, SHA-256 digest, expiry and authenticated download URL. Download that URL directly into the application or a file using the same key. Result bytes are deliberately not returned by geo_jobs or inserted into the model context. See the REST download example and background limits.
Results and quota
Use geo_data with operation: "status" to check subsystem availability and the OpenStreetMap dataset timestamp.
Check isError before processing a tool response. Direct Overpass queries return text content with response metadata in structuredContent. Set spatial filters and output limits, and allow for result handles in place of large inline responses.
MCP and REST requests share subscription limits. Read current totals with geo_data, operation: "usage", or GET /usage. Apply a per-task call budget and stop when the quota is exhausted.
x402 query payments
x402 supports per-query USDC payments on Base mainnet (eip155:8453) without a subscription. The returned payment requirement specifies the network, asset, recipient, and price. Check payment availability before submitting a paid request.
Each verified payer wallet has 1,800 requests per minute and 24 concurrent queries, shared across paid REST and MCP calls, not across other wallets. Query execution bounds remain those of Developer; each successful query is paid separately with no monthly request allowance.
curl --include "https://api.mapsource.io/x402/interpreter" \
-H "Content-Type: application/json" \
--data '{"query":"[out:json][timeout:30];node(1);out;"}'The initial REST response is HTTP 402 with PAYMENT-REQUIRED and Bazaar input/output metadata. A compatible client signs an approved payment and retries with PAYMENT-SIGNATURE. Successful settlement provides PAYMENT-RESPONSE. The paid REST route requires JSON Overpass output.
Save the transaction hash from the settlement receipt for payment support. A query payment does not create a subscription, issue an API key, or renew automatically. Anonymous MCP calls to overpass_query and find_features use the same payment flow; their receipts are returned in _meta["x402/payment-response"].
Authorize the network, amount, and total task budget before signing. An unpaid challenge does not charge the wallet. Check settlement status before retrying a signed payment.
If the agent has no compatible authorized wallet, direct the user to subscription signup and request the resulting API key through a secret or environment variable. Tiles and elevation require a subscription; query payment does not unlock them.
Examples and discovery
See the Mapsource geospatial MCP server overview and the OpenStreetMap place and feature search guide.
- Compact agent contract and full machine-readable guide.
- MCP server card, OpenAPI specification, and Markdown agent guide.
- TypeScript, Python, and map examples for amenities, footprints, basemaps, and elevation.
Questions about this guide? .