byggarepop avatar

TokenSaver

byggarepop/tokensaver

Roslyn-powered MCP server that strips C# and Razor files down to their logical skeleton before sending them to your AI assistant. Exposes tools like OutlineCSharpFile for signature-only views, FocusMethod to isolate a single function with its dependencies, and cross-project traversal tools like TraceCallers that find every invocation of a method across your codebase. The reduction is dramatic: 89% on outline requests, 95% when focusing on a pair of methods. Works over stdio with Claude Desktop, VS Code, and Visual Studio 2026. Reach for this when you're working in large .NET projects and want to stay under context limits without manually cherry-picking which files to include.

GitHub stars
4
tools
3
transport
STDIO
env vars
2
last updated
Jun 25, 2026

Tools

3 tools

Public tool metadata for what this MCP can expose to an agent.

OutlineCSharpFileSignatures of every type and member — no bodies. Best for "what's in this file?"

Signatures of every type and member — no bodies. Best for "what's in this file?"

No parameter schema in public metadata yet.

MinifyFileLossless minify of an entire file — strips comments and whitespace, logic unchanged. Auto-dispatches by extension (C#, Razor, JS/TS, Python, HTML, CSS, JSON, YAML, XML, C, C++, X++, VB.NET).

Lossless minify of an entire file — strips comments and whitespace, logic unchanged. Auto-dispatches by extension (C#, Razor, JS/TS, Python, HTML, CSS, JSON, YAML, XML, C, C++, X++, VB.NET).

No parameter schema in public metadata yet.

TraceDiRegistrationsFinds every Dependency-Injection registration referencing a type (interface or concrete) and returns a compact table of file:line, method, ServiceType -> ImplType, and key.

Finds every Dependency-Injection registration referencing a type (interface or concrete) and returns a compact table of file:line, method, ServiceType -> ImplType, and key.

No parameter schema in public metadata yet.

Sponsors

Configuration

TOKENSAVER_API_URL

URL of the TokenSaver reporting dashboard. Defaults to https://tokensavermcp.com.

TOKENSAVER_NO_TELEMETRY

Set to 1 to opt out of anonymous usage telemetry.

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


View the full README on GitHub

Details

Repository
github.com/byggarepop/tokensaver
Package
TokenSaver.Mcp
Transport
STDIO
Registry
MCP registry, active