PluginBench
MCP Server
Active
MIT

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.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "sage": {
      "command": "npx",
      "args": [
        "-y",
        "psycgod-sage"
      ]
    }
  }
}

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 agent
  • sage install — Activates SAGE on the machine and integrates with supported AI agents
  • sage context stats — Shows token savings summary and compression metrics
  • sage context report — Generates full compression report with detailed metrics
  • sage history — Displays recent command history with optional limit
  • sage explain — Explains the latest failed command
  • sage suggest — Suggests the next fix based on recent failures
  • sage fix — Attempts automatic fixes for failed commands
  • sage doctor — Verifies activation and system health
  • sage 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

What is SAGE?

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.

Is SAGE free?

Yes, SAGE is open-source under the MIT license and available on PyPI and npm at no cost.

How do I install SAGE in Cursor or Claude?

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.

Does SAGE upload my code or logs?

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.

What commands does SAGE support?

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.

How much context do I actually save?

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 -->

CI Python PyPI npm License

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

StepResult
sage installActivates 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/hooksTell supported AI agents to use SAGE for noisy terminal work
Local databaseKeeps command history, compression proof, and retry context on the user's machine
Local proofKeeps 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:

MetricValue
SAGE telemetry command events27,892
Tokens processed799.5M
Tokens saved783.7M
Compression rate98.02%
Estimated savings$16,261.90
Command success rate88.3%
PyPI downloads, last 7 days632
npm downloads, last 7 days362
GitHub clones, last 14 days574

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 SAGEWith SAGE
Agent sees full noisy terminal outputAgent sees the useful summary
Context disappears fastContext lasts longer
Repeated failures waste tokensErrors are grouped and explained
Raw logs may enter promptsRaw logs stay local
Hard to prove savingsSAGE records proof metrics

Distribution

ChannelPackageStatus
PyPIpsycgod-sageCanonical Python package
npm / npxpsycgod-sageNode launcher for the Python core
MCP Registryio.github.PsYcGoD/sageOptional/manual MCP entry
GlamaPsYcGoD/sageOptional/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

ModeRequires login?Sends data?What leaves the machine?
Local-onlyNoNoNothing
Debug telemetryOptionalOpt-in onlyRedacted 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

LimitationWhat To Do
Already-open AI-agent sessions may not reload new instructionsRestart Claude/Codex/Cursor/Windsurf/OpenCode after sage install
Locked-down host apps can disable shell toolsSAGE cannot enable tools the host application has blocked
A host starts its shell in the wrong folderPass sage run --cwd <project> -- <command> or set SAGE_WORKSPACE_CWD
npm/PyPI installs cannot safely auto-run activationRun sage install once after package install
MCP can disconnect in some stdio agent sessionsUse normal sage run -- <command> by default; enable MCP manually only if needed
Package installs are passive by designReal activation starts with sage install

Demos

FlowPreview
PyPI installPyPI install flow
npm installnpm install flow
sage run --sage run
CLI runSAGE CLI demo

Links

License

MIT. See LICENSE.

Related MCP servers

AI drafting, design review and a drawing memory in BricsCAD on Linux: 128 tools, pure AutoLISP

1
Python
Apache-2.0
View repository →

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

4
Python
Apache-2.0
View repository →

Native Swift control of macOS Calendar and Reminders with 29 tools for events, reminders, tags, and batch operations.

33
Swift
MIT
View repository →

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.

0
JavaScript
MIT
View repository →

Evidence about ERC-8004 agents on BNB Smart Chain, gathered by calling them. No key.