lcc — Local Context Compiler
Trim old tool outputs from agent context while keeping the rest exactly as written
lcc — Local Context Compiler is a free MCP server for ai models and llm tooling. It runs locally on your machine and is started by your AI client.
- Pricing
- Free
- Platforms
- CLI, Self-hosted, macOS
- Runs
- Locally
- Version
- 1.2.0
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add lcc -- uvx local-context-compilerAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"lcc": {
"command": "uvx",
"args": [
"local-context-compiler"
]
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"lcc": {
"command": "uvx",
"args": [
"local-context-compiler"
]
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"lcc": {
"command": "uvx",
"args": [
"local-context-compiler"
]
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"lcc": {
"type": "stdio",
"command": "uvx",
"args": [
"local-context-compiler"
]
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add lcc -- uvx local-context-compilerOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.lcc]
command = "uvx"
args = ["local-context-compiler"]Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"lcc": {
"command": "uvx",
"args": [
"local-context-compiler"
]
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Or run: gemini mcp add -s user lcc uvx -- local-context-compiler
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "lcc": { "command": "uvx", "args": [ "local-context-compiler" ] } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
About lcc — Local Context Compiler
lcc takes a different route from summary-based compaction. It removes tool outputs the model no longer needs, stores them in a local content-addressed stash, and leaves every user and assistant message byte for byte. A removed block is replaced by a placeholder giving its line count and size, and recall retrieves it by hash, re-checking the hash on read. Each run writes a JSON report, and explain gives the reason for each drop.
The README reports figures from its author's own sessions: one Claude Code session of 193 messages fell from 57,083 to 28,807 tokens with all 43 user and assistant messages intact, while across 299 long sessions the median cut was 21.8%. In a pre-registered test on 172 requests, an agent using the stashed context matched full-context performance on file recall with 36.6% fewer tokens. These are the author's measurements and the README invites readers to run measure-session on their own history.
Default judging runs on the CPU in plain Python with no API key or network. A remote jev provider is opt-in only and needs a TypeSafe key. It installs from PyPI as local-context-compiler (not lcc), also works as a Claude Code plugin that replaces the /compact summary, and serves seven tools over stdio.
Tools this server provides (7)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 2 of 7 tools read data; 5 names don't say.
From the server's own tool labels and tool names; not verified by us.
- compact
- Compact a document or transcript
- compact_transcript
- Compact an agent transcript
- recall
- Retrieve a removed output by hash
- inspectName suggests: reads
- Inspect compaction data
- prepare
- Prepare context for compaction
- explainName suggests: reads
- Explain why blocks were kept or dropped
- intake
- Intake of material for compaction
What it does
- Verbatim compaction
- Kept spans are byte-identical to the source.
- Recallable stash
- Removed outputs live in a local store and return by hash.
- Audit reports
- A JSON report per pass plus an explain command for each drop.
- Offline by default
- Rules and local providers need no API key or network.
- Session measurement
- measure-session prints counts only on your own sessions.
- Claude Code plugin
- Replaces the /compact summary, with fallback to the built-in one on failure.
Good for
- Shrink a long Claude Code session without losing exact error messages
- Compact a document against a stated question
- Measure how many tokens your sessions could save
- Review why each block of context was kept or dropped
Pricing
Free
Free, runs locally on PyPI
lcc — Local Context Compiler FAQ
How do I install lcc — Local Context Compiler?
pip install "local-context-compiler[tiktoken]"; the PyPI name is local-context-compiler, since pip install lcc gets an unrelated package.
Does lcc — Local Context Compiler send my context anywhere?
Not by default. Only the opt-in jev provider contacts the TypeSafe API, and LCC_DISABLE_NETWORK=1 disables it.
Can I get removed output back?
Yes, with recall on the hash shown in the placeholder.
Does the plugin need special settings?
The README says it needs Claude Code 2.1.274 or later with CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1.
Is lcc — Local Context Compiler free?
Yes. lcc — Local Context Compiler is free to use.
How do I add lcc — Local Context Compiler to Claude Code?
Run this command in your terminal: claude mcp add lcc -- uvx local-context-compiler
What are the best alternatives to lcc — Local Context Compiler?
The closest alternatives to lcc — Local Context Compiler are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


