# SAGE Wrapper

A local MCP server that sits between your shell and the agent, handing over a short summary instead of the full log. Useful when test and build noise eats context.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 11
- Author: PsYcGoD
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PsYcGoD/sage
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/sage-wrapper

## What it does

SAGE wraps terminal commands. Raw output stays on your machine; the model gets a trimmed version with errors grouped and stack traces cut down. Command history, compression metrics and retry context live in a local database.

MCP is optional here and turned on by hand. Installing the package does nothing on its own — run `sage install` once after `pip install psycgod-sage` or `npm install -g psycgod-sage`, then restart any open agent sessions so they pick up the new instructions. From there, commands go through `sage run -- <command>`, with shortcuts like `sage pytest` available.

When a host opens its shell in the wrong directory, point SAGE at the project: `sage run --cwd <project> -- <command>` or set `SAGE_WORKSPACE_CWD`. Host apps that block shell tools stay blocked — SAGE cannot re-enable them. MCP also drops out in some stdio sessions, so plain `sage run -- <command>` is the safer default.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add sage -- npx -y psycgod-sage
```

### Codex

**Platform CLI**
```bash
codex mcp add sage-wrapper -- npx -y psycgod-sage
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "sage-wrapper": {
            "command": "npx",
            "args": [
                "-y",
                "psycgod-sage"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "sage-wrapper": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "psycgod-sage"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add sage-wrapper npx -y psycgod-sage
```

## When to use it
- shrink pytest output to the failing tests
- keep context alive through noisy build logs
- explain the last failed command and get a fix suggestion
- review recent command history
- check how many tokens compression saved

## Example prompts
- Run the tests through SAGE: `sage run -- python -m pytest`
- Run `sage npm test` and show me only the errors
- Explain why the last command failed: `sage explain --failed`

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
