Skip to content
MCP server

ReToken

Local proxy and MCP retrieval server that trims repeated coding-agent tool output

Runs locally

ReToken is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
macOS, Linux, Windows
Runs
Locally
What it can do
Read-only
Version
1.3.0
Listing updated

Similar MCP servers

Install

You install MCP servers on a computer. Send yourself the link.

In Claude Desktop → Settings → Extensions

https://github.com/AshleyImmanuel/ReToken/releases/download/v1.3.0/retoken.mcpb

Download the bundle and open it with Claude Desktop, or drag it onto Settings → Extensions and click Install. This server is only published as a Claude Desktop bundle.

Claude Desktop setup guide

Using several servers? Build one config file with the MCP config generator.

About ReToken

ReToken sits between a coding agent and its model provider on your own machine, shortening long build, test and log output before it is sent again on later turns. Errors and summaries are kept, and every shortened block gets a handle so the agent can later fetch the original lines through its retrieval tool.

The proxy listens on loopback only and forwards requests with your existing credentials, so no ReToken account is involved. It also places Anthropic prompt-cache breakpoints so repeated history is billed at the cached rate. Its benchmark on short Claude Code tasks reported lower average cost per task, though the author notes the sample is small and results depend on workload and provider cache.

The tool suits developers who run Claude Code, Codex CLI or similar agents on long, log-heavy sessions and want to cut token spend without losing access to original output. Originals are stored locally for seven days of inactivity, and they may include source code and logs.

Tools this server provides (1)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, all 1 tool only read data.

From the server's own tool labels and tool names; not verified by us.

retoken_retrieveName suggests: reads
Recovers saved originals of shortened tool output by handle, text search or line range from the local store.

What it does

Shortened tool output
Large build, test and log results are trimmed while errors, assertion details and test summaries stay in place.
Recoverable originals
Each shortened block carries a handle that the agent can use to search for text or read a line range from the saved original.
Anthropic cache breakpoints
The proxy sets prompt-cache markers so that unchanged conversation history is reused at the cached rate.
Local loopback proxy
The proxy binds to 127.0.0.1 and forwards each request to the provider the agent already uses, with its own credentials.
Command wrapper
The exec command runs a shell command and prints its output with noise removed, keeping the exit code.
Cost statistics
A stats command reports tokens saved, cache hit ratio and data transferred for the running proxy.

Good for

  • Cut token costs on long Claude Code sessions with repeated test runs
  • Let a Codex agent search or re-read omitted lines from a long test log
  • Keep noisy command output out of an agent's context with retoken exec
  • Measure cache hit ratio and token savings across a coding workflow

Pricing

Open source

Open source under the MIT license; no paid plan listed.

Prices change. Check ashleyimmanuel.github.io before you buy.

ReToken FAQ

Does ReToken require an account?

No. The retrieval server reads the local store and the proxy uses the agent's own provider credentials, and the server requires no ReToken account.

Where are shortened outputs stored?

Originals are stored under the data directory in a ccr folder and are removed after seven days of inactivity when cleanup runs.

Which operating systems are supported?

Linux, macOS and Windows are supported, with prebuilt archives for Linux x86_64, macOS Intel and Apple Silicon, and Windows x86_64.

Does the proxy change Codex requests?

Currently no. The proxy forwards Codex Responses requests unchanged, and the retrieval tool is the part that helps with Codex.

Is ReToken free?

Yes. ReToken is open source, so you can use and self-host it for free.

What are the best alternatives to ReToken?

The closest alternatives to ReToken are Tokenectomy Razor, Tokenectomy Razor, llmtrim, Token Optimizer MCP and Compress-token.

Where this comes from

  • Description: written from the project's README, the project's website and its MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers