17 min read

How I Set Up Magpie

I spent two days cleaning up the AI agent environments on both my Work and Home Macs. If you only use Magpie as an AI Gateway, you are probably using about 30% of what it can do. Here is how I use it to manage MCP servers, Skills, RTK hooks, Memory, and cross-machine sync.

AIMagpieAgentProductivity

Over the last couple of days, I did a full cleanup of the AI agent environments on both my Work Mac and Home Mac. Looking at the result afterwards, the agent tools, config files, and context overhead on my machines are so much cleaner that I suspect very few people are this obsessive about their local AI setup.

When most people hear about Magpie, their first impression is that it is a local AI Gateway for routing models, aggregating accounts, or switching providers. That is how I used it when I first installed it too. After reorganizing both Macs from scratch, though, I am convinced that if you only use Magpie as an AI Gateway, you are only using about 30% of its capabilities—to the point where calling the gateway feature a bonus does not feel like an exaggeration.

This is not a step-by-step tutorial. It is a record of the local AI management setup I landed on. Everyone has a different tool stack and workflow, so copying everything verbatim will not help much, but the underlying principle transfers cleanly: subtract first to get a clean baseline, then funnel MCP, Skills, Hooks, and Memory into Magpie as a single distribution hub.

Subtract First: Clean Up the Local Environment

Before adopting any unified management tool, step one has to be cleanup. Over the past six months, new AI clients, CLIs, and experimental tools have been dropping every week. You install whatever looks interesting, try it for two days, forget about it, and leave behind background agents, backup directories, and stale configs that silently pile up.

This time I drew a strict line on what gets to stay on both Macs. For desktop orchestration, I use my own maintained fork, T4 Code. For daily CLIs, I kept only five: Codex, Claude Code, Grok, Cursor CLI, and Antigravity (agy), paired with Ego Lite as my default agent browser (reusing logged-in sessions) and Magpie as the central hub. Aside from required internal work CLIs and a handful of small utilities, every experimental client or idle CLI got uninstalled.

The audit uncovered far more leftover junk than I expected:

  • Forgotten multi-gigabyte leftovers: On my Work Mac, a config-switching tool I had not opened in almost four months had a backup directory eating 10 GB on its own. Old IDEs and desktop clients I had uninstalled ages ago still left nearly 10 GB of caches under ~/Library/Application Support and my home directory. My Home Mac was even tighter—only 65 GB free on a 460 GB disk—and the biggest culprits were a duplicate old Xcode (3.6 GB), nine finished worktrees (7.4 GB), and an unused local VM image from Claude Desktop (12 GB).
  • Silent config rot: More than 70% of the trusted project entries in ~/.codex/config.toml pointed to temporary directories that were deleted long ago. ~/.claude.json had 60 to 70 stale project entries as well, alongside dozens of old .zcompdump* completion caches from previous hostnames and several dead LaunchAgents.
  • Hidden cross-tool dependencies: Never delete a folder just because its name looks unfamiliar. I caught three traps before removing anything: T4 Code reuses ~/.t3 and t3code-v2 directly under the hood; Antigravity actually stores its data inside ~/.gemini/, so even after uninstalling gemini-cli you must not delete ~/.gemini; and a local daily cron job hardcoded a script path inside ~/.codex/skills/, so blindly relocating it would have broken the job.

After removing abandoned apps, zombie CLIs, huge leftover caches, and dirty config entries, free disk space jumped from 50 GiB to 111 GiB on my Work Mac and from 65 GiB to 87 GiB on my Home Mac. With a clean foundation, handing things over to Magpie would not sync a pile of garbage along with it.

Using Magpie as the Hub for Local AI

Once reorganized, the architecture on my Macs became a single clean layer: every config, capability, memory entry, and compression hook lives inside Magpie and gets distributed outward to each agent.

Current Architecture: Magpie as the Central Hub Distributing to Core Agents

