LatentGate — Claude Code MCP server: what it does, how to install
Local MCP server that trims logs and JSON payloads before sending them to LLM context. Runs offline without API keys to cut token usage.
claude mcp add latent-gate -- uvx latent-gateWhat LatentGate does
LatentGate filters heavy error logs and structured data dumps before they reach the model. It operates deterministically. Web links and raw code snippets stay untouched byte for byte.
The default optimization folds repetitive logs into summary ranges showing first and last items. Because of this, unique identifiers inside folded blocks are dropped. You have to switch to level="lossless" if you need every line preserved.
Running the tool requires Python 3.10+ and the uvx runner. Initial dependency fetching takes extra time before later starts stabilize at two seconds. It also integrates with Ollama for vision tasks and exports metrics to Prometheus.
What it helps with
- shrink repetitive application logs before feeding them to the agent
- reduce context token consumption on heavy JSON payloads
- clean long documents without losing code blocks or URLs
- process bulky prompt context locally without external API keys
Example prompts for the agent
- Inspect
app.logthrough LatentGate and identify why checkout failed - Compress
data.jsonand summarize the error payload - Parse repetitive log lines in
service.logusing lossless mode
How to install LatentGate
Platform CLI
claude mcp add latent-gate -- uvx latent-gateuvx runs the command named after the package; if the README names another one, use uvx --from latent-gate <command>
Platform CLI
codex mcp add latentgate -- uvx latent-gateuvx runs the command named after the package; if the README names another one, use uvx --from latent-gate <command>
Config file
{
"mcpServers": {
"latentgate": {
"command": "uvx",
"args": [
"latent-gate"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from latent-gate <command>
Config file
{
"servers": {
"latentgate": {
"type": "stdio",
"command": "uvx",
"args": [
"latent-gate"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from latent-gate <command>
Platform CLI
gemini mcp add latentgate uvx latent-gateuvx runs the command named after the package; if the README names another one, use uvx --from latent-gate <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about LatentGate
How to install LatentGate in Claude Code?
Run claude mcp add latent-gate -- uvx latent-gate in your terminal. You need uv installed so uvx can fetch the package.
What does LatentGate do?
It prunes redundant text from logs and JSON files before your coding agent processes them. It shrinks token usage while keeping URLs and code blocks intact.
Does LatentGate discard critical log data?
Default settings fold near-identical log lines into ranges, which drops individual IDs between the first and last line. For zero data loss, the lossless setting removes only whitespace and identical duplicates.