mcp · cape town · open data
Query Cape Town's open data, from your LLM.
A Model Context Protocol server that turns the City of Cape Town Open Data Portal's ArcGIS Feature Service into LLM-callable tools — with layer discovery, a generic query escape hatch, spatial & attribute filtering, and in-memory caching.
Works with Claude Desktop, Claude Code, and any MCP-compatible host.
$ capetown-opendata-mcp mcp server ready · stdio · 11 tools · cache 5m › water_quality limit=3 SITE RESULT SAMPLED Zandvlei ok 2026-06 Milnerton Lagoon warn 2026-06 Camps Bay tidal ok 2026-06 → 3 features · next_offset=3
what you get
An MCP front door to the City's data service.
Wraps capetown-opendata and go-arcgis, so the Esri REST details stay out of your prompts.
Discovery
service_info and layer_info list and describe the 150+ published layers, their fields, geometry, and page size.
Generic query
query_layer is an escape hatch over any layer by ID — WHERE, field selection, ordering, bbox, count-only, and offset pagination.
Spatial & attribute filters
Combine SQL where, a bbox, or a polygon. Spatial filters are sent as WGS84, so they work against any projection.
In-memory caching
Responses are cached with a configurable TTL (default 5m) to spare the upstream service on repeated LLM calls.
stdio + HTTP
Speaks the MCP stdio transport by default, or streamable-HTTP for remote and containerized deployments.
One-click MCP Bundle
Every release ships signed .mcpb bundles per platform — open one in Claude Desktop to install, with settings for token, timeout & TTL.
eleven tools
Datasets, discovery, and a generic query.
load_shedding_blocks
Load shedding block polygons (block geometry and ID).
wards
Municipal ward boundaries (ward name, key, year).
land_parcels
Cadastral land parcels (erven); optional suburb filter.
taxi_routes
Registered minibus taxi routes.
water_quality
Inland water quality sampling results, newest first.
public_lighting
Public street lighting assets.
heritage_inventory
Heritage inventory sites and features.
query_layer
Generic query over any layer by ID — where / fields / order / bbox / offset / count-only.
field_values
List a field's distinct values to discover valid filter values.
service_info
List the service's layers and tables with IDs; name_contains filters the listing.
layer_info
Describe a layer's fields, geometry type, and page size.
Every feature-returning tool shares a filter set: limit (default 200, max 2000), offset, where, bbox, polygon, include_geometry, omit_nulls, and use_aliases. Layer IDs occasionally drift — use service_info / layer_info to find current IDs.
install
Four ways to get it.
One-click for Claude Desktop. Download the .mcpb matching your OS and architecture from the releases page, then open it with Claude Desktop.
capetown-opendata-mcp_<version>_darwin_arm64.mcpb
Browse releases → · The bundle's settings screen sets an optional ArcGIS token, request timeout, and cache TTL.
macOS & Linux, via the tap.
brew install richardwooding/tap/capetown-opendata-mcp
Multi-arch OCI image on GHCR — ideal for the HTTP transport.
docker run -i --rm ghcr.io/richardwooding/capetown-opendata-mcp:latest
Build from source with Go.
go install github.com/richardwooding/capetown-opendata-mcp@latest
usage
Point your MCP host at the binary.
Add it to your Claude Desktop / Claude Code config:
// claude config · mcpServers
{
"mcpServers": {
"capetown-opendata": {
"command": "capetown-opendata-mcp"
}
}
}
Or run the streamable-HTTP transport for remote deployments:
capetown-opendata-mcp --transport http --http-addr :8080
Every flag also reads from a CAPETOWN_MCP_ environment variable:
| Flag | Env | Default | Description |
|---|---|---|---|
| --transport | CAPETOWN_MCP_TRANSPORT | stdio | stdio or http. |
| --http-addr | CAPETOWN_MCP_HTTP_ADDR | :8080 | Listen address for the HTTP transport. |
| --timeout | CAPETOWN_MCP_TIMEOUT | 30s | Per-request upstream timeout. |
| --cache-ttl | CAPETOWN_MCP_CACHE_TTL | 5m | Response cache TTL (0 disables). |
| --arcgis-token | CAPETOWN_MCP_ARCGIS_TOKEN | — | Optional token for authenticated services. |