Skip to main content
Glama

Install in 10 Seconds, Then Forget About It

No Python, no Node, no Playwright, no Docker, and zero new commands to memorize. One line installs the native ap binary and automatically wires your AI Desktop Assistants, IDEs & CLIs (Claude Desktop, OpenClaw, Hermes, Cursor, Windsurf, VS Code, Claude Code, Codex, OpenCode, Gemini CLI, Qwen Code, Pi, Goose, Antigravity, Grok):

Pinned & verifiable (recommended):

  • Official MCP Registry: io.github.xgbtxy/ap (search) — five cross-platform .mcpb bundles with SHA-256 pinned in server.json.

  • Docker MCP: glama.json + root Dockerfile (CI-verified stdio handshake, 37 tools):

    docker build -t ap-mcp . && docker run -i --rm -v "$PWD:/workspace:ro" ap-mcp
  • Cargo: cargo install --git https://github.com/xgbtxy/ap --tag v2.96.2 --locked

  • Release binary + checksum: download from v2.96.2, then verify against SHA256SUMS (sha256sum -c SHA256SUMS --ignore-missing, or Get-FileHash -Algorithm SHA256 on Windows).

  • Antigravity: copy the self-contained plugin/ bundle and run plugin/install.ps1 / plugin/install.sh.

Quick one-liner (tracks main, unpinned):

Windows (PowerShell):

curl.exe -fsSL https://raw.githubusercontent.com/xgbtxy/ap/main/install.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/xgbtxy/ap/main/install.sh | sh

Prefer direct download? Grab the standalone binary (Windows x64 .zip · macOS Apple Silicon · macOS Intel · Linux x64 · Linux ARM64) and run ap init. Remove cleanly anytime via ap uninstall.

v2.96.2 Official Antigravity Plugin Bundle: Install the self-contained plugin/ bundle (mcp_config.json --profile core, <15ms SessionStart repo snapshot hook, rules/AGENTS.md, skills/ap-primitives, and 1-command plugin/install.ps1 / plugin/install.sh), plus --max-mem-mb / --max-ram-mb aliases in ap-winjob.

v2.95.0 Windows Agent Kit: One-command Windows setup & health audit via scripts/install-windows-agent-kit.ps1, ap-winjob Low Memory/I/O Priority (--io-low) + EcoQoS process cage, ap-hook quiet_frontier 1-line coordinator meter & canonical_path_shield NTFS junction/symlink resolution. See Windows Agent Kit Benchmarks.


Related MCP server: AKIMCP

Why We Built ap: Fixing Where AI <thinking> Derails

Saving tokens is not the primary goal—it is a natural byproduct.

When we audited 101,108 real tool calls and raw <thinking> traces across coding agents on Windows and macOS, we found that models rarely fail because they "lack intelligence." They get slow, confused, and write sloppy code because 5 real-world bottlenecks hijack their working memory:

Where AI <thinking> Gets Stuck

What Happens Without ap

How ap Solves It Automatically (Full CLI Ref: Playbook)

1. Reading, Diffing &amp; Searching Code, Data &amp; Binaries(AST, Hashline, Semantic Diff, Archives, PE/ELF, IPC)

Chokes on Word/Excel/PDF/SQLite/.asar/binaries without python/pefile, drowns in comment/test hits on search, or hangs on GNU grep -rn.

ap ls / ap read / ap diff / ap search / ap query: Bounded ap ls --depth; --hashline (11:a3|...) anchored reads, --section/--around/--symbol/--surface/--ipc-graph/AST-CFG semantic diff &amp; 12-file batch reads; --ast structural metavar/kind patterns (fetch($URL, $$$), $X == $X), -F/--code-only --no-tests; PE/ELF/Java/.NET/Proto/firmware &amp; JS --routes/--jwt/--secrets; zero-Python SQLite SQL.

2. Orientation, Surface, Variants &amp; Browser/API/Win32 QA(Mapping, Deps, HTTP Roles/HAR, WS, Win32)

Blind ls/rg across modules, missing guard-asymmetry &amp; cycle graphs, accumulating orphan files, or hand-rolled HTTP/WS/CDP/Win32 scripts.

ap atlas + ap probe: <15 ms PageRank map, <40 ms atlas deps --dead, atlas variants guard-asymmetry sweeper, <60 ms 9-axis surface frontier, parallel impact/trace/changes, plus http --roles-matrix/--flow/--from-har, ws --replay-har, cdp --export-role, &amp; win --all.

3. Safe Creation &amp; Multi-File Refactors(Hashline Anchors, Codex Diffs, AST Codemod &amp; Checkpoints)

Naive find-replace corrupts comments/strings, multi-hunk diffs fail on duplicate blocks, or edits lose BOM/CRLF/modes or lack named checkpoints.

