local-delegate — Claude Code MCP server: local LLM for grunt work
An MCP server that hands mechanical text jobs to a local OpenAI-compatible LLM. Large files are read server-side, so they never fill Claude's context window.
claude mcp add --env LOCAL_DELEGATE_BASE_URL=<LOCAL_DELEGATE_BASE_URL> --env LOCAL_DELEGATE_API_KEY=<LOCAL_DELEGATE_API_KEY> --transport stdio local-delegate -- uvx local-delegate-mcpWhat local-delegate does
local-delegate talks to any OpenAI-compatible endpoint: llama-swap, Ollama, LM Studio, vLLM. You call an MCP tool and pass path instead of text, so the file is read on the server. Only the short answer comes back, which keeps the document out of your context window and off Claude's plate.
Two ways to run it: stdio, or a shared HTTP daemon. The daemon serves MCP at http://127.0.0.1:9393/mcp and a dashboard at http://127.0.0.1:9393/ showing backend state, RAM and VRAM use, context tokens saved, and recent delegations. With several sessions or clients on one machine, a single daemon avoids duplicate MCP processes.
local-delegate install writes the MCP entry, hooks, a skill and a delegation rule into CLAUDE.md or AGENTS.md. It is idempotent, keeps .bak copies, and local-delegate uninstall reverts it. Watch the client timeouts: Codex kills an MCP tool call at 60 s, and Claude drops an HTTP call after 5 minutes of silence. The tool_timeout_sec value in config.toml has to be restored after every install or update, since both rewrite that block.
What it helps with
- summarise a huge log without burning Claude context
- classify a batch of texts on a local model
- pull fields out of documents into a fixed schema
- generate repetitive boilerplate off the subscription quota
- share one local GPU across several MCP clients
Example prompts for the agent
- Read
logs/build.logand list only the error lines - Extract invoice number, date and total from
invoices/into a table - Tag these texts by category using the local model
How to install local-delegate
Platform CLI
claude mcp add --env LOCAL_DELEGATE_BASE_URL=<LOCAL_DELEGATE_BASE_URL> --env LOCAL_DELEGATE_API_KEY=<LOCAL_DELEGATE_API_KEY> --transport stdio local-delegate -- uvx local-delegate-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from local-delegate-mcp <command>
Platform CLI
codex mcp add local-delegate --env LOCAL_DELEGATE_BASE_URL=<LOCAL_DELEGATE_BASE_URL> --env LOCAL_DELEGATE_API_KEY=<LOCAL_DELEGATE_API_KEY> -- uvx local-delegate-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from local-delegate-mcp <command>
Config file
{
"mcpServers": {
"local-delegate": {
"command": "uvx",
"args": [
"local-delegate-mcp"
],
"env": {
"LOCAL_DELEGATE_BASE_URL": "<LOCAL_DELEGATE_BASE_URL>",
"LOCAL_DELEGATE_API_KEY": "<LOCAL_DELEGATE_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from local-delegate-mcp <command>
Config file
{
"servers": {
"local-delegate": {
"type": "stdio",
"command": "uvx",
"args": [
"local-delegate-mcp"
],
"env": {
"LOCAL_DELEGATE_BASE_URL": "<LOCAL_DELEGATE_BASE_URL>",
"LOCAL_DELEGATE_API_KEY": "<LOCAL_DELEGATE_API_KEY>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from local-delegate-mcp <command>
Platform CLI
gemini mcp add -e LOCAL_DELEGATE_BASE_URL=<LOCAL_DELEGATE_BASE_URL> -e LOCAL_DELEGATE_API_KEY=<LOCAL_DELEGATE_API_KEY> local-delegate uvx local-delegate-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from local-delegate-mcp <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 local-delegate
How do I install local-delegate in Claude Code?
Run claude mcp add local-delegate -e LOCAL_DELEGATE_API_KEY=<LOCAL_DELEGATE_API_KEY> -- uvx local-delegate-mcp. To point at your own backend address, use the variant with --env LOCAL_DELEGATE_BASE_URL=<LOCAL_DELEGATE_BASE_URL> and --transport stdio.
What does local-delegate do?
It exposes text tasks as MCP tools that run on a local LLM. The file is read server-side and only the result returns to the client.
Why do my calls time out on Claude or Claude?
Claude cuts an MCP tool call at 60 s, and Claude closes an HTTP call after 5 minutes without a response. Raise the limits with tool_timeout_sec in config.toml and the CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT variable.