Unified Local Gateway & Model Router for AI Agents

Magpie AI

A lightweight local gateway built for developers. Seamlessly manages 40+ AI coding tools including Claude Code, Codex, and Gemini CLI, bridging OpenAI, Anthropic, and Gemini protocols with multi-account failover and local prompt sanitization.

Core Features

Designed for real developer frustrations, acting as a stable, secure, and zero-latency local scheduling bridge between your coding agents and model backends.

Unified Agent Hub

Modern workflows often involve multiple terminal and editor assistants. Magpie unifies scattered configuration files into the macOS menu bar and terminal TUI, providing an intuitive model dashboard for instant hot-swapping without configuration clutter.

Shared Subscriptions

Already paying monthly for Claude Pro, ChatGPT Plus, or GitHub Copilot? Magpie securely bridges your active browser sessions into local providers, letting CLI agents tap directly into premium web model quotas, eliminating redundant token expenses.

Local Protocol Gateway

Coding agents strictly depend on specific vendor API formats. Magpie operates a local gateway at 127.0.0.1:3425, translating across Anthropic, OpenAI, and Gemini protocols while preserving streaming reasoning tokens and tool executions with zero delay.

Surgical Config Edits

Generic scripts destructively overwrite config files, wiping out custom comments and shell aliases. Magpie uses AST parsing to modify strictly necessary endpoint and auth keys, leaving all indentation and comments intact with clean one-click restoration.

Pooling & 429 Failover

Complex refactoring runs frequently trigger TPM limits or sudden 429 rate limit errors. Magpie bundles multiple keys into virtual routing groups. When a primary key hits limits, the gateway silently retries on backup routes with zero terminal interruptions.

Local Prompt Masking

To satisfy enterprise compliance and private repo security, Magpie scans code locally before network transmission, replacing database credentials, API tokens, and internal IPs with hashes. Sensitive values are reversibly restored in responses, keeping secrets on-premise.

Why Choose Magpie?

Compare manual config and traditional profile switchers to see how Magpie redefines local AI coding with unmatched elegance and power.