ap splice + ap undo: Pure-Rust Hashline (ap read/splice view --hashline + @@ HASHLINE: / ap splice apply --hashline / ap_edit anchor w/ fail-closed stale-hash guard &amp; bottom-up multi-hunk batching), *** Begin Patch + unified diffs, Tree-sitter rename/rewrite/INSERT_AFTER/DELETE_SYMBOL, UTF-8/16 BOM &amp; mode preservation, 6-lang+JSON/TOML AST gate, <5 ms PostToolUse hook, plus named ap undo --save/--diff/--keep.

4. OS Quoting Crashes, Resource Cages &amp; Doom Loops(Windows/Mac Shell, Win32 Job Cage, Policy Hooks &amp; Log Noise)

Hits 528+ Windows OS/shell crashes (GBK/BOM, PS &&, rg errors, dir /b, sed -n, head/tail -n, Select-String, Get-Content, Get-ChildItem, slow grep), orphan child trees &amp; log floods.

ap exec + ap-winjob + ap-hook + ap sieve + ap guard: Transparent shell auto-heal &amp; log compression -98.8%, 3x loop-breaker, standalone zero-dep ap-winjob (CREATE_SUSPENDED Win32 Job Object RAM/CPU cage &amp; atomic orphan reaping), and ap-hook generic schema_version: 1 Engine-vs-Policy loader (examples/policy.example.json).

5. Deep Verification, Structured Memory &amp; Pi Cache(6-Gate QA, AI-Surface, 0.33ms 10K-Rule Memory, Worktree Auto-ID, 22 Pi Patches)

Burns 11k+ schema tokens/turn, misses supply-chain/AI-surface risks, fragments .baton/.recall across linked git worktrees, or busts KV-caches mid-run.

MCP (--profile full|core|deferred) + ap guard scrub/ai-surface/sec/diff/verify --deep + ap baton &amp; ap recall (0.33ms 10K-rule AND-first FTS5, --by human/--pin immutability, zero-spawn .git/commondir worktree sharing) + ap audit (memoized cursor cache) + ap pi (22 patches).


Architecture &amp; Direction: Universal Core + On-Demand Harness &amp; Model Adapters

+-------------------------------------------------------------------+
|  3. On-Demand Adapters (Selected per Harness x Model Family)      |
|     - Harness hooks/MCP wiring: `ap init -a <harness>` / profiles |
|     - Declarative profile CLI: `ap profile show|set|recommend|reset` |
|     - Optional runtime patches: `ap pi patch` (Pi v1.5+/v1.6)    |
|     - Model-tier economics: KV-cache TTL keep, sieve limits,      |
|       `--profile core|deferred` schema slimming                   |
+-------------------------------------------------------------------+
|  2. Empirical Driver: Real Harness &amp; Model Execution Telemetry    |
|     - Offline zero-PII process logs (`ap audit --maintainer`)     |
|     - Pinpoints where real agents stall across harnesses &amp; models |
+-------------------------------------------------------------------+
|  1. Universal Core (`ap` / `ap.exe` Single Pure-Rust Binary)      |
|     - Model- &amp; harness-agnostic physical primitives: files, AST,  |
|       binaries/archives, SQLite, HTTP/WS/CDP, OS shield, `ap mcp` |
+-------------------------------------------------------------------+
  • Universal Core First: Keep durable physical primitives—reading/searching code, docs, binaries &amp; archives, Tree-sitter AST navigation &amp; safe patching, OS/shell quoting recovery, SQLite SQL, and browser/API verification—inside one dependency-free Rust core usable everywhere via CLI and 37 typed ap mcp tools.

  • Driven by Multi-Harness &amp; Multi-Model Reality: Prioritize work from empirical execution friction logs across real harnesses (Claude Code, Codex, Pi, OpenCode, Cursor, Gemini CLI, Antigravity, Grok, etc.) and model tiers via offline, zero-PII ap audit --maintainer rather than speculative prompting.

  • Composed On Demand: End users run Universal ap + only the adapters for their chosen harness and model (e.g., ap init -a <harness>, ap pi patch, or --profile deferred), incurring zero token or runtime tax for unused frameworks and allowing adapters to retire cleanly as upstream hosts or models evolve.

  • Native CLI Layer for Minimal / Freehand-Style Harnesses (Windows &amp; Linux): Built for minimalist agent loops that deliberately avoid MCP tool-schema bloat—giving frontier models zero-prefix CLI observation &amp; editing primitives (ap sieve disk-filtering, ap read --symbol/--hashline, ap splice) alongside ap-winjob native Windows process-group timeout/kill and --scrub-secrets (*KEY*/*SECRET*/*TOKEN*) parity.


How Do I Use It? (Zero Workflow Change)

  1. Just talk to your coding agent in plain language—even a 1-sentence beginner request on a $0 free agent works out of the box.

  2. Whenever you want to inspect the efficiency gains, run ap stats (or ap doctor for an environment check):

