lm — Claude Code MCP server: what it does, how to install
This MCP server routes selected coding tasks to a local or hosted model through an OpenAI-compatible endpoint. Use it for reviews, drafts, and bounded background work.
claude mcp add --env HOUTINI_LM_ENDPOINT_URL=<HOUTINI_LM_ENDPOINT_URL> --env HOUTINI_LM_API_KEY=<HOUTINI_LM_API_KEY> --env HOUTINI_LM_MODEL=<HOUTINI_LM_MODEL> --env HOUTINI_LM_PROVIDER=<HOUTINI_LM_PROVIDER> --transport stdio lm -- npx -y @houtini/lmWhat lm does
lm gives Claude Code and other MCP clients a path to local models, OpenAI, LiteLLM, OpenRouter, or another endpoint that follows the OpenAI API shape. The main agent can keep planning and tool use while the server sends a chosen task elsewhere. When code_task_files is used, the houtini-lm process reads the files and returns the other model’s result without placing those files in the main agent’s context.
Typical delegated jobs include code review, test scaffolding, docstrings, commit messages, format conversion, and regex checks. Configuration uses HOUTINI_LM_ENDPOINT_URL, HOUTINI_LM_API_KEY, HOUTINI_LM_MODEL, and HOUTINI_LM_PROVIDER, with the server started by npx -y @houtini/lm. Local inference can take 3-30 times longer than a frontier model, so the setup fits contained jobs better than every turn of a coding session.
What it helps with
- send selected files to a second model for review
- draft test stubs and type definitions
- prepare commit messages or changelog text
- convert content between formats
- sanity-check a regular expression
Example prompts for the agent
- Send
src/auth.tsandsrc/session.tsto the MCP server for a code review, then list the issues found. - Ask the delegated model to draft tests for
src/parser.tsand show me the result. - Have the other model inspect this regular expression and explain the edge cases it finds.
How to install lm
Platform CLI
claude mcp add --env HOUTINI_LM_ENDPOINT_URL=<HOUTINI_LM_ENDPOINT_URL> --env HOUTINI_LM_API_KEY=<HOUTINI_LM_API_KEY> --env HOUTINI_LM_MODEL=<HOUTINI_LM_MODEL> --env HOUTINI_LM_PROVIDER=<HOUTINI_LM_PROVIDER> --transport stdio lm -- npx -y @houtini/lmReplace <…> with your own values
Platform CLI
codex mcp add lm --env HOUTINI_LM_ENDPOINT_URL=<HOUTINI_LM_ENDPOINT_URL> --env HOUTINI_LM_API_KEY=<HOUTINI_LM_API_KEY> --env HOUTINI_LM_MODEL=<HOUTINI_LM_MODEL> --env HOUTINI_LM_PROVIDER=<HOUTINI_LM_PROVIDER> -- npx -y @houtini/lmReplace <…> with your own values
Config file
{
"mcpServers": {
"lm": {
"command": "npx",
"args": [
"-y",
"@houtini/lm"
],
"env": {
"HOUTINI_LM_ENDPOINT_URL": "<HOUTINI_LM_ENDPOINT_URL>",
"HOUTINI_LM_API_KEY": "<HOUTINI_LM_API_KEY>",
"HOUTINI_LM_MODEL": "<HOUTINI_LM_MODEL>",
"HOUTINI_LM_PROVIDER": "<HOUTINI_LM_PROVIDER>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"lm": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@houtini/lm"
],
"env": {
"HOUTINI_LM_ENDPOINT_URL": "<HOUTINI_LM_ENDPOINT_URL>",
"HOUTINI_LM_API_KEY": "<HOUTINI_LM_API_KEY>",
"HOUTINI_LM_MODEL": "<HOUTINI_LM_MODEL>",
"HOUTINI_LM_PROVIDER": "<HOUTINI_LM_PROVIDER>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e HOUTINI_LM_ENDPOINT_URL=<HOUTINI_LM_ENDPOINT_URL> -e HOUTINI_LM_API_KEY=<HOUTINI_LM_API_KEY> -e HOUTINI_LM_MODEL=<HOUTINI_LM_MODEL> -e HOUTINI_LM_PROVIDER=<HOUTINI_LM_PROVIDER> lm npx -y @houtini/lmReplace <…> with your own values
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 lm
How do I install lm in Claude Code?
Run claude mcp add lm -e HOUTINI_LM_API_KEY=<HOUTINI_LM_API_KEY> -- npx -y @houtini/lm. This registers the MCP server with an API key.
What does lm do?
It routes bounded work from Claude Code or another MCP client to a selected local or hosted model. The main agent receives the response and continues the task.
What does the model connection require?
A full setup uses HOUTINI_LM_ENDPOINT_URL, HOUTINI_LM_API_KEY, HOUTINI_LM_MODEL, and HOUTINI_LM_PROVIDER. The endpoint needs an OpenAI-compatible API.