Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP File Compactionread_file src/lib.rs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP File Compaction
An MCP server that reduces Claude context window costs by automatically summarizing files to their public interfaces.
The Problem
When Claude works on large tasks across multiple files, the context window grows continuously. Each API request costs based on the full size of the context, not just new tokens. This leads to quadratic cost growth:
Implement
ptr.rs(2KB) → Context: 2KBImplement
raw_page.rsusingptr.rs(3KB) → Context: 5KBImplement
paged_pool.rsusing both (4KB) → Context: 9KB
After finishing a file, Claude doesn't need the full implementation—just the public interface (structs, functions, traits).
The Solution
This MCP server:
Tracks the "active" file — the one you're currently editing (full contents)
Auto-summarizes inactive files — when you switch files, the previous one is summarized to just its public API
Uses AST parsing — deterministic, fast, no LLM calls for summarization
Handles unsupported languages gracefully — returns full contents without tracking
Installation
From GitHub (recommended)
Local development
Configuration
Add to your Claude Code MCP settings:
Or for local development:
Add to your CLAUDE.md:
Tools
read_file
Read a file and mark it as the active file. When you switch to a different file, the previous file is automatically summarized.
peek_file
Get a summary of a file's public interface without changing the active file. Useful for checking APIs.
edit_file
Edit a file by replacing a specific string. The file becomes (or remains) the active file.
write_file
Write content to a file, creating it if needed. The file becomes the active file.
file_status
Show all tracked files with size comparison and savings.
forget_file
Remove a file from tracking entirely.
Supported Languages
Currently supported for summarization:
Rust (.rs) — extracts public structs, enums, traits, functions, type aliases, constants, and re-exports
Unsupported file types are read/edited normally without tracking—they won't interfere with compaction.
How Summaries Work
For a Rust file like:
The summary becomes:
Private items, implementation details, and doc comments are condensed—only the public interface remains.
License
MIT