SAGE Wrapper

io.github.PsYcGoD由 GitHub 账号 PsYcGoD 发布v2.6.2更新于 Oct 24, 2026

Command wrapper MCP server for coding agents, compression, workflows, and local automation.

已验证STDIO仅桌面效率与工作流开发者工具

概览

AI 生成的概览

本地优先的命令包装器,为编码代理运行终端命令,并返回压缩后的摘要而非冗长的原始输出。

可以做什么
通过包装器运行测试、构建、git 等终端命令,原始输出保存在本地,只向代理返回精简摘要,支持 sage pytest、sage git status 等快捷写法,并可为宿主集成显式指定工作目录。查看本地指标与历史:token 节省量、压缩报告、最近命令历史,以及针对最近失败命令的解释和修复建议,并可选自动应用修复。为受支持的本地 AI 代理激活并验证配置,可选启动本地仪表板或手动配置 MCP。
适用场景
当 AI 编码代理反复因测试日志、堆栈跟踪、安装噪音或构建刷屏而消耗上下文时适用,可让原始输出留在本机,代理只看到有用的摘要。
运行要求
作为本地进程在用户机器上运行(仅桌面端)。通过 pip 安装 Python 包 psycgod-sage,或安装 npm 包 psycgod-sage(其委托给 Python 核心,因此仍需 Python)。安装后需运行一次 sage install 为受支持的代理激活,并重启已打开的代理会话。未声明账户、API 密钥或环境变量;可选通过 SAGE_WORKSPACE_CWD 指定工作目录。
安装前请注意
包安装按设计是被动的,只有运行 sage install 才会激活,而该命令会修改本机的全局和项目代理指令。修复命令可自动应用修复,使用前应检查改动。原始命令输出、历史和指标存入本地数据库;只有主动启用调试遥测时数据才会离开本机,且仅发送脱敏的诊断摘要。MCP 为可选且需手动启用,在某些 stdio 代理会话中可能断开连接。

安装

在 SourceWeft 中

  1. 打开 控制台中的 SAGE Wrapper,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

SAGE - Smart Agent Guidance Engine

[CI] [Python] [PyPI] [npm] [License] [SAGE Wrapper MCP server]

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

powershell
pip install psycgod-sage# orpython -m pip install --upgrade psycgod-sagesage installsage run -- python -m pytest

npm / npx

bash
npm install -g psycgod-sagenpx -y psycgod-sage installnpx -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:

text
Please help me with my general book in this folder.

Natural shortcuts also work:

bash
sage pytestsage npm testsage git status

These are treated as:

bash
sage run -- pytestsage run -- npm testsage 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

bash
sage install                       # Activate this machine and AI-agent instructionssage doctor --activation           # Verify activationnpx -y psycgod-sage doctor --activationsage run -- <command>              # Wrap any commandsage run --cwd /project -- <command> # Explicit workspace for host integrationssage pytest                        # Shortcut for: sage run -- pytestsage npm test                      # Shortcut for: sage run -- npm testsage git status                    # Shortcut for: sage run -- git statussage context stats                 # Token savings summarysage context report                # Full compression reportsage history --limit 10            # Recent command historysage explain --failed              # Explain the latest failed commandsage suggest --failed              # Suggest the next fixsage fix --apply                   # Try an automatic fixsage ml setup                      # Optional ML V2 dependenciessage mcp install                   # Optional/manual MCP configsage 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 install[PyPI install flow]
npm install[npm install flow]
sage run --[sage run]
CLI run[SAGE CLI demo]

Links

License

MIT. See LICENSE.

来源:README.md,提交 0b57e69

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v2.6.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分