Tools & Capabilities
17+ MCP Servers
GitHub, Notion, Cloudflare, Figma, RevenueCat, and more.
Skills & Hooks
102 Skills + RTK
High-frequency direct, rest routed on demand; RTK compresses CLI output.
Managed by →
Central Hub
Magpie
MCP Router, Skill Router, Memory, OAuth proxy, plus WebDAV sync every 3 minutes.
MCP Router Skill Router Memory WebDAV
Distributed to →
Primary Clients
5 CLIs + Orchestrator
Codex Claude Code Grok Cursor CLI Antigravity (agy) T4 Code
One magpie MCP entry per client, and ~12 user-facing skill entries.

Both Work and Home Macs connect to the same WebDAV endpoint. Everything stays in sync except Claude login state, which is intentionally isolated.

Within this setup, four capabilities are what make Magpie feel like far more than an AI Gateway.

MCP Router: Authorize Once, Keep One Entry per Agent

Before this, every time I added a new remote MCP server—Notion, Cloudflare, GitHub—I had to edit Codex’s config.toml, then repeat the config across Claude Code, Cursor, and Grok. For any OAuth-backed service, switching to another agent meant clicking through the browser authorization flow all over again. Worse, as your MCP list grows, every fresh session injects dozens or hundreds of tool schemas into the prompt before you even ask a question.

Moving all MCP servers into Magpie’s library and turning on MCP Router completely changes that experience. Adding, updating, removing, and OAuth sign-in happen once inside Magpie. I imported over a dozen services including GitHub, Notion, Cloudflare, and RevenueCat, authorized them once, checked which target agents should receive them, and let Magpie update every client’s config automatically.

With MCP Router enabled, Magpie collapses all routed servers into a single magpie entry pointing to the local /mcp/magpie/hub/<agent> endpoint. Checking my local configs afterwards, Grok, Cursor, and Antigravity really do have just one magpie MCP entry left, while Codex and Claude Code only keep their own native local components alongside it. Tools are discovered and invoked on demand instead of dragging dozens of schemas into every turn.

For special cases—such as remote Figma MCP, which requires the client to complete its own direct authorization—Magpie lets you mark an individual server as direct to bypass the router.

Skill Hub & Router: Stopping Context Explosion

If MCP Router fixes duplicated configs and tool bloat, Skill Hub + Skill Router solves a quieter trap in multi-agent workflows: skill catalogs growing so large that they get silently truncated out of the system prompt.

How Bad It Was Before

Before auditing, I assumed keeping skills in ~/.agents/skills and sharing them via symlinks was tidy enough. Scanning every directory with a script showed that my system prompts were already overflowing on every new session:

  • Forced truncation: Codex’s startup catalog had 146 skills (user, system, and built-in plugins). Just the 116 user and .system entries totaled 41,740 characters (over 10k tokens). To avoid blowing up the prompt, Codex chopped descriptions mid-sentence down to 30,605 characters. Half the trigger boundaries were cut off, leaving the model guessing when to use a skill.
  • Hard budget eviction: Antigravity inside T4 Code enforces a strict character budget for the Skills block in the system prompt. At 51 entries it was already evicting overflow skills completely, making the model blind to them. Meanwhile, the standalone agy CLI scanned 5 directories at once (164 raw hits), leaving 107 skills / 37,756 characters (nearly 10k tokens) after deduplication.
  • Wasted startup tokens: Claude Code and Cursor CLI carried 71 skills (24,926 chars, ~6.2k tokens) and 85 skills (29,748 chars, ~7.4k tokens) respectively. Every new conversation burned 6k to 10k tokens just listing the skill menu.
  • Filesystem sprawl: Across all agent directories I found 120+ broken symlinks, plus installers that had copied 26 skills as physical folders into 8 separate directories—over 200 duplicate folders. Because Codex, Cursor, and agy also scan ~/.agents/skills alongside their own directories, the overlap multiplied quickly.

