Agy-Context-Saver 🛡️
Model Context Protocol (MCP) Server & Lifecycle Governor for Google Antigravity (Powered by RTK)
接入你的智能体
发布者自己的命令。不是 PlugMCP 端点。
用我们的密钥与日志托管一份副本。
npx -y [email protected]Claude Code 没有针对本地命令的安装链接。复制下方命令并在终端中运行。
claude mcp add agy-context-saver -- npx -y agy-context-saver@1.8.1在终端中运行。
{ "mcpServers": { "agy-context-saver": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
远程 URL 还是本机命令? 两种安装方式的区别
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.
rtk git, rtk pytest), enforcing bounded view_file slices paired with waymark_ask(..., plain: true), routing spillovers/task logs to rtk read and directory/prose searches to rtk find/rg, and shielding internal .system_generated state.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.
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.
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
run_command rewriting (rtk rewrite)git, pytest, cargo, npm, docker, etc.)rtk read, rtk grep, rtk find, rtk ls, rtk tree)rtk err, rtk summary).system_generated/)read_transcript, query_transcript)task-XYZ), agents waste tokens repeatedly polling manage_task(Action='status') or scheduling artificial timers. Agy enforces native Reactive Wakeup (<SYSTEM_MESSAGE>).transcript.jsonl dumps megabytes of raw JSON into context. Agy blocks direct reads of .system_generated and provides high-density Markdown streaming tools.view_file without slices, grep_search, find_by_name, list_dir) bypass token reduction. Agy enforces bounded view_file slices (StartLine / EndLine <= 150, paired with waymark_ask(..., plain: true)) and routes directory/prose search and spillover reads to RTK's canonical CLI (rtk find, rtk rg, rtk grep, rtk read).run_command calls are automatically rewritten (e.g. pytest $\to$ rtk pytest) via Antigravity PreToolUse hooks.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.view_file Hybrid Slice Policy): Pass StartLine and EndLine (1–150 lines default; or explicit StartLine: 1, EndLine: <TotalLines> full-file audit when $\le 800$ lines and $\le 45\text{ KiB}$) into view_file to preserve 1-indexed line numbers for replace_file_content without terminal stdout truncation.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).rtk rg "<pattern>" . (explicit target . prevents child process stdin stalls) or rg "<pattern>" ..rtk grep "<pattern>" or rtk rg "<pattern>".rtk find <path> or PowerShell dir / Get-ChildItem. (Avoid rtk ls / rtk tree on Windows as they rely on POSIX binaries/flags).rtk ls <path> or rtk tree.rtk err <cmd>: Run command and show only errors/warnings.rtk summary <cmd>: Run command and produce a 2-line heuristic summary.view_file access to SKILL.md, brain artifacts, and config files is preserved..system_generated/ (transcripts, task logs, progress).read_transcript and query_transcript.For complete technical references, architectural specifications, and governance rules, visit our Zensical Documentation Site:
Build or serve the documentation locally using Zensical:
# Build static documentation site
zensical build
# Serve live preview server
zensical serve
To cleanly test every layer of the framework without guesswork or interactive stalls:
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.
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).
# 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
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 }.npm start or node mcp/index.js interactively: It starts the stdio JSON-RPC daemon and waits indefinitely on stdin.manage_task(Action='status'): Polling triggers the session ledger circuit breaker at 5 cumulative denials. Rely on native Reactive Wakeup (<SYSTEM_MESSAGE>).npm run uninstall as a standalone check: It unregisters the live hook. If run, immediately re-run npm run setup.rtk rg: Always run rtk rg "<pattern>" . to avoid stdin pipe blocking.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):
.system_generated/steps/<step>/output.txt): Inspected via canonical rtk read <path> (safe-harbored in the PreToolUse hook; native view_file calls automatically route to rtk read).rtk read tasks/<taskId>.log (lifecycle-gated in the PreToolUse hook; strictly blocked under Proportional Backoff while running, allowed once completed).MIT License. Copyright (c) 2026 paragon-ux.
Universal Model Context Protocol (MCP) server & lifecycle governor purpose-built for Google Antigravity
{ "mcpServers": { "agy-context-saver": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Agy Context Saver 通过 stdio 在本地运行。
上次检查时间:2026-11-13。 Universal Model Context Protocol (MCP) server & lifecycle governor purpose-built for Google Antigravity