Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

NYC Charter, Laws and Rules

by BetaNYCversion 0.5.0i★ 10iRuns on your computerRepository ↗
Registry nameio.github.BetaNYC/nyc-charter-laws-rules

How to install

What it does

Search and read the NYC Charter, Administrative Code and Rules of the City of New York

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Law & government data

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity19/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score31/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: 18 (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install NYC Charter, Laws and Rules. Follow https://mcp.popnx.com/i/betanyc-nyc-charter-laws-rules.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server NYC Charter, Laws and Rules for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "nyc-charter-laws-rules": { "command": "npx", "args": [ "-y", "@betanyc/nyc-charter-laws-rules" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the NYC Charter, Laws and Rules tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "nyc-charter-laws-rules": {
          "command": "npx",
          "args": [
            "-y",
            "@betanyc/nyc-charter-laws-rules"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use NYC Charter, Laws and Rules and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using NYC Charter, Laws and Rules or shows a NYC Charter, Laws and Rules tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

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

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect NYC Charter, Laws and Rules yet

NYC Charter, Laws and Rules runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect NYC Charter, Laws and Rules

  • Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)
  • Install Node.js on your computer first (one time)

B · Others in Law & government data that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server NYC Charter, Laws and Rules for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user nyc-charter-laws-rules -- npx -y @betanyc/nyc-charter-laws-rules 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the NYC Charter, Laws and Rules tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user nyc-charter-laws-rules -- npx -y @betanyc/nyc-charter-laws-rules
  4. Type /mcp in Claude Code

    You should see NYC Charter, Laws and Rules listed as connected

  5. Try it

    Use NYC Charter, Laws and Rules and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using NYC Charter, Laws and Rules or shows a NYC Charter, Laws and Rules tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

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

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server NYC Charter, Laws and Rules for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "nyc-charter-laws-rules": { "command": "npx", "args": [ "-y", "@betanyc/nyc-charter-laws-rules" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the NYC Charter, Laws and Rules tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use NYC Charter, Laws and Rules and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using NYC Charter, Laws and Rules or shows a NYC Charter, Laws and Rules tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

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

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Node.js on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server NYC Charter, Laws and Rules for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "nyc-charter-laws-rules": { "type": "stdio", "command": "npx", "args": [ "-y", "@betanyc/nyc-charter-laws-rules" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the NYC Charter, Laws and Rules tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install Node.js (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    node -v
    • A version number such as v26.13.1 = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed

    Open the Node.js download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v

    Install once; it works for everything that needs Node.js

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use NYC Charter, Laws and Rules and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using NYC Charter, Laws and Rules or shows a NYC Charter, Laws and Rules tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

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

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use NYC Charter, Laws and Rules💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

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

Claude Desktop (claude_desktop_config.json)

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

Cursor (~/.cursor/mcp.json)

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

VS Code (mcp.json)

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

Values you fill in

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

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
477/wk
Connection
Runs on your computer
Latest versioni
0.5.0
Published to registryi
Nov 14, 2026
Code last changedi
Nov 19, 2026
Maker
BetaNYC
Packages
npm: @betanyc/nyc-charter-laws-rules
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account BetaNYC, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed today

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for @betanyc/nyc-charter-laws-rules@0.5.0

Checks only this package version, not every dependency · checked Nov 15, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/betanyc-nyc-charter-laws-rules.svg)](https://mcp.popnx.com/en/servers/betanyc-nyc-charter-laws-rules)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Law & government datai

  • More stars than 98% of the other 1951 servers in this category
  • Published to the registry more recently than 87% of the other 1951 servers in this category
  • Basic checks equal to or better than 99% of the other 1951 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is NYC Charter, Laws and Rules safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed today, and the latest version (0.5.0) reached the registry 5 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.

What can I use instead?

In the same category: Global law, Open Legal Data (Germany), LibreJustice, InfraNode, Fedlex Connector

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Global law

The law of nearly every country on earth, any date: read it, see what changed it, check citations.

by lexifinaWidely used★ 2.1KUpdated 9 days ago

Runs in the cloud✓ lexifina.com

LibreJustice

Search French-language and European case law and French legal texts (codes, statutes, treaties).

by librejusticeEarly★ 36Updated 2 months ago

Runs in the cloud✓ service owner · librejustice.fr

InfraNode

Keyless open data for 84 German cities: 12 lean read-only MCP tools covering 67 data types.

by street1983nkEarly★ 18Updated 5 months ago

Runs in the cloud✓ service owner · infranode.dev

Fedlex Connector

Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.

by JayTheSkierEarly★ 8Updated 7 months ago

Runs in the cloud✓ service owner · fedlex-connector.ch
Compared with similar ones
This one
NYC Charter, Laws and Rules
Global lawOpen Legal Data (Germany)LibreJusticeInfraNodeFedlex Connector
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to install
Needs a keyNoNoNoNoNoNo
Add with + in ClaudeNoNoNoNoNoNo
Basic checks3/34/44/44/44/44/4
LicenseMITNOASSERTIONMITApache-2.0Apache-2.0MIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

nyc-charter-laws-rules

The single place to access, process, and query New York City's three primary legal documents:

  • The New York City Charter
  • The New York City Administrative Code
  • The Rules of the City of New York

This repo includes:

  • A [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server so AI assistants can query the documents directly
  • Scripts to fetch and parse the latest bulk XML from American Legal Publishing
  • A committed JSON index (data/index/json/) for machine use
  • A committed Markdown index (data/index/markdown/) for human browsing — readable directly on GitHub

Clone the repo and everything is ready to use. No setup required to browse or query the current index. Run npm run fetch-data && npm run build-index only when you want to refresh from AML.

Vibe coded with Claude by BetaNYC.

[What's changed](WHATS-CHANGED.md): new tools, corrections and other changes a reader would notice, newest first. Daily law text updates are in CHANGELOG.md.


API key

No API key is required. The Charter, Administrative Code, and Rules are served from an offline corpus bundled with the package, so this server works out of the box — no signup, no token, no environment variables to set.

The bundled text is as of the release. An npm install carries the law text from the day that version was published. When the daily refresh picks up new law text, it also publishes a new patch release automatically (see Releases), so the law text in npx -y @betanyc/nyc-charter-laws-rules is normally at most a day behind main's. Code changes ship with the next release. Automatic releases pause while a hand-bumped version is waiting to be published or a release run has failed. get_version reports the dates you are actually serving. To serve main's index directly, see Getting current law text.


What it does

Exposes 7 tools over MCP:

ToolDescription
searchKeyword search across all three documents (short keyword queries work best)
get_sectionRetrieve a specific section by citation (e.g. § 259, Chapter 11)
list_titlesList the top-level chapters or titles of a document
get_titleRetrieve all sections within a chapter or title
get_versionReturn the currency date for each document — so responses can be grounded in exactly how current the law is
whats_changedWhat changed in this server, newest first, from WHATS-CHANGED.md: new tools and corrections
about_betanycWho built this server, where its code is, and where to report a bug in this server or ask for a new feature

Tools reference

search

Keyword search across the NYC Charter, Administrative Code, and Rules. It is keyword matching, not a question-answering engine, so short keyword queries work best: sidewalk shed rather than "How long can a sidewalk shed stay up?"

  1. Phrase first. The whole query is matched as typed (case-insensitive). Quotes around the whole query, straight or curly, are removed first, so "open data" and open data search the same phrase. If any section contains it, those results are returned, relevance-ranked: heading matches rank above citation matches, which rank above body-text matches, and whole-word matches rank above substring matches.
  2. Terms, if the phrase finds nothing. Question words and common words (how, what, can, a, the, up, about, …) are dropped. The full list is SEARCH_STOPWORDS in src/corpus.ts. Each remaining term matches at the start of a word, with a trailing plural s ignored, so tanks finds "tank" and shed does not find "established". Sections are ranked by how many terms they contain, then by the same heading > citation > body weights.
  3. Said out loud. When step 2 runs, the first line of the response says so and lists the terms:
  • every result contains every term: No section contains the exact query; showing sections containing all of: building, owners, required, drinking, water, tanks.
  • partial matches were added: No section matched every term; showing sections matching some of: …, or Only 1 section matched every term (listed first); the rest match some of: long, sidewalk, shed, stay.

There is no term weighting yet, so a long definitions section that contains every word can outrank the section you want. Ranked full-text search is a separate, later change.

ParameterTypeRequiredDefaultDescription
querystringyes—Search term or phrase
corpusstringnoallcharter, admin_code, rules, or all
limitnumberno10Max results (max 50)
search("open data")

search("landlord inspection", corpus="admin_code", limit=20) search("board of health", corpus="rules") search("How long can a sidewalk shed stay up?") # term fallback; first line says so


get_section

Retrieve a specific section by citation or heading fragment. Input is normalized (with or without §, any case, extra whitespace). If the same citation exists in more than one document (e.g. charter Chapter 3 vs a rules chapter, or a rules section number repeated across titles), a disambiguation list is returned — re-run with the corpus parameter.

ParameterTypeRequiredDescription
citationstringyesSection citation or heading (e.g. § 259, Section 20-f, 11-602.1, Chapter 11)
corpusstringnocharter, admin_code, or rules (default: all three)
get_section("§ 259")

get_section("11-602.1") get_section("Chapter 11", corpus="charter")


list_titles

List the top-level chapters or titles of a document.

ParameterTypeRequiredDescription
corpusstringyescharter, admin_code, or rules
list_titles("charter")

list_titles("rules")


get_title

Retrieve chapter/title records matching an identifier. Matching is whole-token (Chapter 1 does not match Chapter 10). Note: the index is flat — deep hierarchy (every section nested within a title) is not indexed, so this returns matching chapter/title-level records, not full title contents. Title-level indexing is a tracked future feature.

ParameterTypeRequiredDescription
corpusstringyescharter, admin_code, or rules
titlestringyesChapter or title identifier (e.g. Chapter 11)
get_title("charter", "Chapter 11")

get_title("admin_code", "Title 6")


get_version

Return the currency date for each document. Each corpus updates on its own schedule — the Charter and Administrative Code track enacted local laws, while the Rules update independently as agencies adopt new rules.

No parameters required.

get_version()

Example response:

NYC Charter:           Current through Local Law 2026/112, enacted June 19, 2026, (854 sections; indexed 2026-06-29T12:33:00.864Z)

Administrative Code: Current through Local Law 2026/112, enacted June 19, 2026, (12587 sections; indexed 2026-06-29T12:33:09.801Z) Rules of NYC: Current through rules effective July 1, 2026. (8671 sections; indexed 2026-07-01T12:43:45.635Z)


whats_changed

What changed in this server, newest first, from WHATS-CHANGED.md, which ships with the package. Covers new tools, corrections and other changes a reader would notice; daily law text updates are not listed (see CHANGELOG.md). Corrections say what to re-check if you used the old answer. Returns text plus structuredContent matching the tool's outputSchema.

ParameterTypeRequiredDescription
sincestringnoYYYY-MM-DD: changes on or after this date
tagstringnoSite, Data, MCP or Correction (any case)
limitintegerno1 to 50, default 10
whats_changed()

whats_changed(tag="Correction")


about_betanyc

Who built the server (BetaNYC, a project of the Fund for the City of New York), its version and repository, where to report a bug in this server or ask for a new feature, and links to BetaNYC. No parameters.

whats_changed and about_betanyc are the two tools BetaNYC is adding to each of its MCP servers. src/betanyc-tools.ts is a copy of the canonical file in BetaNYC's workspace; never edit the copy. Their text ends with the one-line disclaimer (the full one with NYC_CLR_FOOTER=full), and they do not use up the full footer meant for the first law answer.


Testing and CI

Running tests
npm test

npm test builds the TypeScript source first (pretest script), then runs the full suite with node --test. Every test file in the table below runs together. On a laptop the whole run, build included, takes about 4 seconds (measured October 2026).

Test layers
FileWhat it covers
test/extract-text.test.jsUnit tests for the extractText, normalize, childrenByTag, getAttr, and tagOf helpers in scripts/lib/extract-text.js. Covers inline-LINK document order (issue #3 regression), entity decoding, ALP-marker stripping, enumeration-marker repair, empty/self-closing elements, deep nesting, whitespace-only text nodes, and helper edge cases.
test/content-leak.test.jsRegression tests for the content-leak fix (PR-A0): undecoded   nbsp entities, [ALP S-xxx] editorial markers, and leading-digit run-ons (1Each). Includes scope guards confirming that inline labels with no after them in the source ((6)the) are left untouched.
test/corpus-invariants.test.jsInvariant assertions over the committed data/index/json/*.json (every section across charter, admin\_code, and rules). Asserts: no run-together text, no subdivision label fused to the next word (a.There, issue #27), no leaked XML tags, no undecoded entities, no double spaces, no leading/trailing whitespace, and structural integrity against versions.json counts. Collects all violations before asserting, with corpus/id/citation/snippet in the failure message.
test/mcp-tools.test.jsIn-process tests for the MCP handler functions (searchCorpus, getSection, listTitles, getTitle, getVersions) imported from dist/corpus.js. Grounded in real index data: verifies § 292 text content (the issue-#3 corrected phrase), negative lookups, version presence, and title listing.
test/search-fallback.test.jsPlain-language questions (issue #30). Unit tests for stopword and question-word stripping (queryTerms) and surrounding-quote removal (stripSurroundingQuotes). Exact ranks, counts and first-line notices run against a synthetic 8-section index committed at test/fixtures/search-index/, served through NYC_LAWS_INDEX_DIR in a child process: ranking by terms matched, word-start matching (shed is not found in "established"), plural s, the all-terms and widened notices, phrase results unchanged, quoted queries matched as phrases. Against the real index only behavior is checked (fallback used, notice first, terms listed, results non-empty), so a daily refresh cannot turn it red.
test/index-dir.test.jsThe NYC_LAWS_INDEX_DIR override (issue #26), each case in a child process: unset and blank serve the bundled index; a set directory serves its versions and section text; relative paths resolve against the working directory; a directory without versions.json fails at startup naming the variable, with no silent fallback. Also starts the server over stdio and checks that serverInfo.version matches package.json and that get_version reports the override.

| test/footer-modes.test.js | Disclaimer footer modes (issue #25). NYC_CLR_FOOTER parsing (unset, blan

Only the beginning is shown; read the rest in the repo