protect-context
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PC_USER_DIR | No | Overrides the personal-layer directory (default $XDG_CONFIG_HOME/protect-context or ~/.config/protect-context) | |
| PC_SESSION_ID | No | Names the session used for evidence and loop views, so parallel hosts do not share a view |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| guard_statusA | Session dashboard: diff, loops, evidence, contract size, and the last verify. Use it at the start of a turn, after a compaction, or before claiming the
work is done, when you need the current guardrail state in one block.
It takes no parameters. It returns text beginning with |
| guard_verifyA | Run a shell command and record the outcome as evidence. Use it before claiming a check passed, and cite the returned evidence id.
Do not use it to retry a command that |
| guard_evidenceA | Read recorded verification runs. Use it to recover a past evidence id, its exit code, and the stored digest
instead of re-running the command. |
| guard_contractA | List, add, or remove a project contract constraint. Use |
| guard_noteA | Append one agent-authored journal entry. Use it when a decision, correction, risk, or note should survive the
session and the next compaction. Do not use it for a claim that a command
passed; that belongs in |
| guard_journalA | Read recent journal entries back after a compaction or a capped brief. Use it when the brief hid older decisions, corrections, risks, or the
agent's own notes and you need the stored line, not a search. For a
keyword, tag, or evidence-id search, use |
| guard_intentA | Owner wants, needs, preferences, and corrections from the journal. Use it to answer "what does the owner want" without guessing keywords:
every row whose text expresses an owner want, need, or preference, or an
explicit "you are wrong" correction, plus rows already carrying the tags
|
| guard_briefA | The compact pre-agent brief, built from this project's store. Use it when you need the same context the pi extension re-injects before a
turn and no extension is running (another runtime, a script, a CI job, or a
plain MCP client): the owner task, the contract with both additive budgets
(owner rows, then seed rows), the newest owner statements, durable
precedents, trusted decisions and corrections, unverified agent notes, tag-
matched recall, open loops, and the last verify run with its trust label.
Anything a cap dropped is announced with a |
| guard_recallA | Search the retained journal and evidence window. No embeddings and no network. Use it when you remember a word, tag, evidence id, or command but not which
entry it was, including after the brief's caps hid it. Filters combine with
AND. |
| guard_loop_checkA | Report failing-command streaks for this session and whether the next rerun blocks. Use it before repeating a command that just failed. The same normalized
command, including a trailing |
| guard_diff_auditA | Audit the working tree's size against the configured line and file thresholds. Use it before a large edit, or when status shows a warn or hard diff, to
see added/deleted lines, file count, and the verdict. |
| guard_preflightA | Check configured tool presence and versions, and whether this directory is a git worktree. Use it when a tool fails in a surprising way, before blaming the code.
It takes no parameters. The tool list is |
| guard_budgetA | Report this session's recorded tool-output size. Use it when the context watermark is climbing or a turn is getting large,
to see which tools produced the bytes. It takes no parameters. It reads
|
| guard_orientationA | Bounded repository digest: tree, languages, and conventions files. Use it before the first edit in an unfamiliar checkout, so the next read
starts from CLAUDE.md, AGENTS.md, CONVENTIONS.md, README.md, or README
when those files exist. It takes no parameters. The scan starts at the git
worktree root when one is found, otherwise the working directory. The tree
is capped (12 entries, 8 children, depth 3, 4000 files). It returns
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 14 tools
Most tools are clearly separated by resource and action (guard_note writes vs guard_journal reads, guard_verify records vs guard_evidence reads), and descriptions explicitly cross-reference alternatives (e.g. 'For a keyword search, use guard_recall instead'). The remaining friction is the cluster of journal-reading paths — guard_journal, guard_recall, guard_intent, and guard_brief all surface stored entries, and guard_recall's `type=evidence` overlaps with guard_evidence.
Every tool uses the same `guard_` prefix plus a snake_case noun (guard_note, guard_status, guard_contract, guard_diff_audit, guard_loop_check). Multi-word names consistently use underscores and no mixed camelCase or verb-style outliers appear.
14 tools sits at the top of the well-scoped band but each maps to a distinct guardrail concern: journaling, evidence, contract, status, loops, diff, preflight, budget, orientation. A few read-only introspection tools (guard_budget, guard_orientation) are narrower, but none appear redundant enough to cut.
Coverage is broad and balanced across write/read lifecycles: journal append+read+search+brief, verify+evidence lookup, and contract list/add/remove. Minor gaps exist — no way to clear a loop streak or reset state, no config/threshold setter, and journal entries cannot be edited or deleted (append-only by design).