Prototype · Preview: every server in the official registry, synced every 30 minutes. Reviews and accounts come in a later step.
PopNx MCPMCP servers for people who use AI · explained in plain words

chunk-invariance

by ninadphalakversion 0.2.0i★ –iRuns on your computer
Registry nameio.github.ninadphalak/chunk-invariance

Install

Overview

Description from the maker (original English)

Checks whether your streaming redactor leaks a secret split across chunks; writes a pytest for it.

PopNx MCP’s three pillars

These three are never merged into one score: opinions, measurements and popularity are different things.

What you can do with it

We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.

  • Connection: Runs on your computer
  • Transport: stdio
  • Category: Other

Install

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

Before you install

  • Basic checks: 1 of 1 passed
  • Runs on your computer with your user’s permissions (files, network, apps).
  • The registry lists no key to fill in.

You need

  • PyPIPython’s uv installed (for the uvx command)

Which app do you use?

Pick your app above. We remember it, so next time the button says “Install in …”.

Open Claude Desktop → Settings → Developer → Edit Config, and paste this into claude_desktop_config.json

{
  "mcpServers": {
    "chunk-invariance": {
      "command": "uvx",
      "args": [
        "chunk-invariance"
      ]
    }
  }
}

Run this in your terminal

claude mcp add chunk-invariance -- uvx chunk-invariance

Open in Cursor

Or copy the settings yourself

Paste into .cursor/mcp.json in your project, or ~/.cursor/mcp.json

