
ATR: Automation for Token Reduction
io.github.JacobBhatt12由 GitHub 帳號 JacobBhatt12 發布v1.0.0更新於 Oct 29, 2026
MCP proxy that hides tool lists and shrinks tool results so your AI uses fewer tokens.
概覽
本機 MCP 代理,隱藏工具清單並壓縮工具結果,讓 AI 助理呼叫工具時消耗更少 token。
- 可以做什麼
- 在所有已設定的 MCP 伺服器工具中搜尋,並執行最符合任務的那幾個
- 執行唯讀工具並壓縮結果,或執行會變更資料的工具並先請求確認
- 讀取被截斷結果的更多內容,例如某一頁、某個欄位或某次搜尋
- 處理程式碼:專案結構圖、程式碼搜尋、按需讀取檔案片段、精簡的 git diff、測試與建置輸出
- 查看 ATR 已節省的 token 數量
- 適用情境
- 當你使用的 MCP 伺服器會回傳大量結果(如 GitHub、瀏覽器、資料庫、日誌或網頁),並希望降低 token 費用時值得加入。對沒有 MCP 伺服器的單純寫程式幫助不大,也無法減少聊天記錄和助理自身回覆的 token。
- 執行需求
- 需要 Python 3.11 或更新版本,並在本機安裝 atr-mcp 套件。安裝流程會改寫你所用 AI 應用程式的 MCP 設定,把現有伺服器移到 ATR 之後。用於 claude.ai 或 ChatGPT 時需安裝 http 附加元件,並提供帶密鑰的公開通道連結。設定保存在本機設定檔中。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ATR: Automation for Token Reduction,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ATR: Automation for Token Reduction
ATR makes your AI use fewer tokens when it works with tools. Fewer tokens means lower bills and fewer "usage limit reached" messages.
It works with Claude Code, Codex, Claude Desktop, Cursor, Windsurf, claude.ai and ChatGPT. It's free and runs on your own computer.
The problem
When an AI uses tools (GitHub, a browser, a database, your test runner), two things waste tokens:
- Every tool's instructions are sent on every message, even tools the AI never uses. Ten MCP servers can mean 10,000+ tokens before you've typed anything.
- Tool results are huge. A list of GitHub issues, a web page or a test run can be tens of thousands of tokens, and all of it goes into the chat.
What ATR does
ATR sits between your AI app and your tools:
- It hides the tool list. The AI sees a few small ATR tools and searches for the tool it needs when it needs it.
- It shrinks results. Before the AI sees a result, ATR removes the noise and keeps what matters. A failing test run keeps the failures and drops the passing tests. A web page keeps its text and links and drops the layout.
- Nothing is lost. When ATR cuts something, it keeps the full result, and the AI can ask for any part of it.
Get started
You need Python 3.11 or newer.
atr setup finds the AI apps on your computer, shows you what it will change, and asks first. Then it:
- moves your MCP servers behind ATR, and
- adds ATR to each app.
Restart your apps and you're done.
Every file atr setup changes also gets a backup copy (.atr-backup).
Just want to try it?
The demo connects a fake server with 50 tools (GitHub, Slack, logs, a database). Nothing leaves your computer.
Ask your AI to "list the open GitHub issues", then "show ATR stats" to see how many tokens it saved.
How much it saves
Live tests
We gave AI agents the same browser task with and without ATR: open Hacker News, click "new", then open a GitHub issues page. Each setup ran 3 times, and every answer was correct.
Codex is mixed: with ATR it sends about half as many full-price tokens, but more tokens overall.
Single results
What the AI receives, in tokens, measured with python -m benchmarks.bench_atr:
In each case, the parts that matter are kept: errors, failing tests, changed code lines, page text and links.
When ATR helps, and when it doesn't
- Helps most: you use MCP servers that return big results, like GitHub, browsers (Playwright), databases, logs or web pages.
- Helps a little: plain coding in Claude Code or Codex with no MCP servers. Those apps already trim their own commands, so in our test ATR made no difference there.
- Can't help: your chat history and the AI's own replies. An MCP server only sees tool calls, never the conversation.
ATR's tools
The AI uses these. You don't need to call them yourself.
For your MCP servers
For coding
Safety
- Secrets are never read, searched or shown, including
.envfiles, private keys, cloud credentials, and files named likeapi_keys.json. This also applies to tools behind ATR and toatr_diff. - Reading and changing are separate. Tools that only read go through
atr_read. Anything that changes something goes throughatr_call, so your app can ask you before it runs.atr_run(shell commands) always asks. - Files stay in allowed folders. File tools only see the folders listed in your settings.
Using ATR in claude.ai or ChatGPT
These apps can only reach servers on the internet, so ATR needs a public link.
Add https://<your-link>/mcp/<secret> as a connector:
- claude.ai: Settings → Connectors → Add custom connector (no sign-in)
- ChatGPT: Settings → Apps & Connectors → developer mode → create a connector (no sign-in)
Keep the link private. Anyone who has it can use your tools. File reading and shell commands are off over the internet unless you turn them on with --read-files and --allow-run. To change the secret, delete ~/.atr/http_token.
Settings
atr setup writes these for you. You can also edit ~/.atr/config.json yourself:
More
No MCP at all? atr compress shrinks a file or your clipboard before you paste it into any chat:
Set up by hand: atr init writes the settings file, and atr snippet prints the entry to add to your app's MCP config.
"No module named 'atr'" on macOS: run chflags nohidden .venv*/lib/python*/site-packages/*.pth, or use the entry from atr snippet.
Limits:
- Online servers that need a sign-in (OAuth) can't go behind ATR yet, so
atr setupleaves them in your app. - ATR lowers what each message costs. It doesn't change your plan's limits.
For developers
Next up: remembering repeated tool calls so the same result isn't sent twice, sign-in support for online servers, and a small local model that summarizes long text when cutting would lose meaning.
License: MIT
來源:README.md,提交 3a9847d
工具
0版本歷史
1- v1.0.0最新Oct 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分