Skip to content
LangChain

llmtrim for LangChain

io.github.fkiene/llmtrim

MCP server and proxy that compresses LLM prompts, tool output, and replies to cut token cost.

client:LangChain transport:stdio runtime:npm

Install llmtrim in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "llmtrim": {
            "transport": "stdio",
            "command": "npx",
            "args": ["-y", "@llmtrim/cli"],
        }
})

tools = await client.get_tools()

get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs

llmtrim in other clients