NeuroDock guardrail MCP server — rumination, hyperfocus, and sycophancy detection.
Project description
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 and ETHICS.md for the full framework.
Status
- v0.0.1 (Phase 2):
check_ruminationis implemented (word-overlap Jaccard).check_hyperfocusandcheck_sycophancyship as schema-only stubs; their runtimes returnDETECTOR_NOT_YET_IMPLEMENTEDuntil the Phase-3 endorses thresholds perdocs/decisions/0006-guardrail-tool-design.md.
Tools
| Tool | Status | Heuristic | Default thresholds |
|---|---|---|---|
check_rumination |
live | word_overlap_jaccard |
window 90 min, count 3, similarity 0.55 |
check_hyperfocus |
schema-only (Phase 3) | elapsed_threshold_with_eod |
60 / 90 / 120 minutes |
check_sycophancy |
schema-only (Phase 3) | four reserved heuristic names | tbd by |
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). - The two schema-only stubs (
DETECTOR_NOT_YET_IMPLEMENTEDis raised withphase: "3"metadata; input shape is validated against the locked v0.1.0 schema). - Protocol conformance: every tool response is validated against the
schema files in
schemas/.
License
AGPL-3.0-or-later.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neurodock_mcp_guardrail-0.0.2.tar.gz.
File metadata
- Download URL: neurodock_mcp_guardrail-0.0.2.tar.gz
- Upload date:
- Size: 33.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82e43ac80dc2d525b1664ad6170f1aad36cf0902e46452cf650624e230b07399
|
|
| MD5 |
421128a4f96276b406afce1c7536c1f1
|
|
| BLAKE2b-256 |
ba257a6ad1f93fe22325ea3f8344c8ab36fd456a7360fad9ee981ed2e5ebc584
|
File details
Details for the file neurodock_mcp_guardrail-0.0.2-py3-none-any.whl.
File metadata
- Download URL: neurodock_mcp_guardrail-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf3b3e92f5db7024b4b81e964d7e585185d6984826dc4edd8cdb256232008b68
|
|
| MD5 |
15e551c5c0e319efb5bf336dbe2a7844
|
|
| BLAKE2b-256 |
f02a4eeb3999fe00eba670d02ab59989ee1167ae4cd690dbd26d22d37dd0653f
|