Local Worker MCP
Uses a local Ollama instance (e.g., Gemma 4 12B QAT) to process files, PDFs, logs, and generic tasks, returning compact, verifiable results to reduce token consumption by frontier AIs.
Supports OpenAI-compatible backends (LM Studio, llama.cpp server, vLLM) as the local worker provider, enabling the same delegation and fallback behavior.
Click on "Install 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 Worker MCPextract the key data from this PDF report and summarize findings"
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 Worker MCP
Client-agnostic local MCP. Frontier plans, delegates, and reviews. Local does the heavy, mechanical, and verifiable work.
The goal is to reduce token consumption from paid AIs without dumping raw content into their context.
Codex / Claude / Gemini / Grok
│
▼
Local Worker MCP
│
┌──────┴───────────────┐
▼ ▼
Gemma 4 12B QAT arquivos / PDF
via Ollama extração + evidências
│
▼
resultado compacto e verificável
│
▼
Frontier revisaThis does not replace the main AI and is not a model router. It is real task delegation.
LOCAL DISPONÍVEL? NÃO
│ │
▼ ▼
DELEGA NÃO INSISTE
│ │
▼ ▼
COMPRIME FRONTIER ASSUME
│
▼
FRONTIER REVISAGemma is an optimization. It must never become a single point of failure.
Principle
Delegate when the task is mechanical, repetitive, verifiable, or context-intensive: PDF, logs, CSV, code, extraction, classification, summarization.
Keep on the frontier: architectural decisions, security, critical changes, subjective judgment, ambiguous requirements.
If the local worker is offline, the frontier continues. The MCP returns unavailable quickly and recommends a fallback. The client can log:
Worker local indisponível; executei diretamente.Does not require user intervention.
Related MCP server: ollama-handoff
Requirements
Python 3.10+
Ollama on the same PC or another on the LAN
A local model (recommended: Gemma 4 12B QAT)
Installation
git clone https://github.com/CaioAllgayer/Local-Worker-MCP.git
cd Local-Worker-MCP
python -m pip install -e ".[dev]"
copy .env.example .envOllama + Gemma
Install and start Ollama.
Download the model. The name is not hardcoded — use the actual name from your
ollama list:
ollama list
ollama pull <nome-real-do-gemma>If
LOCAL_LLM_MODELis empty, the worker tries to detect a model whose name containsgemma. Otherwise, it uses the first listed model.Test the endpoint:
curl http://127.0.0.1:11434/api/tags
local-worker statusStart the MCP:
local-worker-mcpSame PC
LOCAL_LLM_PROVIDER=ollama
LOCAL_LLM_BASE_URL=http://127.0.0.1:11434
LOCAL_LLM_MODEL=local vs lan is detected by hostname. 127.0.0.1, localhost, and ::1 are local.
Laptop using the desktop
The worker does not assume localhost. The backend can be on another PC on the LAN.
On the laptop:
LOCAL_LLM_PROVIDER=ollama
LOCAL_LLM_BASE_URL=http://192.168.x.x:11434Replace 192.168.x.x with the current IP of the desktop (ipconfig on Windows, ip a on Linux). There is no fixed IP in the project.
The behavior is the same: fail-fast, circuit breaker, cache, compression.
On the desktop, Ollama must accept connections from the LAN (OLLAMA_HOST=0.0.0.0 environment variable and firewall allowing port 11434).
OpenAI-compatible
LM Studio, llama.cpp server, vLLM, and similar:
LOCAL_LLM_PROVIDER=openai_compatible
LOCAL_LLM_BASE_URL=http://127.0.0.1:1234/v1
LOCAL_LLM_MODEL=...
LOCAL_LLM_API_KEY=Fail-fast and circuit breaker
Defaults:
LOCAL_LLM_CONNECT_TIMEOUT_SECONDS=2
LOCAL_LLM_REQUEST_TIMEOUT_SECONDS=45
LOCAL_LLM_MAX_RETRIES=0
LOCAL_LLM_CIRCUIT_BREAKER_FAILURES=2
LOCAL_LLM_CIRCUIT_BREAKER_COOLDOWN_SECONDS=60Connection refused does not retry. After N failures the circuit opens and subsequent calls return unavailable immediately. After the cooldown, one attempt is allowed.
{
"status": "unavailable",
"fallback_recommended": true,
"reason": "Local LLM endpoint unreachable"
}MCP Tools
Tool | Function |
| provider, endpoint, local/LAN, latency, model, circuit breaker, cache |
| generic task → compact JSON |
| independent tasks in parallel ( |
| TXT, Markdown, CSV, JSON, code, logs |
| extraction by page, chunking, hierarchical synthesis, evidence |
| size, entries, hits, misses, hit rate, expired |
| GC now (TTL → not reused → LRU) |
| delete disposable entries |
The raw file content does not need to enter the paid AI's context. The worker reads, compresses, and returns verifiable evidence (page, line, snippet).
Security
Default: SECURITY_MODE=READ_ONLY, ENABLE_SHELL=false.
SECURITY_MODE=READ_ONLY
ALLOWED_PATHS=C:\Projects,D:\Research
ENABLE_SHELL=falseREAD_ONLY— read-only on authorized paths; write and shell blockedWORKSPACE_WRITE— read/write on authorized paths; shell only ifENABLE_SHELL=trueFULL_LOCAL— more permissive; still blocks destructive commands
Path traversal is blocked. rm, del, format, etc. are refused.
Cache and logs
Persistent cache in ~/.local-worker-mcp/cache, self-cleaning:
CACHE_TTL_DAYS=30
CACHE_MAX_SIZE_GB=10
CACHE_CLEANUP_THRESHOLD_PERCENT=90
CACHE_TARGET_USAGE_PERCENT=80
CACHE_CLEANUP_INTERVAL_HOURS=6Entries are disposable by default. persistent=true preserves important artifacts.
Logs rotate and expire:
LOG_RETENTION_DAYS=14
LOG_MAX_SIZE_MB=250The log does not store the full file content.
Benchmark
local-worker benchmark arquivo.pdfOutput:
Arquivo: arquivo.pdf
Worker: gemma4:12b-qat
Backend: ollama
Endpoint: LAN/local
Tamanho: ...
Tokens originais estimados: ...
Tokens processados localmente: ...
Resultado para frontier: ...
Compressão: ...
Tempo: ...
Cache: HIT/MISSCodex
~/.codex/config.toml or the client's JSON:
{
"mcpServers": {
"local-worker": {
"command": "local-worker-mcp",
"env": {
"LOCAL_LLM_PROVIDER": "ollama",
"LOCAL_LLM_BASE_URL": "http://127.0.0.1:11434",
"ALLOWED_PATHS": "C:\\Projects"
}
}
}
}See examples/codex.json.
Claude Code
claude mcp add local-worker --scope user -- local-worker-mcpOr paste examples/claude_code.json into ~/.claude.json.
In the project's CLAUDE.md / AGENTS.md, teach the policy:
Mechanical tasks and reading large files go to
delegate_pdf/delegate_file/delegate_task. Iflocal_statusor the tool returnsunavailable, execute directly and move on.
Other MCP clients
Any stdio client works. Generic example in examples/generic.json:
{
"mcpServers": {
"local-worker": {
"command": "local-worker-mcp",
"env": {
"LOCAL_LLM_PROVIDER": "ollama",
"LOCAL_LLM_BASE_URL": "http://127.0.0.1:11434"
}
}
}
}Examples
examples/pdf.md— long paper / PDFexamples/code.md— initial repository readingexamples/logs.md— error extraction
Tests
python -m pip install -e ".[dev]"
pytest
ruff check src testsThe suite does not depend on real Ollama/Gemma. Everything is mocked.
What is not included in this MVP
Windows GUI automation, Playwright, complex multi-agent, vector RAG, dashboard, Kubernetes, ML router.
The architecture leaves room for delegate_repo, delegate_git, delegate_browser, etc. in the next phase.
License
MIT.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceOptimizes token costs by intelligently delegating low-complexity tasks to local LLMs via LiteLLM, enabling cost-effective development workflows.31MIT
- AlicenseAqualityBmaintenanceOffloads cheap work from cloud LLM agents to a local Ollama model, reducing costs and keeping frontier models focused on complex tasks.83MIT
- AlicenseBqualityCmaintenanceEnables coding agents like Claude Code and Codex to offload boilerplate generation, summarization, and other bounded text tasks to local or cheap cloud LLMs, keeping the frontier agent in charge of judgment and code edits.92MIT
- Alicense-qualityCmaintenanceEnables AI to delegate boilerplate, drafts, tests, and refactors to free LLM providers, saving tokens and running tasks in parallel.204MIT
Related MCP Connectors
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 38 tools.
Shared distillation cache for AI agents — every fetch ~73-89% fewer tokens via a shared cache.
JSON/YAML, regex, diff, JWT, SQL dialects — the keyless millisecond ops an agent needs mid-task.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaioAllgayer/Local-Worker-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server