Local Worker MCP
Local Worker MCP
클라이언트에 구애받지 않는 로컬 MCP. 프론티어는 계획하고, 위임하고, 검토합니다. 로컬은 무겁고, 기계적이며, 검증 가능한 작업을 수행합니다.
목표는 유료 AI의 토큰 소비를 줄이면서, 원시 콘텐츠를 그들의 컨텍스트에 집어넣지 않는 것입니다.
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 revisa이는 주 AI를 대체하지 않으며 모델 라우터가 아닙니다. 실제 작업 위임입니다.
LOCAL DISPONÍVEL? NÃO
│ │
▼ ▼
DELEGA NÃO INSISTE
│ │
▼ ▼
COMPRIME FRONTIER ASSUME
│
▼
FRONTIER REVISAGemma는 최적화입니다. 절대 단일 실패 지점이 될 수 없습니다.
원칙
작업이 기계적, 반복적, 검증 가능하거나 컨텍스트 집약적인 경우( PDF, 로그, CSV, 코드, 추출, 분류, 요약) 위임합니다.
프론티어에 유지: 아키텍처 결정, 보안, 중요 변경, 주관적 판단, 모호한 요구사항.
로컬 워커가 오프라인이면 프론티어는 계속됩니다. MCP는 빠르게 unavailable을 반환하고 폴백을 권장합니다. 클라이언트는 기록할 수 있습니다:
Worker local indisponível; executei diretamente.사용자 개입이 필요하지 않습니다.
Related MCP server: ollama-handoff
요구사항
Python 3.10+
동일한 PC 또는 LAN의 다른 PC에 있는 Ollama
로컬 모델 (권장: Gemma 4 12B QAT)
설치
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
Ollama를 설치하고 시작합니다.
모델을 다운로드합니다. 이름은 하드코딩되지 않았습니다 — 실제 이름을
ollama list에서 사용하세요:
ollama list
ollama pull <nome-real-do-gemma>LOCAL_LLM_MODEL이 비어 있으면 워커는 이름에gemma가 포함된 모델을 감지하려고 시도합니다. 그렇지 않으면 첫 번째 목록의 모델을 사용합니다.엔드포인트를 테스트합니다:
curl http://127.0.0.1:11434/api/tags
local-worker statusMCP를 시작합니다:
local-worker-mcp동일 PC
LOCAL_LLM_PROVIDER=ollama
LOCAL_LLM_BASE_URL=http://127.0.0.1:11434
LOCAL_LLM_MODEL=local vs lan은 호스트 이름으로 감지됩니다. 127.0.0.1, localhost 및 ::1은 로컬입니다.
노트북이 데스크톱을 사용하는 경우
워커는 localhost를 가정하지 않습니다. 백엔드는 LAN의 다른 PC에 있을 수 있습니다.
노트북에서:
LOCAL_LLM_PROVIDER=ollama
LOCAL_LLM_BASE_URL=http://192.168.x.x:11434192.168.x.x를 데스크톱의 실제 IP로 바꾸세요 (Windows에서는 ipconfig, Linux에서는 ip a). 프로젝트에 고정 IP는 없습니다.
동작은 동일합니다: 빠른 실패, 차단기, 캐시, 압축.
데스크톱에서 Ollama는 LAN 연결을 허용해야 합니다 (OLLAMA_HOST=0.0.0.0 변수 및 방화벽에서 포트 11434 열기).
OpenAI 호환
LM Studio, llama.cpp server, vLLM 및 유사:
LOCAL_LLM_PROVIDER=openai_compatible
LOCAL_LLM_BASE_URL=http://127.0.0.1:1234/v1
LOCAL_LLM_MODEL=...
LOCAL_LLM_API_KEY=빠른 실패 및 차단기
기본값:
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=60연결 거부는 재시도하지 않습니다. N번 실패 후 회로가 열리고 다음 호출은 즉시 unavailable을 반환합니다. 쿨다운 후 한 번의 시도가 허용됩니다.
{
"status": "unavailable",
"fallback_recommended": true,
"reason": "Local LLM endpoint unreachable"
}MCP 도구
도구 | 기능 |
| 제공자, 엔드포인트, 로컬/LAN, 지연 시간, 모델, 차단기, 캐시 |
| 일반 작업 → 간결한 JSON |
| 독립적인 작업을 병렬로 처리 ( |
| TXT, Markdown, CSV, JSON, 코드, 로그 |
| 페이지별 추출, 청킹, 계층적 합성, 증거 |
| 크기, 항목, 히트, 미스, 히트율, 만료됨 |
| 지금 GC (TTL → 재사용 안 함 → LRU) |
| 폐기 가능한 항목 삭제 |
파일의 원시 내용은 유료 AI의 컨텍스트에 들어갈 필요가 없습니다. 워커가 읽고, 압축하고, 검증 가능한 증거(페이지, 줄, 발췌)를 반환합니다.
보안
기본값: SECURITY_MODE=READ_ONLY, ENABLE_SHELL=false.
SECURITY_MODE=READ_ONLY
ALLOWED_PATHS=C:\Projects,D:\Research
ENABLE_SHELL=falseREAD_ONLY— 허용된 경로에서만 읽기; 쓰기 및 셸 차단WORKSPACE_WRITE— 허용된 경로에서 읽기/쓰기;ENABLE_SHELL=true인 경우에만 셸 허용FULL_LOCAL— 가장 허용적; 여전히 파괴적인 명령 차단
경로 탐색이 차단됩니다. rm, del, format 등은 거부됩니다.
캐시 및 로그
~/.local-worker-mcp/cache에 있는 지속적 캐시, 자동 정리:
CACHE_TTL_DAYS=30
CACHE_MAX_SIZE_GB=10
CACHE_CLEANUP_THRESHOLD_PERCENT=90
CACHE_TARGET_USAGE_PERCENT=80
CACHE_CLEANUP_INTERVAL_HOURS=6항목은 기본적으로 폐기 가능합니다. persistent=true는 중요한 아티팩트를 보존합니다.
로그는 순환하고 만료됩니다:
LOG_RETENTION_DAYS=14
LOG_MAX_SIZE_MB=250로그는 파일의 전체 내용을 저장하지 않습니다.
벤치마크
local-worker benchmark arquivo.pdf출력:
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 또는 클라이언트의 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"
}
}
}
}examples/codex.json을 참조하세요.
Claude Code
claude mcp add local-worker --scope user -- local-worker-mcp또는 examples/claude_code.json을 ~/.claude.json에 붙여넣으세요.
프로젝트의 CLAUDE.md / AGENTS.md에서 정책을 가르치세요:
기계적 작업 및 대용량 파일 읽기는
delegate_pdf/delegate_file/delegate_task로 보냅니다.local_status또는 도구가unavailable을 반환하면 직접 실행하고 계속 진행합니다.
기타 MCP 클라이언트
모든 stdio 클라이언트가 작동합니다. 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/pdf.md— 논문 / 긴 PDFexamples/code.md— 저장소 초기 읽기examples/logs.md— 오류 추출
테스트
python -m pip install -e ".[dev]"
pytest
ruff check src tests테스트 스위트는 실제 Ollama/Gemma에 의존하지 않습니다. 모두 모킹됩니다.
이 MVP에 포함되지 않는 것
Windows GUI 자동화, Playwright, 복잡한 멀티에이전트, 벡터 RAG, 대시보드, Kubernetes, ML 라우터.
아키텍처는 delegate_repo, delegate_git, delegate_browser 등을 다음 단계를 위해 공간을 둡니다.
라이선스
MIT.
Available Tools
8 toolscache_cleanupA
Run cache garbage collection now (TTL, unused, then LRU).
Inputs: no named parameters.
cache_clearA
Delete disposable cache entries. Persistent artifacts stay unless include_persistent=true.
Inputs: include_persistent.
cache_statsB
Cache size, entry count, hits, misses, hit rate, and expired entries.
Inputs: no named parameters.
delegate_batchB
Run independent local tasks in parallel. One failure does not cancel the batch.
Inputs: tasks (required).
delegate_fileC
Have the local worker read a file (txt/md/csv/json/code/log) without loading it into frontier context.
Inputs: path (required), objective (required), persistent, output_mode, +1 more.
delegate_pdfC
Extract, chunk, and analyze a PDF locally. Returns compact findings with page evidence.
Inputs: path (required), objective (required), persistent, output_mode, +1 more.
delegate_taskC
Delegate a mechanical task to the local worker. Returns compact structured output.
Inputs: objective (required), context, persistent, force_refresh, +2 more.
local_statusA
Check local worker health: provider, endpoint, model, circuit breaker, cache.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clear, distinct purpose: health check, task delegation, batch processing, file reading, PDF analysis, cache statistics, cleanup, and clearing. There is no overlap in functionality, making it easy for an agent to select the appropriate tool.
All tool names follow a consistent verb_noun pattern (e.g., local_status, delegate_task, cache_stats). The naming is predictable and clear, with verbs like 'delegate' and 'cache' used consistently to indicate the action and domain.
With 8 tools, the count is appropriate for the server's purpose of managing a local worker and its cache. The scope is well-defined without being too thin or overly broad.
The tool surface covers the key operations: health checks, task delegation (including batch and file processing), and cache management (stats, cleanup, clear). A minor gap is the lack of a tool to update or cancel a delegated task, but the core workflows are well supported.
Maintenance
Related MCP Connectors
Reduces AI Agent token usage by 40% via three-stage SOP workflow.
Up to 90% fewer tokens: deterministic, declared tool calls, each with a receipt and an audit trail.
Deterministic AI agent microtools, no accounts/API keys. fetch_extract: 98% token cut. 47 tools.
Shared task layer for AI agents: tasks, handoffs and decisions that persist across tools.
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.894 PyPI3MIT
- AlicenseBqualityDmaintenanceEnables 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.93MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to hand off bulk, mechanical, read-heavy tasks to a local model, including agentic loops that can read, write, and run commands sandboxed at zero cloud token cost.MIT