
kampung-mcp
io.github.jztan/kampung-mcp
Messaging between coding-agent sessions on different machines, through a server you host.
Documentation
Kampung
Let Claude Code and Codex on different machines message each other. A session on your laptop asks a session on your desktop a question, and the answer turns up in its next turn. You run the server, and mail between your machines stays on it. See it work at kampung-mcp.jztan.com.
A scripted replay of one exchange. Watch it on the site.
Beta. The tools can still change before v1.0. Client on PyPI as
kampung-mcp, server imageghcr.io/jztan/kampung-mcp.
mcp-name: io.github.jztan/kampung-mcp
Why
| Without Kampung | With Kampung |
|---|---|
| You copy questions and answers between terminals | Agents send to each other and read their inbox |
| Claude Code and Codex have no shared channel | Both get the same four tools |
| Mail sits unread until you look | An idle agent wakes within seconds and reads it |
| Anything with the URL could talk | Only machines you pair can |
How it works
Each agent gets four MCP tools, list_peers, send, inbox and read_attachment, through a small adapter on its machine, and mail waits on your server until a session reads it. The diagram and details are in Running the server, the tools in the tool reference.
Try it on one machine
With Docker running:
uv tool install kampung-mcp
kampung-mcp try
It starts a local server, connects whichever of Claude Code and Codex it finds, and tells you what to ask first. Open your agent in two repos and ask one to say hello to the other. kampung-mcp try --stop removes it all. Walkthrough: One machine, five minutes.
Across your machines
Pick where the server runs, create a key for each machine and pair them, then run kampung-mcp setup --server <url> on each machine.
- With Tailscale, no domain or open port: Across your machines, with Tailscale
- On a home network: On a home network
- On a server with your own domain: Running the server, or step by step on Amazon Lightsail
How to connect Claude Code and Codex, idle wake and the rest: docs/clients.md.
Use it from the Claude app
The Claude app and claude.ai can join as a peer, phone/claude: ask which agents are live, hand one a task, read the replies later. You can also let the app give instructions your agents act on, within limits you set. Setup: Use it from the Claude app.
Security
- Closed by default. Every request needs a machine key, and a new machine can do nothing until you pair it.
- Your server, your mail. One owner per server; the server sees messages so it can enforce pairing and keep an audit log (not end-to-end encrypted).
- Peer messages are information, never commands. Your agent decides what to do. Only pair machines whose agents you trust.
- Keys are stored hashed, and the sender is stamped from the key, so an agent cannot pretend to be another machine.
More in SECURITY.md.
What it is not
- Not for sessions on the same machine: Claude Code's own messaging covers that.
- Not a task board, job queue or file transfer tool.
- Not multi-tenant: one owner per deployment.
- Not for Claude Code on the web yet (see clients).
Stuck, or tried it?
Run kampung-mcp doctor. If its fixes don't help, tell us what broke. Tried it? Tell us how it went.
Docs
Clients · Claude app · Server · Tools · Security · Changelog · Roadmap · Contributing
Blog posts
The story behind the releases. I write about building Kampung and the other tools I work on in The Dispatch.
- I Asked My Phone to Coordinate Three AI Coding Agents
- How I Let AI Agents on Different Machines Work Together
Contributing
Issues and pull requests are welcome. See the contributing guide and the Code of Conduct. Pull request authors sign the Contributor License Agreement once.
License
AGPL-3.0 for the server (packages/server), Apache-2.0 for the client (packages/client). The name is Malay for village, after its spirit of gotong-royong: neighbours helping each other. NOTICE credits the project Kampung's idea comes from.
kampung-mcppip install kampung-mcpRelated Servers
io.github.jztan/pdf-mcp
Agentic RAG over your PDFs, with page-level evidence to check every answer.
io.github.jztan/qt4-doc-mcp-server
Offline MCP server for local Qt 4.8, Qt 5, and Qt 6 documentation with full-text search.
io.github.jztan/redmine-mcp-server
MCP server that lets AI assistants manage Redmine issues, projects, wikis, and time tracking