{
  "mcpServers": {
    "chunk-invariance": {
      "command": "uvx",
      "args": [
        "chunk-invariance"
      ]
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

Open in VS Code

Or copy the settings yourself

Paste into .vscode/mcp.json in your project

{
  "servers": {
    "chunk-invariance": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "chunk-invariance"
      ]
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

This one runs on your computer, and ChatGPT can only connect to servers on the internet. Pick another app.

Your choice stays on this device in a cookie; no account needed.

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

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 7, 2026

  • ✓ Pass

    Maker matches the repo

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

  • … Not checked yet

    Still maintained

    We have not read this repo from GitHub yet

  • … Not checked yet

    Has a licence

    We have not read this repo from GitHub yet

  • – 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

Compared with others in Otheri

  • More stars than 0% of the other 32684 servers in this category
  • Published to the registry more recently than 66% of the other 32684 servers in this category
  • Basic checks equal to or better than 100% of the other 32684 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 chunk-invariance safe?

It passed 1 of 1 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 –, and the latest version (0.2.0) reached the registry 19 days ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: Spec Driven Development, Remote Desktop Commander, Master CSS

Alternatives

Servers in the same category from other makers, sorted by stars.

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

Spec Driven Development

by formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

Runs on your computer★ 440MITUpdated 14 months ago
Install

Remote Desktop Commander

by desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

Runs in the cloud★ 211Updated 2 days ago
Install

Master CSS

by master-co

Inspect Master CSS classes, generated CSS, and project stylesheets from your AI client.

Runs on your computerUpdated today
Install

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.

chunk-invariance

A streaming filter (a redactor, a guardrail, a rewriter) is correct only if, for every way of splitting an input into chunks, the concatenated streamed output equals the output of filtering the whole input at once. This package turns that rule into one assertion.

from chunk_invariance import assert_chunk_invariant

def redact(text): # your filter on the whole input return text.replace("sk-AbCd1234", "[KEY]")

def redact_stream(chunks): # your filter on a stream: takes chunks, yields chunks for chunk in chunks: yield redact(chunk) # redacts each chunk alone

def test_streaming_redaction(): assert_chunk_invariant(redact_stream, redact, "use sk-AbCd1234 now")

That test fails, and names the smallest split that breaks it:

chunk_invariance.core.ChunkInvarianceError: stream filter is not chunk-invariant

input: 'use sk-AbCd1234 now' split: ['use s', 'k-AbCd1234 now'] (cut at 5) whole: 'use [KEY] now' streamed: 'use sk-AbCd1234 now' split #6 in the order tried; generated splits run fewest parts first

pip install chunk-invariance

pip install "chunk-invariance[hypothesis]" # optional Hypothesis strategies pip install "chunk-invariance[mcp]" # optional MCP server for AI assistants

What it catches

  • A filter that evaluates each chunk alone, so a value cut across two chunks matches neither half.
  • A filter that prepends a fixed carryover from the previous chunk. The match fires, but the start of the value was already emitted with the previous chunk.
  • A hold-back that is shorter than the pattern, a missing end-of-stream flush, and output that is corrupted rather than leaked (any difference from the whole-input output fails).

chunk_invariance.examples has one correct filter (hold_back) and the two wrong designs (design_a, design_b) for the same pattern, as a worked comparison.

What it does not catch

It tests a filter you can call in-process. It does not test a running gateway, where the chunks are decided by an upstream model, a network and an SSE parser. For that, use pii-leak-benchmark, which sends fragmented responses through the gateway and checks what reaches the client.

It checks the splits you ask for. The default is the whole input plus every single cut, which catches a value cut in two. splits="all" tries every split of a short input (up to 16 characters); splits=3 tries every split into at most three parts; an explicit list of chunk lists runs exactly those. It cannot prove a filter correct for inputs you did not give it.

Use it from your AI assistant

Do you use Claude Code, Cursor or Claude Desktop? The package has an optional MCP server. With it you can ask the assistant to run the every-split check on your own streaming function, and then to add the test to your repo.

pip install "chunk-invariance[mcp]"      # Python 3.10 or later

claude mcp add chunk-invariance -- chunk-invariance-mcp

For Claude Desktop, add this to claude_desktop_config.json (give the full path to the command if Claude Desktop cannot find it on your PATH):

{

"mcpServers": { "chunk-invariance": { "command": "chunk-invariance-mcp" } } }

Then ask, for example: "Check whether redact_stream in myapp/filters.py leaks values split across chunks, and add a regression test for it."

There are three tools. check_stream_filter imports your function (myapp.filters:redact_stream), streams each sample through it in every two-part split and tells you which split broke it, for example that 'sk-AbCd1234' came out unredacted when the input was cut into 'use s' and 'k-AbCd1234 now'. write_regression_test returns a pytest file built on assert_chunk_invariant, so the check stays in your CI. explain is one paragraph on why per-chunk filtering leaks.

The default samples (an email, an SSN, a card number and a few API-key shapes) are all fake. Pass your own made-up samples in the formats your filter redacts, such as a key you typed yourself in your provider's format. A sample the filter does not change tests nothing, and the tool says so.

Never pass a real secret or real personal data as a sample. The samples, and any value your filter leaks, come back in the tool's result, and your assistant sends that result to its model provider like the rest of the conversation. So does the message of any exception your code raises, but nothing your code prints. The same samples also end up in the generated test file.

Checking a function runs your code. The server imports your module on your own machine, in a separate process that is stopped after a timeout (60 seconds by default). If your project has a .venv (or venv), that is the Python it uses; the python argument accepts only that interpreter or the server's own. The target, flush_target and whole_target must be Python functions defined in source files under project_dir: built-ins, the standard library and installed packages (anything in the interpreter's site-packages, including your .venv's) are refused, and so is a project_dir that is or contains the interpreter's own library. The check process gets a minimal environment (PATH, HOME, temp and locale variables), not the server's, so a filter that reads its configuration from other environment variables will not see them. project_dir is chosen by the assistant's tool call, so whatever code lives under it is what can run: approve calls only for your own project. The server itself makes no network calls, sends no telemetry and writes no files, though the code it runs can do whatever that code does. Saving the test file is up to you and your assistant.

API

NameDoes
assert_chunk_invariant(stream_filter, whole_filter, text, *, splits="all-two-part")Raises ChunkInvarianceError (an AssertionError) on the first failing split, fewest parts first. Returns the number of splits checked. Works on str and bytes.
assert_chunk_invariant_async(...)The same, for an async generator filter, inside an async test.
two_part_splits(text)Every split into two non-empty parts.
all_splits(text, max_parts=None)Every split into at most max_parts non-empty parts, the whole input first.
per_chunk(process, *, state=dict, flush=None)Adapts process(chunk, state) -> output and flush(state) -> output, with fresh state per stream.
from_async(async_stream_filter)Adapts an async generator filter for the synchronous assertion.
strategies.splits_of(text, max_parts=None)Hypothesis strategy: random splits of text, shrinking toward fewer cuts.
strategies.text_and_splits(texts, max_parts=None)Hypothesis strategy: (text, chunks) pairs. texts is itself a strategy, such as st.sampled_from([...]), not a list.

stream_filter is called once per split, so it must start from fresh state each time.

Background

The invariant and the two wrong designs are described in Phalak, N. (2026), *Split-Boundary Leaks in Streaming Guardrails*, Zenodo, 10.5281/zenodo.22909585.

Standard library only (the mcp extra adds the MCP SDK, for the server alone). Apache-2.0. A TypeScript version with the same API is published on npm as chunk-invariance.

Ask PopNx