neurodock-mcp-guardrail
Clinical guardrails MCP server for NeuroDock. Detects three patterns that
unmodified LLM interaction tends to amplify for neurodivergent users:
rumination loops (OCD), unregulated hyperfocus (ADHD), and sycophancy /
over-validation. See ETHICS.md and MANIFESTO.md for the full framework.
Status
-
v0.0.2: All three detectors are live.
check_rumination— word-overlap Jaccard heuristic.check_hyperfocus— elapsed-threshold-with-end-of-day heuristic.check_sycophancy— four-pattern overlap heuristic.
Heuristics are public and auditable; thresholds are defaults, not prescriptions. See ADR 0006 for the rationale.
Tools
| Tool | Status | Heuristic | Default thresholds |
|---|---|---|---|
check_rumination |
live (v0.0.1) | word_overlap_jaccard |
window 90 min, count 3, similarity 0.55 |
check_hyperfocus |
live (v0.0.2) | elapsed_threshold_with_eod |
60 / 90 / 120 minutes |
check_sycophancy |
live (v0.0.2) | pattern overlap (4 patterns) | similarity 0.5 |
Design invariants
- Stateless. The server persists nothing — no SQLite, no JSONL, no in-memory caches that survive a call. Callers supply all history.
- No telemetry, no network sockets. Per
ETHICS.mdcommitment 4. - No user content in logs. Only
tool_invokedmetadata is logged. - Override-token vocabulary is closed at v0.1.0. New tokens require a minor bump and sign-off per ADR 0006 §3 and §10.
- Heuristics are auditable. Source for each heuristic lives in
src/neurodock_mcp_guardrail/heuristics/. Changes there require sign-off perETHICS.mdcommitment 3.
Usage
# Run the server over stdio (via the console script):
neurodock-mcp-guardrail
# Or smoke-test the build directly:
python -c "from neurodock_mcp_guardrail import server; print(server.app.name)"
Tests
uv run pytest packages/mcp-guardrail/tests/ -v
Tests cover:
- The Jaccard heuristic (identical, disjoint, stopword-only, paraphrase, case-insensitivity, punctuation handling).
- The
check_ruminationtool (empty history, in-window detection, out-of-window non-detection, threshold honour, override-token contract, history-ordering rejection, false-positive-feedback path). check_hyperfocus(escalation level mapping, end-of-day strictness, idle-signal handling, override-token contract, schema conformance).check_sycophancy(each of the four patterns, counter-prompt generation, override-token contract, schema conformance).- Protocol conformance: every tool response is validated against the
schema files in
schemas/.
License
AGPL-3.0-or-later.
Metadata
Release files for neurodock-mcp-guardrail 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| neurodock_mcp_guardrail-0.0.5.tar.gz | 41.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| neurodock_mcp_guardrail-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.2 kB
Release files / neurodock_mcp_guardrail-0.0.5.tar.gz
| Download URL | neurodock_mcp_guardrail-0.0.5.tar.gz |
|---|---|
| Size | 41.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f104e3ba9db15d5462f2ec6927d9d0a1ed55a4638fa8494821acccb782201ee8
|
|
BLAKE2b-256 checksum How to use checksums |
ab7a8a2543e5d59dcf1391aef3f623533694219fc4b9c7ab5d9cda101366b488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / neurodock_mcp_guardrail-0.0.5-py3-none-any.whl
| Download URL | neurodock_mcp_guardrail-0.0.5-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce70ed9320ddafc45bdb4c0d1140a669867b176615d64dd31d8e2805b4e68c88
|
|
BLAKE2b-256 checksum How to use checksums |
baad43573bf7cc78b08836e2ab57dca7dada0658edef3278142fbd744b516ae3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|