local-llm-mcp
Allows sending prompts and files to a local Ollama server via an OpenAI-compatible API, enabling private and bulk text processing tasks such as summarizing, classifying, translating, or reformatting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@local-llm-mcp Summarize each file in ~/Documents/meeting-notes and write summaries to ~/Documents/summaries"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
local-llm-mcp
An MCP server that lets Claude Code (or any MCP client) hand work to a local LLM behind an OpenAI-compatible API (llama.cpp, llama-swap, mlx-lm, vLLM, LM Studio, Ollama, ...).
Keep using your frontier model for thinking, and send the local model the things it is good for:
Private data that must not leave the machine. Pass file paths; this server reads the files and sends them only to the local LLM. The client model sees the local model's answer, or with
output_pathonly a notice that the answer was written to a file.Bulk, mechanical text work such as summarizing, classifying, translating, or reformatting many files.
Install
Requires uv and a local LLM server with an OpenAI-compatible API.
Claude Code (plugin)
claude plugin marketplace add koyakimu/local-llm-mcp
claude plugin install local-llm@koyakimuWhen the plugin is enabled, Claude Code asks for the base URL (default http://127.0.0.1:8080/v1), the model name
(empty = first model from /v1/models) and an optional API key, which is kept in secure storage.
Change them later in /config.
Codex (plugin)
codex plugin marketplace add koyakimu/local-llm-mcpThen run codex plugin add local-llm@koyakimu (or install it from /plugins). The plugin's server uses
http://127.0.0.1:8080/v1 and the first model from /v1/models; the Codex plugin format has no user settings.
To pick the model, point to another server, or set a timeout, register the server manually instead (below).
Do not add a [mcp_servers.local-llm] table to ~/.codex/config.toml for the plugin's server: Codex reads it as a
separate server without a command and fails to load the config (invalid transport).
Any MCP client (manual)
# Claude Code
claude mcp add --scope user local-llm -e LOCAL_LLM_MODEL=my-model \
-- uvx --from git+https://github.com/koyakimu/local-llm-mcp local-llm-mcp
# Codex
codex mcp add local-llm --env LOCAL_LLM_MODEL=my-model \
-- uvx --from git+https://github.com/koyakimu/local-llm-mcp local-llm-mcpCodex stops a tool call after 60 seconds by default (per its docs), and the first call to a local model can take
longer (model loading, long prompts). For a manually registered server, raise it in ~/.codex/config.toml:
[mcp_servers.local-llm]
tool_timeout_sec = 600Related MCP server: CascadeGateway
Use
Ask things like:
"Summarize each file in ~/Documents/minutes/ in three lines with local_llm and write the summaries to ~/Documents/summaries/"
"Use local_llm to group the errors in ~/logs/app.log by type"
Tool
local_llm(prompt, files=None, output_path=None, system=None, max_tokens=4096, thinking=False)
Argument | Meaning |
| Instruction for the local model. It sees nothing else, so make it self-contained |
| UTF-8 text files appended after the prompt |
| Write the answer to this new file and return only a notice. Existing files are never overwritten |
| Optional system prompt |
| Maximum tokens to generate |
| Sends |
Configuration
Variable | Default | |
|
| OpenAI-compatible base URL |
| first model from | Model name to request |
| none | Sent as |
|
| Limit for prompt + files |
|
| Seconds; the first call may include model loading |
|
| Colon-separated directories that files may be read from and written to |
Safety
The paths come from a model that may be reading untrusted documents, so the server limits what it touches:
Files are read and written only under
LOCAL_LLM_ALLOWED_ROOTS, after resolving symlinks.Any path with a hidden component (
~/.ssh,.env,~/.config, ...) is refused, so keys and settings cannot be pulled into an answer and dotfiles cannot be overwritten.File sizes are checked before reading;
output_pathnever overwrites an existing file.
The answer itself can still contain parts of the input. Use output_path when even the answer should stay local.
Development
uv run --group dev pytest # no LLM needed; the API is mocked
uv run scripts/check_live.py # against a running local LLMLicense
MIT
Available Tools
1 toollocal_llmA
Run a task on a local LLM on this machine. Nothing is sent to the cloud.
Use it for (1) private data that must not leave the machine: pass file paths in files instead of
reading them yourself; this server reads them and only the local model's answer comes back to you;
and (2) bulk, mechanical text work (summarizing, classifying, translating, reformatting) where a smaller
model is good enough. Do not use it for tasks that need strong reasoning or careful code changes.
Files must be under the home directory or /tmp and must not be hidden (no path component starting with ".").
Args: prompt: The instruction for the local model. Write it self-contained; the model sees nothing else. files: Text files to include after the prompt (UTF-8). Total input is capped (~60k characters). output_path: If set, the answer is written to this new file and only a short notice is returned, so even the answer stays out of the conversation. Existing files are never overwritten. system: Optional system prompt. max_tokens: Maximum tokens to generate. thinking: Enable the model's thinking mode, if it has one (slower, sometimes more accurate).
Inputs: prompt (required), files, system, thinking, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of confusion or misselection between tools. Its purpose (run a task on a local LLM) is unambiguous and clearly stated.
With a single tool named `local_llm`, there is no convention to break, so consistency is trivially satisfied. It uses a clear snake_case noun rather than a verb_noun pattern, which is a minor deviation but perfectly readable.
A single, argument-rich tool is a reasonable fit for a narrowly scoped domain like invoking a local LLM, and nothing obvious is bolted on unnecessarily. It sits at the low end of the typical range, but the domain genuinely appears to need only one entry point.
The tool's arguments cover the core lifecycle for its purpose: prompt, context files, output redirection, system prompt, token limit, and thinking mode. Minor gaps exist (e.g. no way to list or select available local models or check readiness), but agents can work around these.
Maintenance
Related MCP Connectors
Text generation over MCP: prose, emails, blog outlines, SQL, humanizing, text diffs, fake data.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables integration of local LLM capabilities with MCP-compatible clients like Claude Desktop, Continue.dev, and Cline. Provides tools for processing text prompts through local language models using a customizable inference function.21-
- AlicenseAqualityBmaintenanceProvides an MCP endpoint that lets clients like Google Antigravity and Claude Desktop dispatch LLM tasks to local GPU models with automatic hardware-adaptive routing and cloud fallback, enabling near-zero token cost execution.34MIT
- AlicenseAqualityBmaintenanceEnables cloud-based MCP clients to delegate privacy-sensitive or large-output tasks to a local LLM, returning sanitized placeholders or digested summaries so private data never leaves the user's network.81MIT
- FlicenseNot gradedqualityAmaintenanceLets an MCP client hand bounded work such as code review, boilerplate, commit messages, format conversion or embeddings to a local or cloud OpenAI-compatible LLM, so file contents never enter the orchestrating model's context and token costs drop. It also provides a second model to sanity-check code and drafts while the main assistant keeps planning and tool use.-