Pre-flight gate enforcement MCP server for Hermes Agent
Project description
Ultratimonel — Pre-flight Gate Enforcement MCP Server
Ultratimonel is an MCP (Model Context Protocol) server that enforces a deterministic pre-flight gate protocol in Hermes. It ensures that every LLM generation has consulted AgentMemory (1a), Checkpoint (1b), and Deck (1e) before generating a response.
Quick Start
# Set up
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Run (stdio transport — default for Hermes integration)
python main.py
# Run (with custom DB path)
ULTRATIMONEL_DB_PATH=/tmp/test.db python main.py
# Deploy SOUL.md rules
./scripts/deploy_soul.sh
# Run tests
pytest tests/ -v
Tools
assert_gates(message, session_id, sender="user")
Run all three pre-flight gates and return structured results.
- Input: message string, Hermes session ID, optional sender
- Output: JSON with
gates[],status(PASS/BLOCK/WARN),context,context_envelope,timestamp - Execution order: 1a AgentMemory → 1b Checkpoint → 1e Deck
check_gate(name, session_id)
Read the current status of a single gate from SQLite persistence.
- Input: gate name (
1a,1b,1e), session ID - Output: JSON with
name,state,mandatory,message,updated_at
complete_gate(name, session_id, reason)
Explicitly mark a BLOCK or WARN gate as PASS. Only works when current state is BLOCK or WARN.
- Input: gate name, session ID, optional reason string
- Output: JSON with
name,state(PASS),updated_at,message
Gate States
| State | Meaning | Generation Action |
|---|---|---|
PASS |
Gate completed successfully | Continue |
SKIP |
Gate does not apply / N/A | Continue |
WARN |
Gate failed (non-critical) | Warn + continue |
BLOCK |
Gate failed (mandatory) | Halt generation |
Architecture
ultratimonel/
├── main.py # Entry point (stdio transport)
├── requirements.txt # fastmcp, httpx
├── ultratimonel/
│ ├── __init__.py # Package metadata
│ ├── server.py # FastMCP tool registration
│ ├── persistence.py # SQLite layer (WAL, migrations)
│ ├── context_extractor.py# Message → sender/topic/project
│ ├── gate_engine.py # State machine (PASS/SKIP/WARN/BLOCK)
│ ├── triple_match.py # 1a→1b→1e orchestration
│ └── bridge.py # mcp-capabilities bridge stub
├── scripts/
│ └── deploy_soul.sh # SOUL.md rule injection
└── tests/
├── test_gate_engine.py
├── test_context_extractor.py
├── test_persistence.py
├── test_triple_match.py
└── test_integration.py
Database
SQLite database at ~/.hermes/ultratimonel.db (configurable via
ULTRATIMONEL_DB_PATH). Six tables:
schema_version— migration trackingsessions— per-generation contextgate_state— per-gate status per session+projectgate_logs— audit trail of state transitionscheckpoints— triple-match snapshotsmissions— top-level mission lifecycle
WAL journal mode, NORMAL synchronous, 5s busy timeout.
SOUL.md Deployment
Run scripts/deploy_soul.sh to inject the pre-flight protocol rules
into ~/.hermes/SOUL.md. The script:
- Backs up the existing SOUL.md
- Checks for the
## Protocolo Pre-flight (OBLIGATORIO)section - Updates in-place or appends as needed
- Supports
--force,--dry-runflags
Error Handling
All external MCP tool calls (AgentMemory, Checkpoint, Deck) are wrapped in try/except with SKIP fallback. The server never crashes from external failures. See the SDD for detailed error scenarios.
Dependencies
- Python ≥ 3.13
fastmcp— MCP frameworkhttpx— HTTP client for external MCP callssqlite3— stdlib persistence
License
MIT — © Nous Research
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 ultratimonel-1.0.0.tar.gz.
File metadata
- Download URL: ultratimonel-1.0.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b71c3eb29d94f5ba3ada5e64aea67f583333ece5f9f36839b805a526d335398
|
|
| MD5 |
4209a10899559c341b108e8c52b802e7
|
|
| BLAKE2b-256 |
697502421b5a78c32987122cef375f84cb45f68d9d84fea6fd714003e060aa38
|
File details
Details for the file ultratimonel-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ultratimonel-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d20d18a54d5f2726d9c9a9e433fb74217443e7b6014f6ef032aa863ae565aa8
|
|
| MD5 |
69ae757063b3f05a2228232bd3d10e61
|
|
| BLAKE2b-256 |
27d4e215791388c3634671faa8cda7764a54b95ad8d221e790faae51c62194cc
|