$ ap stats
[ap stats] Coding-Agent Efficiency & Thinking-Flow Ledger (100% offline)
------------------------------------------------------------------------
  Accelerated Agent Steps      : 28 actions
  Thinking Derailments Healed  : 11 Windows/shell crashes prevented before retry loops
  1-Shot Edits & Browser Gates : 14 verified (Tree-sitter AST + Headless Edge/Chrome + 0-slop)
  Working-Memory Noise Filtered: 612.4 KB -> 19.2 KB (-96.9% log/context clutter)
  Byproduct Token Savings      : ~186,800 wasted tokens avoided

Real Windows 11 End-to-End Results (Zero Fabrication)

Measured head-to-head on Windows 11 across $0 free coding agents and commercial CLIs on beginner 1-sentence prompts, legacy refactors, non-coding office tasks, and empty-directory random apps:

Coding Agent & Real Task

Without ap → With ap (Speed & Steps)

Code Quality & Self-Correction

Wasted Tokens Avoided

OpenCode Free ($0 big-pickle) · 1-Sentence Prompt

430.2s (60 calls) → 182.4s (23 calls, 2.36x faster)

7/8 (left empty-catch) → 8/8 (0 slop)

-75.1% (1.61M → 402k)

Codex (General Office · No Python) · .docx + .xlsx + GBK .csv

70.5s (binary dump + failed py) → 46.5s (1.52x faster)

5/5 → 5/5 (0 binary/GBK crashes via ap read)

-54.3% (127k → 58k)

Codex CLI (gpt-6-astra) · 14-File Multi-Module Refactor

151.6s → 96.6s (1.57x faster)

7/7 → 7/7 (all 5 AST callers + Edge UI synced)

-57.4% (296k → 126k)

Codex CLI (gpt-6-astra) · From-Scratch Random App

345.3s (23 calls) → 244.6s (9 calls, -61% steps)

6/6 → 6/6 (1-shot Edge CDP check)

-83.3% (1.12M → 186k)

Pi CLI (deepseek-flash) · Full-Stack Upgrade

483.0s (81 calls) → 271.5s (70 calls, 1.78x faster)

8/8 → 8/8 (-42.7% <thinking> churn)

-36.7% (3.63M → 2.30M)

Coding Agent & Real Task

Without ap → With ap (Speed & Steps)

Code Quality & Self-Correction

Wasted Tokens Avoided

Codex (Data &amp; SPA Audit) · 2,500-Row 2-Sheet .xlsx + GBK .csv + JS SPA

118.4s (5x custom XML/py scripts) → 94.3s (1.26x faster)

5/5 → 5/5 (cent-exact SQL join + Edge SPA render)

-35.1% (212k → 138k)

Codex (Full-Stack + SQLite Ops · No Python) · .sqlite + 3,000-Row .xlsx + .log.gz + JS Bug

112.0s (.NET ZIP + 4x custom scripts) → 94.3s (1.19x faster)

6/6 → 6/6 (1-shot .gz [FATAL] + SQLite↔XLSX join + APPEND)

-28.7% (235k → 167k)

Codex (Native PE DLL + Live TCP Worker + FS Diff + Webhook) · PE32+ Exports/Imports/Hex + Cmdline/TCP + Atomic FS Diff + Callback Capture

77.70s (120-line custom struct/socket/HTTP Python script) → 73.23s (1.06x faster, 1-shot PE analysis)

4/4 → 4/4 (1-call ap read *.dll SHA-256 + exports/imports; worker process untouched)

Zero custom PE/ELF parser needed

Codex (Batch Diagnostics + Async CDP Watch) · 180KB Minified 3-Offset Slice + 5x HTTP Batch + Live CDP Async Console/Network + Quorum Fix

89.12s (10 calls, custom capture-audit.mjs) → 83.92s (8 calls, -20% steps, 0 custom scripts)

5/5 + --deep PASS (host browser kept alive; 1-shot --offset, probe http --batch-stdin, probe cdp --watch-ms)

-6.0% (135k → 127k)

Codex (Prod SourceMap + JWT Incident Fix) · SourceMap v3 VLQ + 500-Line JSONL JWT + Git Diff Gate

106.05s (custom VLQ + JWT + mutation scripts) → 94.36s (1.12x faster)

5/5 + 100% Mutation (1-shot --map-pos + 5-gate --deep w/ guard diff)

Zero custom VLQ / diff audit scripts

Codex (Desktop App &amp; Live CDP Audit) · .asar + 180KB Minified JS + PE UTF-16LE + Live CDP + 3-Hop Trace

98.88s (custom Node/WS/ASAR scripts) → 83.43s (1.19x faster, 0 custom scripts)