That is why I gave up hand-maintaining ~/.agents/skills symlinks and moved completely to Magpie Skill Router. Manual management traps you either way: keep everything in a shared directory and every agent suffers context bloat; move low-frequency skills into a cold archive folder and agents cannot see them unless you paste file paths yourself.

Switching to Magpie Router and Renaming the Entry to skills-hub

Magpie hits the middle ground cleanly. I ran magpie library skill where agents to consolidate everything into ~/.config/magpie/library/skills/ and emptied ~/.agents/skills completely to eliminate duplicate scans. Then I turned on magpie library skill router on, marked only the ~10 skills I use every day as direct, and folded the remaining 91 lower-frequency skills behind one aggregated router entry.

Originally that aggregated entry was hardcoded to magpie-skills. I worried that while we know what Magpie is, general AI models might not recognize the product name as clearly as a plain semantic label. I requested support for a custom router skill name, and now I have renamed it to skills-hub. Its frontmatter states plainly that it is the user’s skill index and lists the folded skill names compactly (measured at 1,053 characters, comfortably under Claude Code’s ~1,536-character description limit).

Tiered Skills Strategy: Empty the Shared Folder, Keep High-Frequency Direct + One skills-hub Entry

Magpie Single Source of Truth (102 Active Skills)
High-Frequency Direct vs Folded on Demand
Emptied ~/.agents/skills and removed unused skill packs and 120+ broken symlinks so descriptions stay intact.
10–11 high-frequency (direct) 91 low-frequency (routed)
Synced to →
What Each Core Agent Actually Sees
10–11 Direct + 1 skills-hub
Daily skills (ego-browser, roamrun, check, lark-doc, lark-im) trigger with zero hops; everything else loads on demand via skills-hub.

Measured Results After the Cleanup

The biggest win is not just smaller counts—truncation and budget eviction disappeared completely:

  • Zero truncation and fewer characters: Earlier on Codex, I ran a half-measure test folding 70 bundled skills while leaving 77 direct. The rendered character count actually went up from 30.6k to 37.5k because fewer entries caused Codex to relax its truncation cap and expand the remaining descriptions. Once I cut direct entries down to a dozen, Codex stopped truncating any description at all while dropping total size to 10.3k characters, cutting two-thirds off even the previously truncated version (and Magpie keeps 70+ -slash stubs automatically, so explicit $skill-name calls still work).
  • No more budget eviction: T4 Code Antigravity dropped from hitting its hard cap at 51 skills down to ~12 user entries—zero eviction, while actually gaining access to all 102 skills through skills-hub.
  • 70–80% less startup overhead: Claude Code, Grok, and Cursor converged to 12–13 entries (~7.8k characters, under 2k tokens), with zero broken symlinks left anywhere.

Here are the before-and-after measurements from my Work Mac (10 direct skills + 1 router entry + 1 manual slash skill right after migration; later stabilized at 13 after syncing personal skills from Home):

CLI Tool Before (Skills / Desc Chars) After (Skills / Desc Chars) Change
agy CLI (incl. 16 built-in) 107 / 37.8k 28 (12 user + 16 built-in) / 14.6k -79 skills (-74%), -61% chars
T4 Code Antigravity (incl. 16 built-in) 51 / 15.8k (hard budget trim) 28 (12 user + 16 built-in) / 14.6k Zero eviction, full catalog searchable
Codex CLI (incl. 6 .system) 116 / 41.7k (truncated to 30.6k) 18 (12 user + 6 system) / 10.3k -98 skills (-84%), zero truncation
Claude Code CLI 71 / 24.9k 12 / 7.8k -59 skills (-83%), -69% chars
Grok / Cursor CLI 42 / 85 12 / 12 -71% / -86%

