
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 分