Magpie: Open-Source AI Agent Manager Unifies 45+ Tools with Smart Routing
Open-source tool Magpie centralizes management for 45+ AI coding agents like Claude Code and Codex, providing a local API gateway with protocol translation, multi-account failover across five routing strategies, session persistence, and subscription integration — all via GUI, TUI, or CLI on macOS, Windows, and Linux.
Developer yetone's open-source AI Agent management tool magpie has gained significant traction, reaching over 7,000 GitHub stars. The project addresses a growing pain point: developers now juggle multiple AI coding assistants — Claude Code, Codex, Gemini CLI, and others — each with its own configuration files, API keys, and model settings.
Unified Agent Management for 45+ Tools
Magpie detects locally installed agents and presents them in a single interface where users can assign any compatible model to each agent. The tool currently supports 45+ AI agents . When a model is switched, magpie rewrites the agent's configuration file while preserving comments, ordering, and formatting. A new session then picks up the updated model automatically.
The Profiles feature lets users save multiple complete agent-configuration sets — for example, a low-cost profile and a high-performance profile — and switch between them with one click instead of editing each agent individually. Magpie can also import existing provider configurations from CCSwitch, Claude Code, and Codex to reduce migration effort.
Local API Gateway with Multi-Protocol Support
Beyond agent-level configuration, magpie runs a local API gateway at
127.0.0.1:3425</strong> that simultaneously speaks four protocols:</p>
<ul>
<li>OpenAI Chat Completions</li>
<li>OpenAI Responses</li>
<li>Anthropic Messages</li>
<li>Gemini API</li>
</ul>
<p>The gateway translates between these protocols on the fly, preserving streaming output, tool calls, and reasoning content. This eliminates repetitive per-client configuration when testing different models.</p>
<h2>Multi-Account Scheduling & Automatic Failover</h2>
<p>Magpie groups multiple accounts and models into <strong>routing groups</strong> and applies one of five strategies to select the target for each request:</p>
<ul>
<li><strong>Smart</strong> — prefers subscriptions with remaining quota that are about to reset, minimizing waste.</li>
<li><strong>Order</strong> — uses models in a fixed sequence, falling back when the current one is unavailable.</li>
<li><strong>Rotate</strong> — round-robins across group members.</li>
<li><strong>Usage</strong> — picks the member with the lowest recent usage.</li>
<li><strong>Pace</strong> — dynamically allocates request rate based on remaining quota and reset time.</li>
</ul>
<p>The system also respects <strong>session continuity</strong>: when an account has already processed part of a conversation, magpie tries to keep subsequent requests on that account while its cache remains valuable, reducing context loss from frequent switching. An <strong>intent routing</strong> mode can classify the task with a small model first, then dispatch to the most appropriate execution model.</p>
<h2>Subscription Integration with Reduced Ban Risk</h2>
<p>Magpie integrates <strong>login-based subscriptions</strong> for Claude, ChatGPT, GitHub Copilot, Gemini, Grok, and others into its provider management. Notably, <strong>Claude integration</strong> does not mimic Anthropic's HTTP API; instead, it invokes the local <code>Claude Code CLIbinary, letting the official client handle authentication and token refresh, then bridges tool calls via MCP. This design significantly lowers the risk of triggering Anthropic's abuse-detection systems.
Observability, Plugins & Cross-Platform UIs
Usage dashboard — shows per-provider, per-account, and per-session token consumption, cache hits, cost estimates, balances, and quota windows. Users can set hard limits on API keys for cost control.
Plugin system — supports OpenCode auth plugins and Pi provider extensions; plugins can act as gateway middleware to transform requests and responses.
Interfaces — desktop GUI, menu-bar app, terminal TUI, Web UI, and CLI.
Platforms — macOS, Windows, Linux.
The project is available for download via the link in the article's comment section.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
SmartApe AI
SmartApe's AI technology content account, focusing on cutting-edge AI developments and open-source frontlines.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