Dimension
Manual Config
CC-Switch
EchoBird
MagpieRecommended
PositioningManual text configs and environment variable maintenanceProfile-swapping desktop tool using config file snapshotsTauri/Rust-based desktop LLM proxy applicationLocal lightweight model gateway & routing hub built for coding agents
Config MethodManually editing JSON/TOML; prone to syntax typos & config corruptionCoarse file overwrite; wipes out existing custom comments and flagsGUI-based configuration changes; manual endpoint assignmentAST-level surgical injection; preserves all comments, 1-click lossless restore
Protocol BridgeNot supported (restricted to each tool's native proprietary format)Not supported (profile manager only, not an active proxy daemon)Basic model format mapping; complex agent streams need custom tuningBidirectional real-time translation; 100% fidelity for Thinking blocks & Bash tools
Web SubsNot supported (strictly requires pay-as-you-go commercial API keys)Not supported (stores commercial API keys only)Not supported (requires standard commercial pay-per-token API keys)Safely mounts web subscriptions (Claude Pro / Plus) with zero extra API fees
429 FailoverZero failover; 429 rate limit abruptly crashes agent workflowsNo active proxy daemon; must manually stop tasks and swap profiles upon 429Desktop GUI supports provider fallback and basic retry rulesVirtual routing groups (group/[id]) with silent 429 failover for continuous long tasks
Agent SupportFragmented; 40+ agents have conflicting config paths and schemasLimited primarily to Claude Code and Codex CLI onlySupports popular CLI tools; limited coverage for emerging agents40+ coding agents natively supported (Claude Code, Cursor, Zed, OpenCode, etc.)
Interface & UXRelies on terminal text editors and messy shell env variablesStandalone desktop window; lacks lightweight menu bar & terminal TUITauri desktop window app requiring a windowed foreground processmacOS menu bar 1-click toggle + Terminal TUI + CLI all included, ~25MB RAM
Data PrivacyPlaintext keys scattered on disk; high risk of accidental Git commitsLocal encrypted storage, but lacks request-level prompt token maskingLocal port proxy without built-in bidirectional token redactionIn-memory bidirectional regex masking & reversible unmasking locally

Unlike error-prone manual configs or basic file-swapping utilities, Magpie unifies a local bidirectional protocol gateway, AST lossless injection, and web subscription reuse into a single 25MB binary—delivering a seamless, cost-effective, and fail-safe coding workflow.

Use Cases

Discover how developers maximize efficiency and eliminate friction with Magpie AI across daily workflows.

Web Subscription Reuse

Safely mount your existing Claude Pro or ChatGPT Plus web login session. Magpie wraps it as a standard local endpoint, letting your CLI agents run without buying extra API tokens.

Budget Model Routing

Run top-tier reasoning models like DeepSeek V4 through Claude Code. Local gateway delivers 100% fidelity for Thinking blocks and automated tool execution at 90% lower cost.

Code Privacy Masking

In-memory bidirectional regex redaction intercepts sensitive keys, internal URLs, and credentials before they hit cloud LLMs, restoring real text only after safe local return.

Unified Multi-Agent Hub

Route Cursor, Zed, Codex CLI, and Claude Code through a single local gateway. Switch to local Ollama clusters or change provider keys with a single click in your menu bar.

Quick Start

No intrusive global environment modifications. A clean, lightweight setup puts all your AI coding CLIs under unified control.

Install Magpie Client

Install quickly via official curl script or Homebrew on macOS; single binaries and TUI are provided for Windows and Linux.

Configure Model Providers

Add DeepSeek, OpenAI, or third-party gateways via CLI commands, or configure keys directly in the macOS menu bar panel.

Connect Coding Agents

Take over Claude Code or Codex with AST-level precision, preserving all original comments, custom environment variables, and structure.

Start Coding Seamlessly

Launch your terminal agent normally. The local gateway handles real-time protocol bridging, Thinking blocks, and tools transparently.

FAQ

Answers to the most common technical questions about getting started with Magpie AI.

1

Which AI coding agents does Magpie AI support?

Magpie natively supports 40+ popular CLI and desktop coding agents, including Claude Code, Claude Desktop, Codex CLI, Gemini CLI, Cursor, Zed, and OpenCode. It automatically unifies scattered configuration directories into one local hub, eliminating redundant configuration files and schema conflicts across tools.

2

How does Claude Code run on third-party models?

Claude Code strictly requires Anthropic Messages format. Magpie runs locally on port 3425, translating OpenAI payloads, streaming SSE blocks, and tool calls seamlessly in real time. This allows you to drive models like DeepSeek or Kimi with 100% fidelity for Thinking reasoning blocks.

3

What is a Routing Group and automatic 429 failover?

Pack multiple backup accounts or alternative providers into a virtual group (e.g. group/deepseek-pool). When rate limits (429) hit or token quotas run out, the local gateway retries fallback routes silently under the hood so long-running coding agents never crash mid-task.

4

How can I reuse Claude Pro or ChatGPT subscriptions?

Many developers already subscribe to Claude Pro or ChatGPT Plus, but official CLI agents require expensive separate pay-per-token API keys. Magpie safely mounts your active web sessions and exposes them as standard local endpoints, allowing CLI tools to run without buying extra API keys.

5

Will Magpie overwrite my existing CLI configs or comments?

Never. Unlike blunt bash scripts that completely overwrite config files, Magpie performs precise AST-level surgical injections. It only updates the required base_url and authorization keys while keeping all custom comments, environment variables, and original indentation fully intact.

6

How do I resolve a port conflict with default port 3425?

If port 3425 is already occupied by another service, you can change it directly in the macOS menu bar panel or pass MAGPIE_PORT=3426 as an environment variable. Magpie automatically updates all connected agent endpoints to the new port without needing manual text edits.

7

Which operating systems and interfaces are supported?

Written in Go with an ultralight ~25MB memory footprint. Magpie natively supports macOS (with an unobtrusive menu bar app), Linux, and Windows. It also includes an interactive terminal TUI and headless CLI for developers working across local desktops and remote servers.

8

Is Magpie AI a fully open-source and free project?

Yes. Created by yetone (author of Avante.nvim) and hosted openly on GitHub (yetone/magpie) under a permissive open-source license. All protocol routing and traffic bridging run 100% locally with zero cloud telemetry, welcoming open community audits and contributions.

Say Goodbye to Messy AI Tool Configs

Install Magpie AI in seconds. Give all your coding agents the freedom to run on any model with zero downtime.