SAGE Wrapper MCP Server
io.github.PsYcGoD/sage
Local-first command wrapper that compresses terminal output for AI coding agents while keeping raw logs private.
What is the SAGE Wrapper MCP server?
SAGE (Smart Agent Guidance Engine) is a command wrapper MCP server that intercepts terminal commands, stores full output locally, and sends AI agents clean compressed summaries. It reduces context waste by 98% on average while keeping raw logs, credentials, and source code on your machine.
SAGE sits between your terminal and AI coding agents like Claude, Cursor, and Windsurf. It captures noisy command output (test failures, build logs, stack traces), compresses it intelligently, and gives agents only the useful summary. This saves context tokens, prevents repeated failures from wasting tokens, and keeps sensitive data local. Works with any terminal workflow and tracks compression metrics to prove savings.
How to install SAGE Wrapper
Copy-paste configuration for popular MCP clients.
Tools & capabilities
Tools this server exposes to the agent.
sage run— Wraps any command, stores raw output locally, and returns a compressed summary to the agentsage install— Activates SAGE on the machine and integrates with supported AI agentssage context stats— Shows token savings summary and compression metricssage context report— Generates full compression report with detailed metricssage history— Displays recent command history with optional limitsage explain— Explains the latest failed commandsage suggest— Suggests the next fix based on recent failuressage fix— Attempts automatic fixes for failed commandssage doctor— Verifies activation and system healthsage dashboard— Starts a local dashboard for monitoring
Use cases
- Run pytest or npm test through SAGE to get clean summaries instead of drowning agents in test output
- Compress git, build, and deployment logs so agents focus on actionable errors instead of noise
- Track token savings and compression metrics locally without uploading raw logs
- Integrate with Claude Code, Cursor, Windsurf, or custom agents to reduce context waste
- Automatically suggest and apply fixes based on command failures and compression history
SAGE Wrapper MCP server FAQ
SAGE is a command wrapper that intercepts terminal output, keeps the full raw logs on your machine, and sends AI agents a compressed useful summary. It reduces context waste by ~98% while maintaining privacy.
Yes, SAGE is open-source under the MIT license and available on PyPI and npm at no cost.
Install via `pip install psycgod-sage` or `npm install -g psycgod-sage`, then run `sage install` once. Restart your AI agent session and it will automatically use SAGE for terminal commands.
No. SAGE is local-first by default. Raw command output, source code, credentials, and prompts stay on your machine. Only optional debug telemetry can be enabled, and it is redacted.
SAGE wraps any command via `sage run -- <command>`. It also provides shortcuts like `sage pytest`, `sage npm test`, and `sage git status`. Additional tools include history, explain, suggest, fix, and compression reporting.
According to SAGE's recorded metrics, it achieves a 98.02% compression rate, saving an estimated $16,261.90 across 27,892 command events and 783.7M tokens processed.
README (reference)
Source of truth, from the repository.
SAGE - Smart Agent Guidance Engine
<!-- mcp-name: io.github.PsYcGoD/sage -->SAGE is a local-first command wrapper for AI coding agents. It keeps full terminal output on your machine, sends agents a clean compressed summary, and tracks proof metrics without uploading your raw logs.
Use it with Claude Code, Codex, Cursor, Windsurf, OpenCode, Cline, custom agents, CI scripts, and normal terminal workflows.
Start Here: Install SAGE, Use once sage run -- python -m pytest, Then Use Any AI Agent
Package installation is passive for package-registry safety. After installing, run sage install once to activate SAGE for supported local AI agents.
PyPI / pip
pip install psycgod-sage
# or
python -m pip install --upgrade psycgod-sage
sage install
sage run -- python -m pytest
npm / npx
npm install -g psycgod-sage
npx -y psycgod-sage install
npx -y psycgod-sage run -- npm test
After install, restart any open AI-agent sessions. New sessions should read the SAGE instructions automatically and route terminal commands through SAGE.
Example prompt after restarting your AI agent:
Please help me with my general book in this folder.
Natural shortcuts also work:
sage pytest
sage npm test
sage git status
These are treated as:
sage run -- pytest
sage run -- npm test
sage run -- git status
What SAGE Does
| Step | Result |
|---|---|
sage install | Activates the machine locally, repairs global/project agent instructions, and verifies activation |
sage run -- <command> | Runs the command, stores raw output locally, and returns a compact useful summary |
| Agent memory/hooks | Tell supported AI agents to use SAGE for noisy terminal work |
| Local database | Keeps command history, compression proof, and retry context on the user's machine |
| Local proof | Keeps command and compression metrics on the user's machine |
SAGE does not auto-enable MCP. MCP is optional and manual for users who want it.
Recorded Local Metrics
Latest pulled stats as of 2026-08-01:
| Metric | Value |
|---|---|
| SAGE telemetry command events | 27,892 |
| Tokens processed | 799.5M |
| Tokens saved | 783.7M |
| Compression rate | 98.02% |
| Estimated savings | $16,261.90 |
| Command success rate | 88.3% |
| PyPI downloads, last 7 days | 632 |
| npm downloads, last 7 days | 362 |
| GitHub clones, last 14 days | 574 |
Why It Helps
AI coding agents burn context on repeated logs, failed test output, install noise, stack traces, and build spam. SAGE sits between the command and the agent.
| Without SAGE | With SAGE |
|---|---|
| Agent sees full noisy terminal output | Agent sees the useful summary |
| Context disappears fast | Context lasts longer |
| Repeated failures waste tokens | Errors are grouped and explained |
| Raw logs may enter prompts | Raw logs stay local |
| Hard to prove savings | SAGE records proof metrics |
Distribution
| Channel | Package | Status |
|---|---|---|
| PyPI | psycgod-sage | Canonical Python package |
| npm / npx | psycgod-sage | Node launcher for the Python core |
| MCP Registry | io.github.PsYcGoD/sage | Optional/manual MCP entry |
| Glama | PsYcGoD/sage | Optional/manual hosted MCP listing |
The npm package delegates to the Python implementation so both install paths use the same local database, telemetry rules, compression, and command behavior.
Common Commands
sage install # Activate this machine and AI-agent instructions
sage doctor --activation # Verify activation
npx -y psycgod-sage doctor --activation
sage run -- <command> # Wrap any command
sage run --cwd /project -- <command> # Explicit workspace for host integrations
sage pytest # Shortcut for: sage run -- pytest
sage npm test # Shortcut for: sage run -- npm test
sage git status # Shortcut for: sage run -- git status
sage context stats # Token savings summary
sage context report # Full compression report
sage history --limit 10 # Recent command history
sage explain --failed # Explain the latest failed command
sage suggest --failed # Suggest the next fix
sage fix --apply # Try an automatic fix
sage ml setup # Optional ML V2 dependencies
sage mcp install # Optional/manual MCP config
sage dashboard start # Local dashboard
Privacy Modes
| Mode | Requires login? | Sends data? | What leaves the machine? |
|---|---|---|---|
| Local-only | No | No | Nothing |
| Debug telemetry | Optional | Opt-in only | Redacted diagnostic summaries |
SAGE is designed to keep prompts, source code, credentials, raw command output, and project files local unless the user deliberately enables a feature that requires sending data.
Known Limitations
| Limitation | What To Do |
|---|---|
| Already-open AI-agent sessions may not reload new instructions | Restart Claude/Codex/Cursor/Windsurf/OpenCode after sage install |
| Locked-down host apps can disable shell tools | SAGE cannot enable tools the host application has blocked |
| A host starts its shell in the wrong folder | Pass sage run --cwd <project> -- <command> or set SAGE_WORKSPACE_CWD |
| npm/PyPI installs cannot safely auto-run activation | Run sage install once after package install |
| MCP can disconnect in some stdio agent sessions | Use normal sage run -- <command> by default; enable MCP manually only if needed |
| Package installs are passive by design | Real activation starts with sage install |
Demos
| Flow | Preview |
|---|---|
| PyPI install | ![]() |
| npm install | ![]() |
sage run -- | |
| CLI run | ![]() |
Links
License
MIT. See LICENSE.
Related MCP servers
AI drafting, design review and a drawing memory in BricsCAD on Linux: 128 tools, pure AutoLISP

Pseudolife Memory
Persistent memory for MCP-compatible agents: memory bank, fact cortex, dreams, graph.

macOS Calendar and Reminders
Native Swift control of macOS Calendar and Reminders with 29 tools for events, reminders, tags, and batch operations.
19 pay-per-call data tools for AI agents: crypto/DeFi, web, PDF, FX, weather, DNS. x402 on Base.
View repository →
Storm risk, route risk and reanalysis backtests for any point on earth. No key, no wallet.
Evidence about ERC-8004 agents on BNB Smart Chain, gathered by calling them. No key.




