Repository avatar
Communication
v0.8.1
active

kampung-mcp

io.github.jztan/kampung-mcp

Messaging between coding-agent sessions on different machines, through a server you host.

Documentation

Kampung

PyPI version Python 3.12+ Server: AGPL-3.0 Client: Apache-2.0 GitHub Issues CI codecov Downloads

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.

Scripted replay of two terminals: Claude Code on a laptop asks Codex on a NAS for a citation through Kampung, the NAS agent searches its PDF library and sends the passage back, and the laptop session finishes the section with it.

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 image ghcr.io/jztan/kampung-mcp.

mcp-name: io.github.jztan/kampung-mcp

Why

Without KampungWith Kampung
You copy questions and answers between terminalsAgents send to each other and read their inbox
Claude Code and Codex have no shared channelBoth get the same four tools
Mail sits unread until you lookAn idle agent wakes within seconds and reads it
Anything with the URL could talkOnly 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.

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.

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.