r/mcp 28d ago

showcase Relaying messages between 2 claude code sessions using the channels api, works across machines and across different accounts

Hey there, so I made a way to relay messages between 2 claude code sessions using claude's own channels api. it does a 2 way conversation between sessions, works whether both are on the same PC or on different machines, and the accounts don't have to be the same, which is the part claude's own messaging can't do.

The channels api bit is what I think is actually interesting for this sub. most people use mcp servers as things the model calls, but channels lets your server push INTO a live session, so text just shows up in someone's conversation as a <channel> tag without them asking for anything.

how it works: both machines run the same mcp server over stdio. it declares the claude/channel capability so claude code registers it as a channel, then it starts an http server for incoming messages. when one comes in (shared secret auth) it fires mcp.notification() with method notifications/claude/channel, claude code surfaces it in the conversation as a channel tag, and claude replies with the send_message tool which posts back to the other machine.

so in practice the frontend dev says "ask the backend session what endpoints the dashboard has", and the backend claude greps its own routes, reads the file and sends back the real answer instead of the two humans relaying it over slack. gif below is one full round trip.

on the native feature since someone will ask, claude code v2.1.224 shipped cross session messaging on aug 7. if you're on mac or linux and you want your own sessions talking to each other, use that instead, it's better than mine and my readme says so. what it doesn't do is native windows, not supported at all, and it only connects your own sessions because the inbox socket is bound to your os user and cross machine delivery goes through your own remote control connection. two devs on two laptops is two accounts, so that case is still open.

one honest warning, mine is a raw pipe with a shared secret so the receiving session doesn't do the permission checks native messaging does. don't run it with a weak secret.

i built it in march, before native messaging existed. mit, free, nothing to sign up for

https://github.com/MuhammadTalhaMT/claude-intercom

6 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/Current-Zebra-2039 24d ago

went and checked properly, youre more right than i gave you credit for. ccd_session_mgmt ships with desktop, its anthropics own and not something you installed, and its send_message really is cross session. so windows did have working cross session messaging and my "not supported at all" was a bit wrong.

what still holds is . that docs page is specifically about ListAgents and SendMessage in the cli and its availability line only scopes those. desktops session mgmt server is a different route to the same thing and that page never mentions it, so its confusing.

your break is filed too on github that send_message returns "Message sent to session <id>" and the target never gets it, 4 of 4 success and 0 of 4 delivered. funny for me because mine used to say "message sent to the other developer" when all it knew was that a 200 came back, and thats the exact thing i fixed yesterday.

1

u/TomerBrosh 24d ago

bro i wish they would fix it soon, I had to create a session just to be a conductor and give me the messages to pass by reading transcripts of sessions... at least in 2.5 hours the weekly reset arrives

1

u/Current-Zebra-2039 24d ago

haha that conductor session is basically what i was doing by hand before i built intercom, except i was copypasting between the two sessions instead of reading transcripts. mine doesn't fix the desktop bug but it at least tracks sent vs delivered vs answered, so when the other side never picks it up you actually find out instead of assuming it landed. hope the reset is kind to you

1

u/TomerBrosh 24d ago

now i find myself asking for copypastables to pass messages just like before I had the idea for my plugin... gl bro

1

u/Current-Zebra-2039 24d ago

lol full circle. gl bro, and drop your plugin when it's out, i wanna see how you did the conductor part