My main concern after folding 91 skills into skills-hub was whether models would fail to find them or hesitate to load them. I ran a blind test in a fresh Claude Code session without mentioning any skill name, simply asking how it would release an iOS app to TestFlight. It immediately went through skills-hub, located the folded ethan-apple-release skill, followed the absolute path in the index to read SKILL.md, and accurately summarized the key rules (“prefer App Store Connect API Key, run read-only preflight checks first, then ship by channel”) without taking a single wrong turn.

Two practical caveats came out of live use. First, do not stuff huge unused skill packs into skills-hub, because the 1,536-character description cap will truncate the tail; deleting 20+ obsolete packs kept all active skill names visible in the frontmatter. Second, keep skills direct if external scripts hardcode their path: on my Home Mac, a cron job invokes ~/.codex/skills/ethan-seo-growth/scripts/run-daily.sh directly, so marking it direct after migrating to Magpie preserved the symlink path and kept the cron job working.

RTK Hooks: Let Magpie Manage Them, Don’t Add Duplicates

When running coding agents all day, the biggest token burn is rarely writing code—it is running a test suite, build, or git command that dumps thousands of lines of terminal output. I use RTK on both Macs to compress command output.

During the audit, I discovered my Home Mac was still stuck on an ancient RTK 0.50.0 with only Codex enabled, while Claude Code, Cursor, and Antigravity were all turned off. The magpie library rtk dashboard shows each agent’s toggle status and cumulative tokens saved at a glance, and magpie library rtk upgrade plus magpie library rtk on <agent> upgraded both Macs to 1.3.0 and enabled all five supported CLIs (Claude Code, Codex, Cursor, Copilot, and Antigravity).

Across tens of thousands of commands on both machines, RTK has saved roughly ten million tokens so far, compressing command output by about 23% on average.

One trap to avoid: do not manually add an RTK hook inside Magpie’s generic custom Hooks menu. Magpie has dedicated built-in RTK management that calls RTK’s native installer for each agent’s protocol. Layering a manual custom hook on top will rewrite the same command twice.

Two-Mac Sync, Memory, and Intentional Isolation

After finishing the cleanup on my Work Mac, I braced myself to redo everything from scratch on my Home Mac. When I connected to it, my existing WebDAV sync had already pulled the entire Magpie library over.

I run Magpie’s automatic WebDAV sync every 3 minutes, covering:

  • Providers, API keys, model routing rules, and usage stats;
  • All 102 Skills and 17+ MCP server definitions;
  • Magpie Memory: I enabled memory on both Macs, and the library now holds 30+ memory cards accumulated across sessions, merged item-by-item over WebDAV so I never have to re-teach my preferences between machines.

Syncing everything blindly is not always better, though. Intentional isolation matters just as much.

I use Claude Code differently on each machine: my Home Mac signs straight into my official Claude subscription, while my Work Mac routes through a local gateway. If Claude Code’s login and model selection synced across machines, switching on one Mac would constantly overwrite the other.

The fix was excluding Claude Code from sign-in sync in Magpie (signInsExcept: ["claude"]) and checking “Do not sync selection to other computers” in Claude Code’s menu on both Macs. Now Home stays on my subscription and Work stays on the gateway, while Skills, MCP servers, and Memory stay 100% aligned.

When I ran hand-over on 7 personal skills unique to my Home Mac and pushed to WebDAV, running magpie webdav now on my Work Mac a few seconds later synced both machines to the exact same 102 skills.

Cloning the Whole Setup on a Brand-New Mac in 10 Minutes

The moment this setup really paid off was realizing how effortless it makes setting up a new Mac in the future.

When moving to a new machine, installing apps never takes long. The painful part is migrating a year’s worth of skills, a dozen MCP servers, OAuth grants, model routes, and personal preferences piece by piece. With everything consolidated in Magpie, onboarding a fresh Mac comes down to three steps:

New Mac Onboarding Path: Install Shells, Pull WebDAV, Flip Three Local Switches

