llmtrim — Claude Code MCP server: what it does, how to install
Local proxy and MCP server that compresses context before sending it to LLMs. Trims noisy logs and tool schemas to lower API bills.
claude mcp add llmtrim -- npx -y @llmtrim/cliWhat llmtrim does
llmtrim intercepts agent requests locally to strip out filler data like repeated terminal logs and duplicated tool schemas. Your model receives a significantly leaner payload while original error messages and answers stay intact.
Processing happens entirely on your machine without third-party servers. The daemon provisions a private certificate in ~/.llmtrim/ restricted solely to LLM hostnames and wires into your shell via HTTPS_PROXY. Auth credentials pass directly through without being stored locally.
GitHub Copilot rejects this proxy because of certificate pinning. You inspect session compression metrics directly in your terminal using llmtrim status. When Claude Code is installed, the setup also hooks the /sub command to manage upstream accounts.
What it helps with
- cut API token costs by reducing prompt payload size
- filter noisy terminal output before forwarding to the model
- monitor local context compression metrics across coding sessions
Example prompts for the agent
- Inspect compression gains using
llmtrim status - Repair local proxy configurations with
llmtrim doctor --fix - Run an isolated session through the proxy using
llmtrim wrap claude
How to install llmtrim
Platform CLI
claude mcp add llmtrim -- npx -y @llmtrim/cliPlatform CLI
codex mcp add llmtrim -- npx -y @llmtrim/cliConfig file
{
"mcpServers": {
"llmtrim": {
"command": "npx",
"args": [
"-y",
"@llmtrim/cli"
]
}
}
}Config file
{
"servers": {
"llmtrim": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@llmtrim/cli"
]
}
}
}Platform CLI
gemini mcp add llmtrim npx -y @llmtrim/cliStep 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 llmtrim
How to install llmtrim in Claude Code?
Run claude mcp add llmtrim -- npx -y @llmtrim/cli in your terminal.
What does llmtrim do?
It acts as a local proxy that strips redundant tokens from logs and tool schemas before queries hit the model provider.
Why does the llmtrim proxy fail with GitHub Copilot?
GitHub Copilot enforces certificate pinning, which halts network connections that pass through local proxy certificates.