Claude Code Delegate Local logo

Claude Code Delegate Local

MCP server that delegates Claude Code subagents to local models (LiteLLM/llama.cpp/Ollama), DeepSeek, AWS Bedrock, or any OpenAI/Anthropic-compatible backend — without losing the Claude Code orchestrator session.

Install Claude Code Delegate Local

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://api.z.ai/api/anthropic

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Overview

Tools16

What Claude Code Delegate Local lets your agent do. Expand a tool for its parameters.

Self-reported~293 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 45d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars19Stargazers on the source repository.
Last commit1d agoMost recent push to the default branch.
Tools exposed16Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

claude-code-delegate-local

English · Español

MIT

Table of contents

What it solves

delegate-local is an MCP server for Claude Code. Keep Claude Code as the orchestrator and send individual tasks to a local model, a cloud API, Codex CLI, Google Antigravity CLI, or a DeepSeek Harness launcher.

Features

  • Run Markdown agents with file tools and optional shell execution through an HTTP backend.
  • Run independent Markdown agents in a synchronous batch, or submit CLI jobs and watch them in the background.
  • Check backend health and discover agent definitions from the orchestrator.

Quick install

Use Python 3.11 or later, uv, and Claude Code. Choose a gateway below, then run these commands from the repository checkout with the gateway environment flags added to the registration command.

bash
uv sync --locked
claude mcp add delegate-local \
  --scope user \
  -- uv run --directory "$(pwd)" python server.py

Restart Claude Code after registration or changes to the MCP server. Install the watcher on your PATH with uv tool install --force .. Check that the shell used by Claude Code can run delegate-wait --help.

Choose a gateway

GatewayWhen to choose itWhat to configure
Bifrost (recommended)Go gateway designed for low latency. This project uses Bifrost in production.Base URL, optional local URL, API mode, and virtual keys if required.
LiteLLM (code default)Python proxy with a wide provider list.Messages endpoint and proxy key if required. Start with the LiteLLM YAML example.

Set the variables below in the Claude Code MCP server environment using --env NAME=value when registering the server. Set DELEGATE_LOCAL_MODEL if you need to select a different default model alias. The alias must exist on the configured backend.

Bifrost

dotenv
DELEGATE_GATEWAY=bifrost
DELEGATE_BIFROST_URL=https://bifrost.example.invalid
DELEGATE_BIFROST_API=litellm
  • DELEGATE_BIFROST_URL is required. Both URL variables accept HTTP(S) URLs with a host and no embedded credentials.
  • local-* and ornith* aliases use DELEGATE_BIFROST_LOCAL_URL when set, otherwise they use DELEGATE_BIFROST_URL. They use DELEGATE_BIFROST_VK_LOCAL for authentication. All other aliases use DELEGATE_BIFROST_URL and DELEGATE_BIFROST_VK_CODE. Set the relevant virtual keys if your gateway requires them. Requests send a configured key as both a Bearer token and x-api-key.
  • With a base URL, the default DELEGATE_BIFROST_API=litellm sends Anthropic messages to /litellm/v1/messages and OpenAI-format aliases to /litellm/v1/chat/completions. A base ending in /litellm gets /v1/messages appended, and a full /v1/messages endpoint is used as supplied for Anthropic messages. Set DELEGATE_BIFROST_API=openai to send all gateway-routed models to /v1/chat/completions on the selected base, with compatibility suffixes removed.
  • DELEGATE_BIFROST_LOCAL_MAX_TOKENS caps output tokens for local aliases. It defaults to 16384 and accepts integers from 1 to 1000000.

Use the Bifrost environment example for optional settings. The companion Bifrost kit provides ready-made configuration and installers for macOS and WSL2.

LiteLLM

dotenv
DELEGATE_GATEWAY=litellm
DELEGATE_LOCAL_URL=http://localhost:4000/v1/messages
# DELEGATE_LOCAL_KEY=<proxy-key>

LiteLLM is selected when the selector is unset or blank. DELEGATE_LOCAL_URL defaults to the endpoint above. Anthropic-format requests use that endpoint directly. OpenAI-format aliases use /v1/chat/completions on the base derived from it. Set DELEGATE_LOCAL_KEY if your proxy requires authentication. Requests send it as both a Bearer token and x-api-key. Configure provider credentials in the proxy environment.

Startup selection and health checks

Optionally set DELEGATE_GATEWAY_FILE to a nonempty path to override DELEGATE_GATEWAY at startup. Use a regular file owned by the MCP process user with mode 0600, no symlink, and at most 4096 bytes of UTF-8 JSON, such as {"selector":"bifrost"} or {"selector":"litellm"}. An invalid file or an unknown active selector stops startup.

Run local_backend_status to check liveness and available models for the default alias. LiteLLM checks /health/liveliness and /v1/models on the derived base. Bifrost checks /health with a trailing /litellm removed from that base and queries /v1/models on the derived base. With a plain Bifrost base URL, the model query goes to /litellm/v1/models in either API mode.

Configuration

Set these variables in the Claude Code MCP environment.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Claude Code Delegate Local

claude-code-delegate-local is an MCP server that delegates Claude Code subagents to configured alternative model backends, including local models, DeepSeek, AWS Bedrock, MiniMax M3, GLM Coding Plan, and OpenAI- or Anthropic-compatible endpoints. It lets the Claude Code orchestrator keep its existing Anthropic session while routing selected subagents elsewhere.

Install it by cloning the repository, running `uv sync`, registering the server with `claude mcp add`, and restarting Claude Code. The documented setup requires Python 3.11+, uv, Claude Code, and environment variables such as `DELEGATE_LOCAL_URL`, `DELEGATE_LOCAL_KEY`, and `DELEGATE_LOCAL_MODEL`.

It supports local and remote backends including LM Studio, llama.cpp, Ollama, vLLM, LiteLLM, DeepSeek, MiniMax M3, GLM Coding Plan through Z.ai, AWS Bedrock, and OpenAI- or Anthropic-compatible endpoints.

The server routes requests to Anthropic-format `/v1/messages` or OpenAI-format `/v1/chat/completions` endpoints based on the model prefix. It also supports DeepSeek's `reasoning_content` thinking mode and can use a configured default model when the caller does not specify one.

Delegated agents retain tool-calling support through `read_file`, `write_file`, and `run_bash`, using loop semantics described as matching Claude Code's native subagents.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewClaude Code Delegate Local AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/claude-code-delegate-local?style=directory)](https://allmcps.com/mcp/claude-code-delegate-local)
HTML Embed
<a href="https://allmcps.com/mcp/claude-code-delegate-local"><img src="https://allmcps.com/api/badge/claude-code-delegate-local?style=directory" alt="Claude Code Delegate Local on AllMCPs" /></a>