Skip to content
Cape Town Open Data

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
$ 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.

file capetown-opendata-mcp_<version>_darwin_arm64.mcpb

Browse releases → · The bundle's settings screen sets an optional ArcGIS token, request timeout, and cache TTL.

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:

http capetown-opendata-mcp --transport http --http-addr :8080

Every flag also reads from a CAPETOWN_MCP_ environment variable:

FlagEnvDefaultDescription
--transportCAPETOWN_MCP_TRANSPORTstdiostdio or http.
--http-addrCAPETOWN_MCP_HTTP_ADDR:8080Listen address for the HTTP transport.
--timeoutCAPETOWN_MCP_TIMEOUT30sPer-request upstream timeout.
--cache-ttlCAPETOWN_MCP_CACHE_TTL5mResponse cache TTL (0 disables).
--arcgis-tokenCAPETOWN_MCP_ARCGIS_TOKENOptional token for authenticated services.