I like using more than one AI agent. Claude is the one I plan, write and design with. GrokBot is the one I send out to work through a website. The problem is they can't see each other's chats, so I became the messenger: copy, paste, explain the same job again.
I got tired of that, so I built codelegate, an open-source MCP server that gives them a shared desk. They can keep shared context, hand each other a task with the full background, and send back a result that says what was checked and what wasn't. It runs on your own free Supabase project. I built it with Claude, and the commits say so.
If you also juggle more than one agent, here is how it works, how to set it up in about 30 minutes, and where I'd like a second pair of eyes.
The problem
Every agent lives in its own chat. Claude doesn't know what GrokBot found an hour ago, and GrokBot doesn't know what Claude and I decided this morning. So I carried it. Copy the plan out of one chat, paste it into the other, explain the background again, wait, copy the answer back, fix the bit that got lost on the way.
I counted it once for a single job: nine trips back and forth and about 75 minutes. Most of that wasn't the work. It was me being the clipboard.
What I built
codelegate is one MCP server that all your agents connect to, each with its own key. It gives them:
- Shared memory. Decisions, facts, artifacts and a running summary per workstream. Any connected agent can read them.
- Handoffs. One agent gives another a task with the full context. The other claims it, does it, and sends back a result.
- Honest results. A result has to say what was checked and what wasn't. "Done" is refused unless everything relevant was checked. Partial answers are marked unverified, and if a result gets corrected later, the agent that asked hears about it.
- Wake-ups, only if you want them. Tasks wait in a queue by default. Mark one urgent and only the bot that owns it gets woken by webhook.
- Files. Images, videos and docs up to 50 MB, through private links that expire.
The honest-results part is the one I care about most. An agent saying "done" when it only looked at half the sources is worse than no answer, because you trust it.
How a handoff works
There's one difference between agents that matters here: can something outside start them, or not?
GrokBot can be woken. It runs routines, so codelegate can poke it with a webhook. Claude, Cursor, Codex and ChatGPT can't be started from outside. They only act inside a chat or run you start.
So there are two kinds of handoff:
- To a wakeable agent (GrokBot): Claude hands off the task and names which bot owns it. If it's urgent, codelegate wakes just that bot. Otherwise it waits. GrokBot claims it, does the work, and reports back what it checked and what it didn't.
- To an on-demand agent (Claude): GrokBot hands off the task and it waits in the queue. Next time I'm in Claude I say "check codelegate tasks", or a scheduled task does it, and Claude picks it up.
Either way, the sender sees the result on its next codelegate call.
Day to day I mostly say four things in whichever agent I'm in: "log it", "catch up", "check codelegate tasks", and "hand this to GrokBot" (or Claude).
How I built it with Claude
I set the problem and made the design calls: what a task looks like, what a result has to contain, when an agent is allowed to wake another. Claude wrote most of the MCP server, the setup playbook and the diagrams. The commits are co-authored by Claude and I've left them that way.
Under the hood it's a Supabase Edge Function (Deno) over a private Postgres schema. Nothing is exposed except the function, and keys are stored only as hashes.
Setup
You don't need to know Supabase or MCP. Open Claude, Cursor, Codex, ChatGPT or whichever assistant you use, paste the repo link, and say "Set up codelegate for me."
It reads SETUP.md, asks which agents you want to connect, and walks you through each step with a check after each one. A few steps you do yourself in the browser, like signing in and approving things. It takes about 30 minutes, often less. If you'd rather do it by hand, SETUP.md is readable by people too.
One thing to know: the connector URL has your key in it, so treat it like a password.
What it costs
Money: nothing on Supabase's free plan (500,000 function calls a month, 500 MB database, 1 GB storage). Free projects pause after about a week with no activity, and any agent call counts as activity.
Tokens: sharing context isn't free, so I tried to keep it small. Agents get seven tools, about 1,400 tokens of definitions. A catch-up on a workstream is under 1,500 tokens.
The real trade-off is background runs versus speed, and you pick it per account. "never" means tasks wait until you next talk to that agent. "urgent", the default, means only urgent tasks wake the owning bot. "always" wakes it for every task, at one run per task.
What it isn't
It's not the desktop app at codelegate.dev. Different project, same name. This one is a self-hosted MCP server.
There are similar tools out there. Some are hosted services that keep your agents' memory on their servers. Some are local-only, so cloud agents like GrokBot or Claude on the web can't reach them. Some only share memory, not tasks. I wanted handoffs and memory between cloud and desktop agents, on something I own, for free. That's the gap this fills for me.
Try it
It's MIT licensed: https://github.com/aproli90/codelegate
If you already run more than one agent, try one handoff and tell me what it missed. And if setup gets stuck somewhere, drop a comment and I'll help.