Step 1 · ~10 min
Install Base Apps & CLIs
Install Magpie, T4 Code, Xcode, Ego Lite, RTK, and the five core CLIs without touching configs.
Step 2 · Seconds
Connect Magpie WebDAV
Automatically pulls all 102 Skills, 17+ MCP configs, Magpie Memory, providers, and routing rules.
Step 3 · ~2 min
Local Toggles & OAuth
Enable MCP / Skill Router and RTK, sign in to Claude Code, and re-approve OAuth MCPs.

The boundary between what arrives automatically and what still needs a click is crystal clear:

  • Arrives automatically via WebDAV: All 102 Skills with their direct/routed rules, 17+ MCP definitions and target mappings, 30+ cross-machine Magpie Memory cards, provider API keys, model routing policies, usage stats, and every account login except Claude.
  • Local switches to flip once on the new machine: The global MCP Router toggle, the global Skill Router toggle, and running magpie library rtk on to wire up each CLI’s compression hook.
  • Logins to complete separately: Claude Code (intentionally excluded so each machine decides between official subscription vs gateway), plus OAuth-backed remote MCPs like GitHub, Notion, Cloudflare, RevenueCat, and Figma that need a quick browser sign-in on the new machine.
  • A few fundamentals outside Magpie: 1Password, SSH keys, ~/.zshrc, and local AGENTS.md / CLAUDE.md instruction files. Once I move shared rules into Magpie’s unified instructions later, even that last piece shrinks further.

And even for those few leftover local bits, the moment the new Mac joins T4 Code’s cross-device link, I can sit at my old Mac—or use my phone—and have an already-configured agent remotely inspect and configure the new machine. That is actually how I cleaned up my Home Mac this time: auditing disk usage, deleting 20+ GB of leftovers, upgrading RTK, and syncing skills were all done remotely through T4 Code from my Work Mac and phone.

Install the shells, connect WebDAV, flip two router toggles, and an out-of-the-box Mac matches your daily driver’s full AI setup without digging through dotfiles on your old machine.

What Is Still Rough Around the Edges

Nothing in this setup is perfect yet. Three small rough spots remain:

  1. Externally installed skills are not auto-adopted. In practice, not every skill gets installed through Magpie’s UI—plenty come from npx skills, internal company CLIs, or skill-creator writing directly into ~/.agents/skills/ or an individual agent folder. Right now those new skills do not enter skills-hub automatically, and leaving them in ~/.agents/skills/ causes Codex, Cursor, and agy to scan them directly around the router until I run magpie library skill hand-over. Watching external folders for automatic discovery and one-click adoption with default target-agent rules would make maintenance effortless.
  2. Local switches and OAuth still require per-machine clicks. As noted in the new-Mac flow, the MCP/Skill Router master toggles and remote MCP OAuth tokens are scoped per machine. Fine for two Macs, slightly tedious if you manage more.
  3. Direct vs routed visibility in the UI. Flipping a single skill to direct is a one-liner in the CLI, but in the UI list it is not immediately obvious at a glance which skills are direct and which are folded.

As for Magpie’s “Unified Global Instructions” feature, I have left it blank for now instead of forcing content into it. Once keeping browser rules and model delegation rules synchronized across Claude, Codex, and Antigravity starts feeling repetitive, pulling the common rules into Magpie will be straightforward.

Final Thoughts

Cleaning both Macs end to end freed tens of gigabytes of disk space and shrunk every core CLI’s skill catalog back down to a dozen entries. Before this, stacking agent tools always felt heavier over time, with configs leaking in every direction. Putting everything behind Magpie keeps each client lightweight and takes the dread out of switching machines.

If you run multiple coding agents across more than one computer and currently only use Magpie as a model gateway, try turning on its MCP Router, Skill Router, RTK manager, and WebDAV sync. Start by clearing broken symlinks and duplicate copies, keep your dozen daily skills direct, fold the rest into the router, and run it for two days—you will feel the difference right away.

Comments