local-executor-mcp

local-executor-mcp

An MCP server that lets a frontier planner (Claude Code) delegate mechanical code-generation subtasks to a local LLM served by llama-swap, to save frontier-model tokens.

Category
访问服务器

README

local-executor-mcp

An MCP server that lets a frontier planner (Claude Code) delegate mechanical code-generation subtasks to a local LLM served by llama-swap, to save frontier-model tokens.

Mental model: Claude Code plans and verifies; the local model does the high-volume, mechanical writing. The split saves tokens because the expensive part — generating large amounts of output — happens on a free local model.

Design choices (and why)

  • Generation-only, stateless. The server never writes files and never runs tests. Claude Code keeps its native file + bash tools for that. This keeps the server portable (no repo coupling, no Windows path pain) and trivial to share.
  • Compact output. The tool returns just the generated artifact plus a short usage footer. (Claude Code warns when an MCP tool output exceeds ~10k tokens, and re-reading huge blobs would eat the token savings.)
  • Model routing built in. A tier argument routes between a quality model and a fast model.
  • Fallback is explicit. On failure the tool returns DELEGATION_FAILED and tells the planner to do the task itself — so a weak local result never blocks you. This is your guardrail against compounding errors.
  • Metrics. Every call is appended to ~/.local-executor-mcp/usage.jsonl (model, tokens, latency, ok/fail) so you can quantify savings later.

Model recommendations (from a typical llama-swap list)

Use Model Why
quality (default) qwen3.6-35b-a3b-q8_0 35B MoE, ~3B active → fast and capable, high-fidelity quant
fast qwen3.5-4b-q8_0 small, quick, for trivial / high-volume tasks
A/B alternative for quality qwopus3.6-35b-a3b-v1-q8_0 if code-tuned, may beat Qwen — measure it

Avoid for code: translation models (hy-mt2-*, tower-plus), the vision model (minicpm-v), and ultra-low quants (iq2_xxs / iq3_xxs).

Build

Requires Node.js 18+.

npm install
npm run build

Quick test (no Claude Code needed)

Confirm the server starts and your backend is reachable:

LOCAL_LLM_BASE_URL=http://10.0.0.42:8080/v1 npx @modelcontextprotocol/inspector node build/index.js

In the Inspector UI, call list_local_models first, then try delegate_code.

Use it from Claude Code

Solo (personal)

claude mcp add local-executor \
  --env LOCAL_LLM_BASE_URL=http://10.0.0.42:8080/v1 \
  --env LOCAL_LLM_MODEL_QUALITY=qwen3.6-35b-a3b-q8_0 \
  --env LOCAL_LLM_MODEL_FAST=qwen3.5-4b-q8_0 \
  -- node /absolute/path/to/local-executor-mcp/build/index.js

Restart your Claude Code session so the tools are discovered.

Team rollout (the point of this project)

Use project scope so the config is checked into git and every teammate gets it automatically. Copy .mcp.json.example to .mcp.json at the repo root and commit it. The first time each teammate opens the repo, Claude Code asks them to approve the server (workspace trust), then it just works.

  • .mcp.json.example — assumes the package is published to npm and runs via npx. Lowest friction; teammates need nothing installed.
  • .mcp.json.vendored.example — no publishing: drop the built server in tools/local-executor-mcp/ inside the repo and point node at it.

The backend URL uses ${LOCAL_LLM_BASE_URL:-...default...} expansion, so each machine can override it via an environment variable without editing the file.

Windows notes

  • Node + npx work fine on Windows for stdio servers like this one.
  • If a teammate hits issues with npx, pre-install once (npm i -g @yourorg/local-executor-mcp) and set "command": "local-executor-mcp".
  • Nothing here touches the filesystem, so there are no path-separator issues.

How to actually drive it (prompt Claude Code like this)

"Plan the module. For the boilerplate parts — the Odoo model fields, the XML views, and the security CSV — use the delegate_code tool with a precise spec and the relevant context, then review what comes back and run the tests."

Good delegation targets: boilerplate, scaffolding, CRUD, test stubs, format conversions, Odoo models/views/manifest/ir.model.access.csv, bulk rule-based edits. Keep logic, debugging, and security-sensitive code on Claude.

Inspect your savings

cat ~/.local-executor-mcp/usage.jsonl

Each line records the model, token counts, latency and success. Aggregate it to get "X tokens / Y% of a representative workload handled locally at Z% fallback rate" — a quantified, defensible impact claim.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选