Use Case · AI Agents & Tool Use

AI Agents & MCP Tools

Open AI Agent & MCP Simulator
Replaces External geocoding APIs, hallucinated LLM coordinates

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 to geocode_nearby.
  • Self-checking address quality: Explicit match_level, unmatched_tokens, and conflicting_tokens let 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.txt and /openapi.json out of the box for autonomous agent integration.

Setup with Claude Desktop, Cursor, or Windsurf#

  1. 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).
  2. Add texspace to your MCP client configuration:
json
{
  "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 NameWhen the Agent Calls ItKey Arguments
geocode_searchFreeform addresses, landmarks, intersections, parcel APNs, typosquery, limit, profile, focus_lat, focus_lon
geocode_structuredFielded forms where city, street, and ZIP are already splithousenumber, street, unit, locality, region, postalcode, apn
geocode_reverseTurning (lat, lon) into a human-readable street address or landmarklat, lon, limit, radius_m
geocode_autocompleteCompleting partial address prefixesprefix, limit, focus_lat, focus_lon
geocode_nearbyProximity & directional queries ("within 2km of", "200m north of")query or (what, anchor/lat/lon, radius_m, direction)
geocode_batchGeocoding multiple locations in a single tool turnqueries[], limit, profile
geocode_geoipResolving an IPv4/IPv6 address to city, region, country & ASNip
geocode_timezoneChecking local time, UTC offset & Daylight Saving Time at (lat, lon)lat, lon, timestamp
index_infoChecking 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%:

bash
curl "https://api.texspace.dev/v1/search?text=2750+Middlefield+Rd,+Palo+Alto&format=compact"
json
{
  "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#