Agy Context Saver
БесплатноПоддерживаетсяUniversal Model Context Protocol (MCP) server & lifecycle governor purpose-built for Google Antigravity
Описание
Universal Model Context Protocol (MCP) server & lifecycle governor purpose-built for Google Antigravity
README
Model Context Protocol (MCP) Server & Lifecycle Governor for Google Antigravity (Powered by RTK)
npm version License: MIT Docs Tests
Agy-Context-Saver is a high-performance lifecycle governor and zero-dependency MCP server purpose-built for Google Antigravity (agy), paired with RTK (Rust Token Killer) for transparent CLI output reduction.
It permanently eliminates session degradation, memory bloat, and context window exhaustion caused by background task busy-wait polling, uncompressed terminal outputs, and raw JSON transcript reading.
Core Value Proposition
| Metric / Capability | Without Governor | With Agy-Context-Saver + RTK |
|---|---|---|
| Command Output Bloat | Unlimited raw test dots, ANSI dumps | RTK transparent reduction (60–90% token savings) |
| Workspace File Inspection | Massive uncompressed view_file dumps |
waymark_ask(..., plain: true) $\to$ bounded view_file slices ($\le 150$ lines) + rtk find / rtk rg |
| Long Command Execution | Detached after 5s $\to$ busy-wait loop | Synchronous window expanded to 10s $\to$ finishes in-turn |
| Background Task Monitoring | Repetitive busy-polling loops | Enforced Reactive Wakeup with 5-strike circuit breaker |
| Configuration Safety | Risk of third-party config clobber | Non-destructive preservation of foreign hooks/MCP with .bak backups |
| Transcript Review | Raw JSONL dumped into context | Clean human-readable Markdown via read_transcript |
| Runtime Dependencies | N/A | Zero external npm dependencies (100% Node.js stdlib) + native RTK binary |
Canonical 3-Layer Governance Architecture
- Layer 1: Reactive Lifecycle & Polling Immunity: Replaces destructive busy-polling loops with native Antigravity Reactive Wakeup, governed by an exponential Proportional Backoff curve and a 5-strike circuit breaker.
- Layer 2: Transparent CLI & Codebase Streamlining: Intercepts shell execution via PreToolUse hooks, transparently rewriting commands to RTK (
rtk git,rtk pytest), enforcing boundedview_fileslices paired withwaymark_ask(..., plain: true), routing spillovers/task logs tortk readand directory/prose searches tortk find/rg, and shielding internal.system_generatedstate. - Layer 3: Synchronous Execution: Expands synchronous execution windows to 10s so routine commands finish in-turn instead of detaching.
Subagent tools moved.
subagent_briefand squad dispatch now live in the separate Agy-Squad package (under construction). Agy-Context-Saver is complete without them, and the two will install side by side.
Quickstart (Instant Install)
Install and synchronize the governor and RTK across your Antigravity environment:
# Fastest: one-line registration via npx
npx agy-context-saver install
# Or locally from this repository
npm run setup
# Audit health across all layers at any time
npm run status
[!TIP] Enterprise Non-Destructive Guarantee: Agy-Context-Saver requires zero external npm dependencies (100% native Node.js standard library), strictly preserves existing foreign hooks (e.g.
waymark-continuity) and foreign MCP servers, automatically writes atomic.bakconfiguration backups, and supports clean 1-step rollback.
[!NOTE] RTK Default Configuration Notice: To protect agent context and command execution from unprompted marketing banners (
[rtk] /!\ No hook installed...),Agy-Context-Saverstandardizessuppress_hook_warning = truein RTK's user configuration (%APPDATA%\rtk\config.tomlon Windows /~/.config/rtk/config.tomlon POSIX) during installation. Existing user configurations are safely preserved. See RTK Support Matrix.
Architectural Division of Responsibilities
Antigravity Agent
|
+------------------+------------------+
| |
run_command native inspection /
| lifecycle tools
v |
RTK hook |
| +---------+----------+
v | |
RTK execution inspection tools lifecycle
| | |
v v v
compact command output Agy DENY + route Agy governance
| |
v v
RTK read/grep/find Agy MCP
| |
+---------+----------+
|
v
useful context
RTK Owns:
- Transparent
run_commandrewriting (rtk rewrite) - Shell command output reduction (
git,pytest,cargo,npm,docker, etc.) - Canonical codebase inspection CLI (
rtk read,rtk grep,rtk find,rtk ls,rtk tree) - Focused diagnostic utilities (
rtk err,rtk summary)
Agy Owns:
- Antigravity lifecycle management & Reactive Wakeup enforcement
- Background task polling governance & 5-strike circuit breaker
- Antigravity internal state protection (
.system_generated/) - Zero-JSON Markdown transcript extraction (
read_transcript,query_transcript) - Benchmark and evaluation artifact mutation protection
The Core Problems Solved
- The Polling Trap: When shell tasks detach to background jobs (
task-XYZ), agents waste tokens repeatedly pollingmanage_task(Action='status')or scheduling artificial timers. Agy enforces native Reactive Wakeup (<SYSTEM_MESSAGE>). - The Terminal Bloat Trap: Routine test runs and git operations dump hundreds of lines of noise into context. RTK compresses these outputs natively before they enter model context.
- The Raw Transcript Trap: Reading
transcript.jsonldumps megabytes of raw JSON into context. Agy blocks direct reads of.system_generatedand provides high-density Markdown streaming tools. - Native Inspection Bypass: Unbounded native inspection tools (
view_filewithout slices,grep_search,find_by_name,list_dir) bypass token reduction. Agy enforces boundedview_fileslices (StartLine/EndLine <= 150, paired withwaymark_ask(..., plain: true)) and routes directory/prose search and spillover reads to RTK's canonical CLI (rtk find,rtk rg,rtk grep,rtk read).
Key Capabilities
- Transparent RTK Rewriting: Native
run_commandcalls are automatically rewritten (e.g.pytest$\to$rtk pytest) via Antigravity PreToolUse hooks. - Unified 3-Tier Codebase & File Inspection:
- Tier 1 — Structural Discovery (
waymark_ask(..., plain: true)): Locate exact[StartLine, EndLine]coordinates across all 23 supported formats (code ASTs +markdown,yaml,json,toml,bash) in ~19–466 tokens. - Tier 2 — Precision Workspace Reading (
view_fileHybrid Slice Policy): PassStartLineandEndLine(1–150lines default; or explicitStartLine: 1, EndLine: <TotalLines>full-file audit when $\le 800$ lines and $\le 45\text{ KiB}$) intoview_fileto preserve 1-indexed line numbers forreplace_file_contentwithout terminal stdout truncation. - Tier 3 — RTK CLI Boundaries:
rtk read <path>: Inspect runtime step spillovers (.system_generated/steps/<step>/output.txt) and completed background task logs (tasks/<taskId>.log) with--head-lines/--tail-lines.rtk find <path>: Compact file search tree and directory listing (cross-platform, works on Windows & POSIX).- Prose / Regex Search (when symbol, heading, or config key is unknown):
- Windows:
rtk rg "<pattern>" .(explicit target.prevents child process stdin stalls) orrg "<pattern>" .. - POSIX / Linux / macOS:
rtk grep "<pattern>"orrtk rg "<pattern>".
- Windows:
- Directory listing by platform:
- Windows:
rtk find <path>or PowerShelldir/Get-ChildItem. (Avoidrtk ls/rtk treeon Windows as they rely on POSIX binaries/flags). - POSIX / Linux / macOS:
rtk ls <path>orrtk tree.
- Windows:
rtk err <cmd>: Run command and show only errors/warnings.rtk summary <cmd>: Run command and produce a 2-line heuristic summary.
- Tier 1 — Structural Discovery (
- Antigravity Special Files Safe Harbor: Direct
view_fileaccess toSKILL.md, brain artifacts, and config files is preserved. - Protected Internal State: Root-based guard prevents reading
.system_generated/(transcripts, task logs, progress). - Session-Wide Lifecycle Ledger: Polling checks are tracked globally per session; changing task IDs or waiting does not reset governance.
- Zero-JSON Transcript Streaming: Stream conversation turns without raw JSON syntax using
read_transcriptandquery_transcript.
Comprehensive Documentation
For complete technical references, architectural specifications, and governance rules, visit our Zensical Documentation Site:
- 📖 Getting Started & Installation: Zero-delay setup, native plugin linking, hooks registration, and verification matrix.
- 🏗️ Architecture & Internals: Closed Execution Topology, RTK separation of concerns, and the Four Non-Fragile Architectural Pillars.
- 🛡️ Lifecycle Governance & Hooks: Proportional Backoff curve, Reactive Wakeup invariants, and the 5-strike circuit breaker.
- 🧰 MCP Tools & CLI Reference: Complete specifications for all 5 canonical autonomous MCP tools, slash commands, and diagnostic utilities.
- 🔬 Forensic & Output Inspection: Ephemeral tool spillover resolution, and post-mortem task retrieval.
- 🚀 Publishing & Verification Playbook: Clean-room test runs, release procedures, and multi-suite verification matrix.
- 🗺️ Product Roadmap: Phased strategic roadmap focusing on affordable and reliable multi-agent workflows across general tasks.
Local Documentation Server
Build or serve the documentation locally using Zensical:
# Build static documentation site
zensical build
# Serve live preview server
zensical serve
Zero-Guesswork Testing & Verification Playbook
To cleanly test every layer of the framework without guesswork or interactive stalls:
1. Audit Live Registration
npm run status
# or
node mcp/index.js status
Confirms that all 4 integration layers (Plugin link, Lifecycle Hook, MCP Server, Schemas) and RTK are active.
2. Run Complete Automated Test Suite
npm test
Runs all 10 test suites (hook governance, MCP protocol, output inspection governance, E2E probes, performance probes, installed verification, lifecycle rollback, check-only read-only safety, malformed configuration preservation, and RTK ledger fresh install verification).
3. Run Targeted Tests Individually
# Governance hook unit tests (27 closed-topology tests)
node tests/test-hook.mjs
# MCP server protocol & method tests
node tests/test-mcp.mjs
# Output inspection & lifecycle gating tests
node tests/test-output-governance.mjs
# End-to-end edge case & probe tests
node tests/test-e2e-probes.mjs
# Performance, streaming & memory probes
node tests/test-performance-probes.mjs
# Live installed environment verification
node tests/test-installed-verification.mjs
# Clean install/uninstall/restore lifecycle test
node tests/test-lifecycle-rollback.mjs
# Check-only read-only isolation regression test
node tests/test-check-only-readonly.mjs
# Malformed config preservation fail-closed regression test
node tests/test-malformed-config-preservation.mjs
# RTK ledger & fresh install verification test
node tests/test-rtk-ledger-fresh-install.mjs
4. Test MCP Tools from Antigravity Agent
get_installation_status: Call with{}to audit all 4 layers + RTK.check_context_health: Call with{ "transcriptPath": "<path-to-transcript.jsonl>" }.read_transcript: Call with{ "conversationId": "<uuid>", "lastTurns": 3, "mode": "compact" }.query_transcript: Call with{ "conversationId": "<uuid>", "query": "<term>", "summaryOnly": true }.
5. Testing Pitfalls & Anti-Patterns to Avoid
- ❌ Do NOT run
npm startornode mcp/index.jsinteractively: It starts the stdio JSON-RPC daemon and waits indefinitely onstdin. - ❌ Do NOT loop on
manage_task(Action='status'): Polling triggers the session ledger circuit breaker at 5 cumulative denials. Rely on native Reactive Wakeup (<SYSTEM_MESSAGE>). - ❌ Do NOT run
npm run uninstallas a standalone check: It unregisters the live hook. If run, immediately re-runnpm run setup. - ❌ On Windows, do NOT omit the directory in
rtk rg: Always runrtk rg "<pattern>" .to avoid stdin pipe blocking.
MCP Tools & Slash Commands
User Slash Command (
/mcp:...):/mcp:agy-context-saver:context_shield: Injects 3-layer governance rules and RTK standards into any session with one click. (MCP Prompts appear in your chat autocomplete menu; MCP Tools are called autonomously by the agent).
Agent MCP Tools:
check_context_health: Diagnoses conversation transcript turn budgets, payload size, RTK status, and polling loops.read_transcript: Reads recent conversation history in clean Markdown format (compact/full).query_transcript: Forensic filtering, regex search engine, and surgical single-step dereferencing (stepIndex,field) from full transcripts.get_installation_status: Inspects live Antigravity plugin link, hook, MCP server, tool schemas, and RTK binary.sync_installation: Re-verifies and repairs all integration layers in ~25ms.
Streamlined Output Inspection (0 New Tools):
- Runtime Step Spillovers (
.system_generated/steps/<step>/output.txt): Inspected via canonicalrtk read <path>(safe-harbored in the PreToolUse hook; nativeview_filecalls automatically route tortk read). - Completed Background Task Logs: Inspected via
rtk read tasks/<taskId>.log(lifecycle-gated in the PreToolUse hook; strictly blocked under Proportional Backoff while running, allowed once completed).
- Runtime Step Spillovers (
License
MIT License. Copyright (c) 2026 paragon-ux.
Установить Agy Context Saver в Claude Desktop, Claude Code, Cursor
unyly install agy-context-saverСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add agy-context-saver -- npx -y agy-context-saverПошаговые гайды: как установить Agy Context Saver
FAQ
Agy Context Saver MCP бесплатный?
Да, Agy Context Saver MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Agy Context Saver?
Нет, Agy Context Saver работает без API-ключей и переменных окружения.
Agy Context Saver — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Agy Context Saver в Claude Desktop, Claude Code или Cursor?
Открой Agy Context Saver на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Unyly Deploy
Deploy sites and MCP servers to Unyly straight from your AI agent
автор: UnylyAmap Maps Mcp Server
MCP server for using the AMap Maps API
автор: duxiaohuiPayMCP
Lightweight payments layer for MCP servers: turn tools into paid endpoints with a two-line decorator. [PyPI](https://pypi.org/project/paymcp/) · [npm](https://w
автор: blustAIServer For Power BI
Enables exploring Microsoft Fabric / Power BI workspaces and semantic models, and executing ad-hoc DAX queries.
автор: Mitsubishi-FusoTemplate MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectSupabase
Database, auth and storage
автор: SupabaseEverything
Reference / test server with prompts, resources, and tools.
Compare Agy Context Saver with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
