# DistrictAPI

Gives your agent US school district and school lookups: find the district for an address, pull profiles, list schools, search nearby.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: DistrictAPI
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/DistrictAPI/districtapi-mcp
- Updated: 2026-10-04
- HTML: https://affpapa.org/en/nevibecode/mcp/districtapi

## What it does

Six tools come with the server. `lookup_district_by_address` resolves a US street address to its district, and `get_district` returns the full profile for an NCES LEA ID. Name-and-state search runs through `search_districts`. Schools are covered by `get_district_schools`, `get_school` (profile by NCES school ID) and `find_schools_near_address` for a radius search.

The package starts with `uvx districtapi-mcp`, so a local install is optional. An API key goes into `DISTRICTAPI_KEY`; districtapi.dev hands them out for free. Without the key the server has nothing to call the API with.

Configuration lives in your MCP client as a stdio command plus that environment variable. Listed clients include Claude, Codex, Cursor, GitHub Copilot, Windsurf, Cline, Zed and Gemini CLI. Keep the key in `env` rather than in command arguments, otherwise it lands in shell history.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `DISTRICTAPI_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add districtapi-mcp -e DISTRICTAPI_KEY=<DISTRICTAPI_KEY> -- uvx districtapi-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from districtapi-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add districtapi --env DISTRICTAPI_KEY=<DISTRICTAPI_KEY> -- uvx districtapi-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from districtapi-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "districtapi": {
            "command": "uvx",
            "args": [
                "districtapi-mcp"
            ],
            "env": {
                "DISTRICTAPI_KEY": "<DISTRICTAPI_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from districtapi-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "districtapi": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "districtapi-mcp"
            ],
            "env": {
                "DISTRICTAPI_KEY": "<DISTRICTAPI_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from districtapi-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DISTRICTAPI_KEY=<DISTRICTAPI_KEY> districtapi uvx districtapi-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from districtapi-mcp <command>

## When to use it
- resolve which US school district covers a given address
- read a district or school profile by NCES ID
- pull every school inside a district
- find schools within a radius of an address
- search districts by name in a specific state

## Example prompts
- Find schools near this address
- Show the district profile for this NCES LEA ID and list its schools

## Similar
- [Skolverket MCP](https://affpapa.org/en/nevibecode/mcp/skolverket-mcp.md) — MCP server · ★ 13
- [korean-elementary-learning-map-mcp](https://affpapa.org/en/nevibecode/mcp/korean-elementary-learning-map-mcp.md) — MCP server · ★ 14
- [check-understanding](https://affpapa.org/en/nevibecode/skills/check-understanding.md) — skill · 4500 installs
- [claude-certification](https://affpapa.org/en/nevibecode/skills/claude-certification.md) — skill · 3400 installs
- [openmaic-classroom](https://affpapa.org/en/nevibecode/skills/openmaic-classroom.md) — skill · 1400 installs
- [irac-practice](https://affpapa.org/en/nevibecode/skills/irac-practice.md) — skill · 612 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
