Skip to content
MCP server

NYC Charter, Laws and Rules

Search and read the NYC Charter, Administrative Code and city Rules from an AI assistant

Runs locally
Install
Pricing
Free
Platforms
CLI
Runs
Locally
Version
0.5.0
Listing updated
4 days ago

Similar MCP servers

About NYC Charter, Laws and Rules

NYC Charter, Laws and Rules is a free MCP server for legal and government. It runs locally on your machine and is started by your AI client.

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.

Install

Run in a terminal

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

Add to claude_desktop_config.json

{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "nyc-charter-laws-rules": {
      "command": "npx",
      "args": [
        "-y",
        "@betanyc/nyc-charter-laws-rules"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

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

Add to ~/.codeium/windsurf/mcp_config.json

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

Add to your client's MCP settings (most use this shape)

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

Using several servers? Build one config file with the MCP config generator.

Configuration

  • NYC_LAWS_INDEX_DIROptional. Serve the index in this directory (laid out like data/index/json/) instead of the bundled one
  • NYC_CLR_FOOTEROptional. How much legal disclaimer each response carries: full-then-compact (default) or full

Tools this server provides (7)

Taken from the project documentation; the running server may differ.

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

What it does

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

Pricing

Free

No key required

NYC Charter, Laws and Rules 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.

How AIPoweredBot checks servers