AI Agents & MCP Tools
Language models are great at understanding messy user prompts ("Find hospitals within 3 km of SFO" or "Verify this customer's shipping address before issuing a refund"), but terrible at remembering real-world coordinates, postal boundaries, or Daylight Saving Time rules. Calling standard GeoJSON APIs from an agent also wastes thousands of context tokens on deeply nested geometry wrappers.
texspace ships a native Model Context Protocol (MCP) server (texspace mcp) plus a compact REST mode (?format=compact) built specifically for AI agents. Every response strips boilerplate by ~70% and returns explicit match_level, confidence, and conflicting_tokens fields so your agent knows immediately whether to trust a coordinate or ask the user a clarifying question.
What this solves#
- Zero coordinate hallucination: Ground LLM answers in 450M+ verified rooftops, landmarks, transit stations, and boundaries running locally in milliseconds.
- Plain-English proximity queries: Agents can pass natural questions like
"hospitals within 2km of SFO"or"200m north of Market and Castro, SF"directly togeocode_nearby. - Self-checking address quality: Explicit
match_level,unmatched_tokens, andconflicting_tokenslet agents detect bad addresses (like a mismatched city and ZIP) and ask the user to confirm. - Automatic tool & API discovery: Self-hosted servers expose
/llms.txtand/openapi.jsonout of the box for autonomous agent integration.
Setup with Claude Desktop, Cursor, or Windsurf#
- Install the CLI (
cargo install texspace) and pull a regional shard or the full planet (texspace pull us_ca --with-geoip --with-tz -o /path/to/texspace_data). - Add
texspaceto your MCP client configuration:
{
"mcpServers": {
"texspace": {
"command": "texspace",
"args": ["mcp", "--db", "/path/to/texspace_data"]
}
}
}You can also mount private overlay databases (for example, your company's stores or customer sites) by passing --overlay /path/to/depots.db in args.
All 9 Built-In MCP Tools#
Every tool is read-only and returns compact, structured JSON:
| Tool Name | When the Agent Calls It | Key Arguments |
|---|---|---|
geocode_search | Freeform addresses, landmarks, intersections, parcel APNs, typos | query, limit, profile, focus_lat, focus_lon |
geocode_structured | Fielded forms where city, street, and ZIP are already split | housenumber, street, unit, locality, region, postalcode, apn |
geocode_reverse | Turning (lat, lon) into a human-readable street address or landmark | lat, lon, limit, radius_m |
geocode_autocomplete | Completing partial address prefixes | prefix, limit, focus_lat, focus_lon |
geocode_nearby | Proximity & directional queries ("within 2km of", "200m north of") | query or (what, anchor/lat/lon, radius_m, direction) |
geocode_batch | Geocoding multiple locations in a single tool turn | queries[], limit, profile |
geocode_geoip | Resolving an IPv4/IPv6 address to city, region, country & ASN | ip |
geocode_timezone | Checking local time, UTC offset & Daylight Saving Time at (lat, lon) | lat, lon, timestamp |
index_info | Checking which regions, shards, and overlays are currently mounted | (none) |
Compact Mode for Custom LLM Pipelines (?format=compact)#
If your agent calls the HTTP API instead of stdio MCP, append ?format=compact to any endpoint (/v1/search, /v1/reverse, /v1/autocomplete, /v1/nearby) to cut response size by ~70%:
curl "https://api.texspace.dev/v1/search?text=2750+Middlefield+Rd,+Palo+Alto&format=compact"{
"query": "2750 Middlefield Rd, Palo Alto",
"count": 1,
"results": [
{
"label": "2750 Middlefield Road, Palo Alto, 94306, California",
"lat": 37.4342,
"lon": -122.1325,
"match_level": "rooftop",
"confidence": 0.96,
"conflicting_tokens": []
}
]
}Go Deeper#
- HTTP REST API Reference — Every endpoint, ranking profile (
delivery,real_estate,emergency), and/llms.txt. - CLI Reference — Running
texspace mcpandtexspace serve. - Address Search, Typo Handling & Verification — Understanding
match_level,confidence, andconflicting_tokens.