MTClaw
Local tool-routing proxy for openclaw/opencode/hermes, accelerating tool calls by up to 7x before forwarding general requests to upstream models.
Local OpenAI-compatible proxy that intercepts agent requests, runs matched user-defined tools directly, and passes everything else through to an upstream model.
OpenClaw Function Router is a local proxy that sits between an AI agent or coding assistant and the large language model the agent normally talks to. It speaks the same API as OpenAI's, so any tool that already supports an OpenAI-compatible base URL (such as OpenClaw, OpenCode, Hermes, or other agent frameworks and IDEs) can point at the router instead of the model and not change anything else.
The README's argument is that for narrow, repeating jobs (file operations, business APIs, internal company workflows, system control), going through a full large model on every call is slow. The router lets you wrap those jobs as named tools. When a user request matches one of your tools, the router runs the tool directly. When it does not match, the request is passed through to the upstream model as if the router were not there. The benchmark numbers given are a 6.85x speed-up in a permissive mode and a 4.99x speed-up in a strict mode that keeps a 100 percent Pass@1 score, both on a 50-task system control benchmark.
Inside the router, several specialised sub-agents do different jobs: a routing sub-agent decides whether a request should go to a tool or pass through to the upstream model, builtin and user-defined tool executors run the matched actions, an optional completion-check sub-agent decides whether the result is final or needs the upstream model to phrase the answer, and the upstream provider handles open-ended reasoning.
The quick start asks the user to clone the repo, run pip install ., then a shell install script that prompts for two LLM endpoints: a routing model that supports tool calling and an upstream model used for general replies. It also asks for API keys, a base directory for tool scripts, and the path to an openclaw.json file so the router can register itself with OpenClaw. There are restart scripts for the router alone and for the full service stack.
The rest of the README explains how to add your own tools. Each tool is a JSON line in functions.jsonl plus a matching wrapper script under ~/.function-router/scripts/. The wrapper reads JSON on standard input and writes JSON on standard output, returning exit code 0 on success. The README gives three worked examples: a weather lookup using a public API, an internal shipment status query, and a service status check that delegates to systemctl.
Where it fits
- Speed up an OpenClaw or OpenCode workflow by routing repeat tasks to local tools
- Expose an internal company API to an AI agent as a named function tool
- Wrap systemctl status checks as a tool the agent can call directly
- Run a strict-mode router that keeps 100% Pass@1 while cutting latency 5x