local-llm-mcp
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 the test results and list any failures."
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
English | 日本語
A thin MCP server for delegating lightweight tasks from Claude Code (or any other MCP-compatible client) to local or cloud LLMs via LiteLLM.
Designed as a general-purpose tool with no dependency on any specific project. Set it up once, and you can reuse the same configuration from any project on your machine.
What is this for?
Claude Code's Task tool (the subagent mechanism) only lets you choose between sonnet, opus, and haiku as the model. It isn't designed to let you use other vendors' models (such as local LLMs) directly as subagents.
Instead of "adding more subagents" to work around this limitation, this tool adds "one more tool" to enable delegation to any LLM.
Claude Code ──(MCP)──> local-llm-mcp ──(HTTP)──> LiteLLM ──> Ollama (local) / cloud APIIt's intended for offloading lightweight tasks that the main agent doesn't need to handle itself — summarizing test results, pre-reading logs, simple classification, and so on.
Related MCP server: litellm-mcp
Prerequisites
This repository provides only the MCP server itself. Setting up Ollama or LiteLLM is out of scope.
Setup
1. Install dependencies
pip install -r requirements.txt2. Configure environment variables
Refer to .env.example and set the LiteLLM endpoint and model name (if you use a .env file, you'll need something like python-dotenv to load it separately; setting the variables directly in your environment also works).
Variable | Description | Default |
| LiteLLM proxy endpoint |
|
| The |
|
| Response timeout (seconds) |
|
3. Register with Claude Code
Registering with the -s user scope makes the tool available from any project on this machine.
Run via uvx (no clone needed — for embedding in other projects)
If uv is installed, you can run it directly without cloning the repository. This is the recommended approach when embedding into another project's setup steps (e.g. Flowrite).
claude mcp add local-llm -s user -- uvx --from git+https://github.com/naka-koma/local-llm-mcp local-llm-mcpOn first run, uv automatically builds the environment including dependencies, so pip install isn't needed.
Use the setup script (recommended for local development)
Runs dependency installation and claude mcp add together.
git clone https://github.com/naka-koma/local-llm-mcp.git
cd local-llm-mcp
# macOS / Linux / Git Bash
bash scripts/setup.sh
# Windows PowerShell
pwsh scripts/setup.ps1Register manually
git clone https://github.com/naka-koma/local-llm-mcp.git
cd local-llm-mcp
pip install -r requirements.txt
claude mcp add local-llm -s user -- python /path/to/local-llm-mcp/server.pyOn Windows, if python's PATH is unreliable, we recommend using the py launcher (C:\Windows\py.exe, which has system-wide PATH set up).
claude mcp add local-llm -s user -- py D:\path\to\local-llm-mcp\server.pyProvided tool
ask_local_llm(prompt: str) -> str
Sends a prompt to an LLM via LiteLLM and returns the response text. On connection errors or timeouts, it doesn't raise an exception — it returns a string describing the error instead.
How to use it in your project
We recommend adding a conditional instruction like the following to the consuming project's CLAUDE.md (or equivalent):
## Using a local LLM
If an MCP tool called `local-llm` is available, lightweight tasks such as
summarizing test results or pre-reading logs may be delegated to it.
Even in an environment where the tool doesn't exist, this has no impact
on this project's behavior (delegation is "use it if it's there," not a
required dependency).License
MIT License. See LICENSE for details.
Available Tools
1 toolask_local_llmA
LiteLLM経由でローカル/クラウドLLMにプロンプトを投げ、返答のテキストを受け取る。
要約・分類・ログの下読みなど、呼び出し元のメインエージェントが 自分でやるまでもない軽量なタスクをオフロードしたいときに使う。
Args: prompt: LLMに渡すプロンプト文字列。
Returns: LLMからの返答テキスト。接続エラーやタイムアウトの場合は、 その旨を説明する文字列を返す(例外は投げない)。
Inputs: prompt (required). 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
With only one tool, there is no possibility of confusion or overlap. The tool's purpose is clearly defined and isolated.
The single tool name 'ask_local_llm' follows a clear verb_object pattern. Naming consistency is trivially maintained with only one tool.
The server has only one tool, which falls below the typical well-scoped range of 3-15 tools. Even though the tool is functional and not trivial, a single-tool server feels incomplete and lacks breadth.
For the stated purpose of offloading lightweight LLM queries, the tool covers the main use case and handles errors gracefully. However, there is no tool to list models or configure parameters, which could be considered minor gaps.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
LLM Orchestration Agent (Mcp)
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that delegates Claude Code subagents to alternative backends such as local models, DeepSeek, or AWS Bedrock, while keeping your Claude Code orchestrator session intact.519MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that lets Claude Code dispatch tasks to the LiteLLM gateway, supporting both local Ollama models and Anthropic models via the gateway.-
- AlicenseAqualityFmaintenanceMCP server for running external coding agents as background tasks inside Claude Code. Supports multiple backends including Codex, Grok, GLM, DeepSeek, and more.7MIT
- AlicenseAqualityCmaintenanceThis MCP server enables LLM hosts to plan large tasks and delegate subtasks to specialized local CLI agents, such as Codex and Claude Code, using tools like delegate_task and get_agent_roster.2MIT