Releases: ni-c/mcp-tool-allowlist
Release list
v0.2.2
Changed
- Source maps are no longer published in the npm tarball. Node reads them only
under--enable-source-maps, which nothing here sets, and the maps pointed at
asrc/this package does not ship — so a stack trace under that flag named a
file nobody could open.dist/**/*.jsis unchanged; the package is about a
fifth smaller. - oxlint's
suspiciouscategory is on; 7 findings fixed (mostly
Array#toSorted()over copy-and-sort and un-shadowed names). No runtime
behaviour changed.
v0.2.1
Fixed
-
The "nothing is left" error blamed the gate whenever a pattern had been
suppressed, even when the deny list was what emptied the selection. The
wording was wrong twice over: the allow list had named a registered tool, and
the only remedy the message offers is to unset the gate variable — which
registers the write tools the gate was closed for. Following it turned a
server that refuses to start into a read-only deployment serving its writes.
The gate is now named only when nothing survived it before the deny list ran. -
Entries keep the case they were written in. They were lowercased on the way
in, which handeddescribeEntrya mixed-case credential as lowercase hex —
passing the charset half of the redaction. Combined with a catalogue whose
longest tool name is 32 characters, a 32-character API key was inside the
length limit too, and both halves let it through into the error message.
Matching stays case-insensitive; only the value the message sees changed.
Added
buildToolFiltervalidates the catalogue it is given: a name inessential
orungatedthat is not inallis now aToolFilterErrornaming it.all
is what every entry is resolved against, so a name outside it can never be
selected — a strayessentialmember drops out of the preset in silence, and
a strayungatedmember is contradictory (registered while the gate is
closed, fatal to name in the allow list). Seventeen servers assert this in
their own suites; it belongs at the one place that depends on it.
Changed
- The JSDoc for
Catalogue.ungatedsaid "omitted means the gate never closes
anything". The code doescatalogue.ungated ?? [], so omitting it means a
closed gate suppresses everything — the server then refuses to start. The
code is right (fail-closed) and the comment was the outlier.
v0.2.0
Changed
-
The error for "the gate left nothing registered" now names the switch as well
as its wording — it ends… suppresses, but THING_READ_ONLY is set …where it
previously stopped at the wording.Found while migrating the first server off its own copy, whose message had
always named the variable. It is the more severe of the two gate errors — the
server does not start at all — and it was the less actionable one, while the
milder "you named a suppressed tool" already said which variable to unset.Minor rather than patch because the text is what callers assert on.
v0.1.0
First release. Extracted from the ALLOW_TOOLS/DENY_TOOLS implementation that
had been copied across seventeen MCP servers, where nine copies were byte-identical
and the rest differed only in additive modes.
Added
buildToolFilter— reads the two variables against a catalogue the server
declares, and refuses an entry that names nothing rather than silently
dropping a tool fromtools/list.installToolFilter— wrapsregisterTool, so registration code does not
change and an unset filter costs nothing.describeEntry— quotes a rejected entry back only while it is
tool-name-shaped, so a credential pasted into the wrong compose line does not
reach the client's log. The length limit is derived from the catalogue rather
than configured; a hand-picked number would have redacted one server's own
longest tool name.- The
gateoption, generalisingREAD_ONLYandALLOW_SENDinto one
mechanism: the suppressed half stays in the catalogue, so a name from it is
answered with "the gate suppresses it" rather than "no such tool".