5/5 → 5/5 (15 vs 4 unit tests + --deep PASS, host browser kept alive)

-17.8% (146k → 120k)

Codex (From-Scratch Full-Stack Security &amp; UI) · EventDesk (SQLite + Desktop/Mobile UI + XSS + Fuzz)

0 custom browser scripts (replaced hand-rolled test/browser.mjs via probe ui + smoke)

Mutation Kill Rate: 62.5% (5/8) → 100.0% (8/8), 5/5 (0 OWASP / 0 404 / 0 overflow)

6-gate proof receipt cut calls -30.8% (13→9)

Codex (Zero-Hint 18-Module Fault Hunt) · CommerceCore Voucher Regression (0 File Hints)

123.37s → 107.59s (1.15x faster, 1-shot atlas locate + --deep)

5/5 + 100% Mutation (verified callers via atlas impact + active-file --deep)

-7.2% (111k → 103k)

Codex (From-Scratch Creation &amp; Deep Test) · FlashVault Concurrency &amp; Wallet API

7 fused calls via guard verify --deep

Test Mutation Kill Rate: 62.5% (5/8) → 100.0% (8/8 killed, 10/10 black-box)

Killed all 3 surviving boundary/logic bugs

Codex (False-Green Repo Hardening) · OrderGate Hidden .only + 500 Crash + Off-by-1

200.6s → 183.2s (faster w/ 5-gate audit)

6/6 + 100% Mutation + 100% Chaos Fuzz (caught live 500 crash &amp; .only)

Fused 5 verification gates into 1 pass

Codex CLI (gpt-6-astra) · Full-Stack Upgrade

333.6s (24 calls) → 294.3s (11 calls, -54% steps)

8/8 → 8/8

-65.4% (1.05M → 365k)

Pi CLI (deepseek-flash) · From-Scratch Random App

1,821.1s → 1,499.3s (322s faster)

5/6 (2x silent catch {}) → 6/6 (0 slop)

Model ran extra subset-sum fuzzer


Co-Maintain ap With Your Own AI

ap improves through a 4-Source Recursive Self-Improvement Loop: (1) survey external community issues &amp; mature OSS tools, (2) measure local execution friction (100% offline, zero private data), (3) craft minimal Pure-Rust primitives, and (4) prove real Before-vs-After gains via a reviewer-first PR map:

# Preview your local zero-PII numeric bottlenecks mapped to ap source files (6 harnesses; safe to inspect first):
ap audit --maintainer
  • Want your AI to co-maintain with you? Grab the ready-to-paste prompt in CONTRIBUTING.md (includes privacy-first opt-outs if you prefer not to scan raw local logs + strict anti-misuse guardrails).

  • Submitting a PR? Use .github/PULL_REQUEST_TEMPLATE.md — it requires an exact file:symbol/line Change Map and Before/After table so maintainers can review and merge in minutes.


Privacy, Scope & Responsible Use

  • 100% Local & Offline Telemetry: ap stats and ap audit --maintainer run strictly locally with zero cloud uploads; ap audit --maintainer emits anonymized numeric friction counters only (never prompts, code, file paths, or credentials).

  • Responsible Engineering Scope & Anti-Misuse: ap is built exclusively for software engineering, debugging, QA verification, and authorized defensive security/configuration hygiene on systems you own or have permission to test. Do not misuse it for unauthorized access or harmful activity.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI coding agents and local LLMs to store and recall project memory, compact verbose logs, look up code symbols, create and rewind workspace snapshots, detect risky commands and loops, pack context optimally, and draft tokens through MCP tools.
      10
      2
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Exposes a governed suite of 38 tools over a single OAuth-gated MCP endpoint, letting web-based AI clients such as Claude, ChatGPT, and Grok read and edit files, run whitelisted shell commands, search, query SQLite, use Git, automate browsers and DevTools, manage background tasks, reach localhost services, and control the clipboard, notifications, ports, and Postman. This turns remote AI chats into secure operators of a local machine without granting unrestricted shell access.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to perform everyday developer chores as MCP tools — organizing and batch-renaming files, searching contents, hashing, converting timestamps, encoding/decoding, converting CSV and JSON, OCR, clipboard and screenshot access, zipping, running allowlisted commands, and managing processes. Destructive actions default to dry-run previews, and commands, renames, and process kills are constrained by allowlists and PID-plus-name matching so agents stay safe.
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables supervised, crash-resilient autonomous AI pair programming through nine MCP tools that checkpoint task progress in an atomic local DAG ledger, keep the machine awake during long runs, summarize repositories within a token budget, count tokens and costs across models, and rotate accounts before quota runs out. All state stays in a sandboxed project-local directory with zero telemetry, so long multi-step agent sessions survive crashes, context limits, and premature stopping.
      1
      Apache 2.0