Skip to main content

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_rumination is implemented (word-overlap Jaccard). check_hyperfocus and check_sycophancy ship as schema-only stubs; their runtimes return DETECTOR_NOT_YET_IMPLEMENTED until the Phase-3 endorses thresholds per docs/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.md commitment 4.
  • No user content in logs. Only tool_invoked metadata 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 per ETHICS.md commitment 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_rumination tool (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_IMPLEMENTED is raised with phase: "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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurodock_mcp_guardrail-0.0.2.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurodock_mcp_guardrail-0.0.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

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

Hashes for neurodock_mcp_guardrail-0.0.2.tar.gz
Algorithm Hash digest
SHA256 82e43ac80dc2d525b1664ad6170f1aad36cf0902e46452cf650624e230b07399
MD5 421128a4f96276b406afce1c7536c1f1
BLAKE2b-256 ba257a6ad1f93fe22325ea3f8344c8ab36fd456a7360fad9ee981ed2e5ebc584

See more details on using hashes here.

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

Hashes for neurodock_mcp_guardrail-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf3b3e92f5db7024b4b81e964d7e585185d6984826dc4edd8cdb256232008b68
MD5 15e551c5c0e319efb5bf336dbe2a7844
BLAKE2b-256 f02a4eeb3999fe00eba670d02ab59989ee1167ae4cd690dbd26d22d37dd0653f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page