---
name: opendistrict
description: Query cited public records, enterprise systems, and personal context through the Open District MCP server. Read-only, audited, free.
---

# Open District

Data for AI that shows its work. Read-only MCP over Streamable HTTP. Every result row carries its source record; every call is written to an append-only audit log.

## Connect

```json
{
  "mcpServers": {
    "opendistrict": {
      "url": "https://mcp.opendistrict.org/mcp",
      "headers": { "Authorization": "Bearer $OD_API_KEY" }
    }
  }
}
```

Auth: Bearer token, scoped API key issued per tenant at https://app.opendistrict.org. For read-only
agent use mint exactly three scopes: `data:read`, `query:run`, `vectors:search`. (Those are real scope
strings — `POST /api/keys` rejects anything else with `400 invalid scope`; the seven valid values are
listed in https://opendistrict.org/agents.md.)

## Tools (10 — exact `tools/list` names)

`run_sql(sql)` · `vector_search(query, top_k?)` · `get_schema()` · `catalog()` · `unified_search(query, limit?, event_type?, source_id?, score_threshold?)` · `metrics()` · `list_sources()` · `list_pipelines()` · `get_topology()` · `entity_path(from, to)`

Full reference with parameter tables: https://opendistrict.org/agents.md

## First cited query

```
tool: run_sql
sql:  SELECT event_type, source_id, created_at,
             jsonExtractString(payload, 'title') AS title
      FROM events
      LIMIT 20
```

A bare `LIMIT n` returns the n most-recent rows (index-backed). Do **not** add
`ORDER BY created_at` — that ordering cannot be pushed down and forces a full-table sort.
`payload` is a JSON **string** column: read a field with `jsonExtractString(payload, 'key')`
and filter a key with `payload ILIKE '%\"key\"%'`. Never `payload->>'key'` or `payload::jsonb` —
DataFusion cannot plan those.

Queryable tables are exactly `events` / `pg_events` (Postgres), `ch_events` (ClickHouse) and
`audit_log`; everything else is rejected 403 by the read-only SQL gate. Call `get_schema` for
columns or `catalog` for curated descriptions and example SQL before writing a query.

Each returned row includes its source reference. Cite it.

## Scenarios

`prompts/list` exposes four canonical chains: follow-the-money, scan-the-courts, meeting-brief, thesis-watch. Machine manifest with citations: https://opendistrict.org/examples.yaml

## Rules

- The SQL gate is read-only; write statements are rejected.
- Never cite a row without its source reference.
- Free forever. Sign up at https://opendistrict.org/#signup
