# NYC Charter, Laws and Rules

NYC Charter, Laws and Rules is an MCP server for Claude Code that gives an AI assistant access to New York City legal documents.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10 repo stars
- Author: BetaNYC
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/BetaNYC/nyc-charter-laws-rules
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/nyc-charter-laws-and-rules

## What it does

The server connects the official legal corpus of New York City, including the city charter, administrative code, and rules, directly to your AI assistant. Eight built-in tools let the model search keywords, retrieve sections by citation, and check document versions. The package runs without external API keys or accounts since the entire legal corpus is bundled locally.

All documents are packaged with the distribution, so no setup or environment variables are required to start querying. Regular updates are delivered through automated package releases whenever the underlying legal text changes.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NYC_LAWS_INDEX_DIR`, `NYC_CLR_FOOTER` — 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 --env NYC_LAWS_INDEX_DIR=<NYC_LAWS_INDEX_DIR> --env NYC_CLR_FOOTER=<NYC_CLR_FOOTER> --transport stdio nyc-charter-laws-and-rules -- npx -y @betanyc/nyc-charter-laws-rules
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add nyc-charter-laws-and-rules --env NYC_LAWS_INDEX_DIR=<NYC_LAWS_INDEX_DIR> --env NYC_CLR_FOOTER=<NYC_CLR_FOOTER> -- npx -y @betanyc/nyc-charter-laws-rules
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "nyc-charter-laws-and-rules": {
            "command": "npx",
            "args": [
                "-y",
                "@betanyc/nyc-charter-laws-rules"
            ],
            "env": {
                "NYC_LAWS_INDEX_DIR": "<NYC_LAWS_INDEX_DIR>",
                "NYC_CLR_FOOTER": "<NYC_CLR_FOOTER>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "nyc-charter-laws-and-rules": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@betanyc/nyc-charter-laws-rules"
            ],
            "env": {
                "NYC_LAWS_INDEX_DIR": "<NYC_LAWS_INDEX_DIR>",
                "NYC_CLR_FOOTER": "<NYC_CLR_FOOTER>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NYC_LAWS_INDEX_DIR=<NYC_LAWS_INDEX_DIR> -e NYC_CLR_FOOTER=<NYC_CLR_FOOTER> nyc-charter-laws-and-rules npx -y @betanyc/nyc-charter-laws-rules
```
Replace <…> with your own values

## When to use it
- search keywords across the city charter, administrative code, and rules
- retrieve a specific legal section by citation or chapter identifier
- check the currency date and version of the bundled legal corpus
- list top-level chapters and titles within each document

## Example prompts
- Search the NYC laws for open data rules
- Retrieve section § 259 using get_section
- Call get_version to check the currency of the legal texts

## Similar
- [charter](https://affpapa.org/en/nevibecode/skills/charter.md) — skill · ★ 869 repo stars
- [SubwayInfo NYC](https://affpapa.org/en/nevibecode/mcp/ckbk-subwayinfo-nyc.md) — MCP server · 3955 installs
- [NYC Budget](https://affpapa.org/en/nevibecode/mcp/nyc-budget.md) — MCP server · ★ 20 repo stars
- [NYC Council](https://affpapa.org/en/nevibecode/mcp/nyc-council.md) — MCP server · ★ 7 repo stars
- [nyc-property-intel](https://affpapa.org/en/nevibecode/mcp/nyc-property-intel.md) — MCP server · ★ 7 repo stars
- [context7](https://affpapa.org/en/nevibecode/skills/context7.md) — skill · 11400 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
