
TokenSaver
io.github.Byggarepop由 GitHub 帳號 Byggarepop 發布v1.15.5更新於 Oct 24, 2026
Structural warm start for AI coding agents in .NET: cheap Roslyn signature maps of C#/.NET files.
概覽
TokenSaver 為 AI 程式助理提供以 Roslyn 為基礎的 C#/.NET 檔案簽章速覽,讓模型只讀取所需的程式碼片段。
- 可以做什麼
- 以簽章形式列出 C# 檔案中所有型別與成員及其行號範圍,不含方法主體
- 無損壓縮整個檔案,移除註解與空白,自動辨識 C#、Razor、JS/TS、Python、HTML、CSS、JSON、YAML、XML、C、C++、X++、VB.NET
- 在專案目錄或 .csproj 中追蹤相依性注入註冊,回傳服務型別對應實作型別的 file:line 精簡表格
- 適用情境
- 適合在 .NET 程式庫中工作的助理,尤其是大型檔案或使用較小、較便宜模型(容易整份讀取)的情境;頂級模型獲益很小。它減少多餘的讀取,並不會提升程式碼品質。
- 執行需求
- 以 stdio 在本機執行,透過 NuGet 套件 TokenSaver.Mcp 安裝並以 dnx 啟動,需要 .NET 工具鏈。選用環境變數 TOKENSAVER_API_URL(報表儀表板網址,預設為 tokensavermcp.com)與 TOKENSAVER_NO_TELEMETRY。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 TokenSaver,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TokenSaver
A structural warm start for AI coding agents in .NET. Instead of loading whole files into your assistant, TokenSaver hands it a cheap map of your code — every type and member as a signature, each tagged with its line range — so the model reads only the slice it needs instead of slurping the file. Built on the Roslyn compiler platform.
Where it pays off: outlining a file costs 70–95% fewer tokens than reading it — up to 90% on a large file. The end-to-end win is biggest on smaller / cheaper models (which over-read the most) and on large codebases: on real tasks it trims a Haiku-class model's token use by ~8%, and the savings climb with file size. A top-tier model already reads tightly, so it sees less benefit — the leaner the model, the more a warm start helps.
Works with Visual Studio 2026 (GitHub Copilot Chat), Claude Code, VS Code Copilot, Claude Desktop, and any other MCP client that speaks stdio.
→ Full docs and setup guide: mcp/README.md
→ Changelog: CHANGELOG.md
Install
See tokensavermcp.com/install for one-click install buttons, per-client config snippets, upgrade/uninstall instructions, and troubleshooting.
What the tools do
Single-file tools
* Reductions are measured against reading the whole file — the real alternative when you'd otherwise load it. The end-to-end saving on a task is smaller, because a capable model already reads somewhat selectively; it is largest on smaller/cheaper models and large files (see Token savings in practice below).
Cross-file traversal tools
These scan an entire project directory in one call — no need to know which file to look in first.
Both accept a directory path or .csproj file — obj/ and bin/ are excluded automatically.
Token savings in practice
Measured against this project's own FocusedEmitter.cs (9,261 tokens raw):
Those are per-read figures versus loading the whole file. The end-to-end saving on a real task is smaller, because a capable model already reads somewhat selectively — and that's the honest part of the story:
The leaner the model, the more it over-reads on its own — and the more a warm start saves. TokenSaver is most worth it for agents running on small/cheap models, large files, or any workflow that would otherwise read whole files. It won't make a top model meaningfully cheaper, and it won't make a model write better code — it curbs wasteful reading, which is where cheap-model token budgets actually leak.
Collective impact
Every invocation is counted at tokensavermcp.com — a live dashboard showing total tokens saved by the community. Fewer tokens processed means less GPU compute and a smaller carbon footprint for AI-assisted development.
Language support
OutlineCSharpFile and TraceDiRegistrations are C# only; MinifyFile works across every supported language.
來源:README.md,提交 d5dd52e
工具
0版本歷史
1- v1.15.5最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分