TokenSaver MCP Server

Token-efficient C#, Razor, and .NET file views for AI assistants. 50-95% token reduction via Roslyn.

Local serverstdioPython

What is the TokenSaver MCP server?

Connect TokenSaver to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Token-efficient C#, Razor, and .NET file views for AI assistants. 50-95% token reduction via Roslyn. The tokensaver mcp server is what makes that connection.

What the server does

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.

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • OutlineCSharpFile — Signatures of every type and member — no bodies. Best for "what's in this file?"
  • MinifyFile — Lossless minify of an entire file — strips comments and whitespace, logic unchanged. Auto-dispatches by extension (C#, Razor, JS/TS, Python, HTML
  • TraceDiRegistrations — Finds every Dependency-Injection registration referencing a type (interface or concrete) and returns a compact table of file:line, method

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. TokenSaver's toolset — OutlineCSharpFile, MinifyFile, TraceDiRegistrations — is a fair guide to whether it matches your workflow. It is maintained by Byggarepop; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
OutlineCSharpFileSignatures of every type and member — no bodies. Best for "what's in this file?"
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).
TraceDiRegistrationsFinds every Dependency-Injection registration referencing a type (interface or concrete) and returns a compact table of file:line, method, ServiceType -> ImplType, and key. Answers "where is IFoo wired, and to what?"

Example prompts to try

  • Use TokenSaver to OutlineCSharpFile.
  • Use TokenSaver to MinifyFile.
  • Use TokenSaver to TraceDiRegistrations.

Frequently asked questions

It connects TokenSaver to MCP-compatible AI assistants such as Claude and Cursor, exposing 3 tools (OutlineCSharpFile, MinifyFile, TraceDiRegistrations) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with TokenSaver directly.