
dfkhelper/token-goat 是一个从 https://github.com/dfkhelper/token-goat. 导入的 MCP 服务器候选
概览
dfkhelper/token-goat 是一个从 https://github.com/dfkhelper/token-goat. 导入的 MCP 服务器候选
概述(AI 翻译)
标题:“AI代币优化器——降低成本,提升焦点,阻止提示注入” 描述:“降低了 AI 工具 40–80% 的成本,并防止提示注入。停止重读,提取一个函数而非整个文件,缩减截图 97%。” 图片来源:/token-goat/assets/goat-social.png 永久链接:/
象征山羊
给模型它需要的东西,而不是你拥有的全部。***
85% 较小的读取次数 ·49% 保留的首次读取字节 ·97.4% 图像压缩 ·更精简的提示缓存 ·205+ 过滤与拦截规则 ·94–99% 技能开销削减 ·压缩内存 ·提示注入 保护 ·3.7 GB 从未达到模型 ·1.1 Gt 存档
将AI代币使用/成本降低40–90%,提升专注度。全自动,始终在线。
同时防御提示注入。每个获取的页面、工具结果和提取的文档在进入模型前都会被包裹在不可信内容围栏中,无论是否符合攻击模式,扫描只决定标签显示的内容。只需一行配置即可禁用。
**你的AI会重复读同一个文件三次。每次整文件导出后每回合都会重新付费。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
title: “AI Token Optimizer — Cuts Costs, Sharpens Focus, Blocks Prompt Injection” description: “Cuts AI tool costs 40–80% and guards against prompt injection. Stops re-reads, extracts one function vs. whole file, shrinks screenshots 97%.” image: /token-goat/assets/goat-social.png permalink: /
Token-Goat
Give the model what it needs, not everything you have.
85% smaller reads · 49% of first-read bytes withheld · 97.4% image compression · leaner prompt cache · 205+ filter & interception rules · 94–99% skill overhead cut · compaction memory · prompt injection guard · 3.7 GB never reached the model · 1.1 Gt tokens saved
Saves AI turns, context and tokens, and improves its focus. Fully automated, always online.
Also defends against prompt injection. Every fetched page, tool result, and extracted document is wrapped in an untrusted-content fence before hitting the model, whether or not it matched an attack pattern, and the scan only decides what the label says. One config line to disable.
Your AI re-reads the same file three times. Every whole-file dump is paid for again on every turn after it. Every compaction causes amnesia. Every build log buries the one line that matters. You pay for all of it. Token-Goat fixes all of it — automatically.
Token-Goat sits silently between your AI and your tools. Re-read a file? It gets a one-line hint and a narrow-slice suggestion instead of the full file again. Grab a screenshot? A 100 KB copy reaches the model instead of 10 MB. Run pytest, npm install, docker build, or cargo? The thousands of progress bars and passing-test names are stripped to the failures before the output even reaches the context window. Open a PDF, a large Markdown doc, or a CSV? The hook intercepts it — heading tree, page count, or column preview — so the model never pays for the full file. Run gh run watch or next dev a second time? Prior output is recalled rather than re-run. Compact a long session? It gets a clean structured manifest of edited files and key symbols so nothing important is forgotten. Sessions drop 40–90%+ in cost. You change nothing about how you work.
Each of these also costs a turn. A model that pages a file ten lines at a time, or runs the same command again to see output it already has, spends round trips as well as tokens. Token-Goat aims to answer the next question as well as the current one. These features save turns today:
token-goat brief "file::symbol"returns the symbol body, its callers and its containing doc section in one call.token-goat answer ""answers a plain-English question from the index alone, or refuses with a reason.token-goat read "file::symbol"returns one function in place of paging through the file.token-goat bash-outputandtoken-goat web-outputrecall captured output instead of running the command or fetch again.
安装
npx @vscode/vsce package