# NYC Charter, Laws and Rules

> NYC Charter, Laws and Rules is a free MCP server for legal and government. Search and read the NYC Charter, Administrative Code and city Rules from an AI assistant. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI
- **Repository:** https://github.com/betanyc/nyc-charter-laws-rules
- **MCP Registry name:** io.github.BetaNYC/nyc-charter-laws-rules
- **Categories:** [legal and government](https://ai-powered.com/categories/legal-and-government)
- **Listing updated:** 2026-11-15

## About

Everything is served from an offline index bundled with the npm package, so there is no key, signup or network call for lookups. The index covers 854 Charter sections, 12,587 Administrative Code sections and 8,671 Rules sections in the README example, and `get_version` reports exactly how current each document is. A daily refresh publishes a new patch release when law text changes.

Search is keyword-based, not question answering. It tries the whole phrase first, ranking heading matches above citation and body matches, then falls back to individual terms and says so on the first line of the response. The README admits there is no term weighting yet, so a long definitions section can outrank the section you want.

BetaNYC built it with Claude and says responses carry a legal disclaimer, shown in full once then compact. Setting `NYC_LAWS_INDEX_DIR` serves a fresher index from disk.

## Features

- **Three documents, one index:** Charter, Administrative Code and Rules of the City of New York.
- **Citation lookup:** Fetch a section by citation such as § 259 or 11-602.1.
- **Phrase-first search:** Falls back to term matching and tells you when it did.
- **Currency dates:** Reports how current each corpus is.
- **Works offline:** The index ships with the package; no API key needed.

## Good for

- Find the section that governs sidewalk sheds
- Pull the exact text of an Administrative Code section
- Cite Charter chapters in a policy memo
- Check when each legal corpus was last updated

## Install

### Claude Code (Terminal)

```sh
claude mcp add nyc-charter-laws-rules -- npx -y @betanyc/nyc-charter-laws-rules
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "nyc-charter-laws-rules": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
```

## Tools

- `search`: Keyword search across all three documents
- `get_section`: Retrieve a section by citation
- `list_titles`: List top-level chapters or titles
- `get_title`: Get chapter or title records
- `get_version`: Currency date for each document
- `whats_changed`: Server changes, newest first
- `about_betanyc`: Who built the server and where to report issues

## FAQ

### Do I need an API key?

No. The corpus is bundled with the package.

### How current is the law text?

Each release carries the text as of its publish date, and get_version shows the dates.

### Can I ask full questions?

Short keyword queries work best; long questions fall back to term matching.

### Can it list a whole title's sections?

Not yet. The index is flat, so get_title returns chapter or title-level records.

### Is NYC Charter, Laws and Rules free?

Yes. NYC Charter, Laws and Rules is free to use.

### How do I add NYC Charter, Laws and Rules to Claude Code?

Run this command in your terminal: claude mcp add nyc-charter-laws-rules -- npx -y @betanyc/nyc-charter-laws-rules

### What are the best alternatives to NYC Charter, Laws and Rules?

The closest alternatives to NYC Charter, Laws and Rules are NYS Open Legislation, NYC 311, ComplyEdge TrustLint: offline AI law checks, TwinEthos Lite and Lawstronaut.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [NYS Open Legislation](https://ai-powered.com/mcp/nys-open-legislation): NYS Open Legislation is a free MCP server for legal and government.
- [NYC 311](https://ai-powered.com/mcp/nyc-311): NYC 311 is an open-source MCP server for legal and government.
- [ComplyEdge TrustLint: offline AI law checks](https://ai-powered.com/mcp/complyedge-trustlint-offline-ai-law-checks): ComplyEdge TrustLint: offline AI law checks is an open-source MCP server for legal and government.
- [TwinEthos Lite](https://ai-powered.com/mcp/twinethos-lite): TwinEthos Lite is a free MCP server for legal and government.
- [Lawstronaut](https://ai-powered.com/mcp/lawstronaut): Lawstronaut is a paid MCP server for legal and government.
- [LexAtlas](https://ai-powered.com/mcp/lexatlas): LexAtlas is a freemium MCP server for legal and government.
- [US Code Federal Statutes](https://ai-powered.com/mcp/us-code-federal-statutes): US Code Federal Statutes is a free MCP server for legal and government.
- [Global law](https://ai-powered.com/mcp/global-law): Global law is an open-source MCP server for legal and government.

---
Source: https://ai-powered.com/mcp/nyc-charter-laws-and-rules
