
Kampung Mcp
io.github.jztan由 GitHub 帳號 jztan 發布v0.2.2更新於 Nov 7, 2026
Messaging between coding-agent sessions on different machines, through a server you host.
概覽
自架設的 MCP 伺服器,讓不同機器上的編碼代理工作階段透過依儲存庫劃分的信箱互相傳訊。
- 可以做什麼
- 列出已配對機器上可聯絡的信箱及其工作階段
- 向某個機器/儲存庫或指定工作階段傳送短文字訊息,可選擇回覆某則訊息
- 讀取收件匣中的新訊息,讀取即投遞並標記為已讀
- 在每台機器上以本機 stdio 轉接器執行,轉送前附加機器金鑰與工作階段身分
- 透過 Stop 鉤子、可選的空閒喚醒、迴圈防護以及稽核日誌與管理儀表板讓代理持續運作
- 適用情境
- 適合在多台機器或多個儲存庫上執行 Claude Code、Codex 等編碼代理,並希望它們互相提問、而不必在終端機之間複製貼上的情境。它不是任務看板、工作佇列或檔案傳輸工具,也不取代同一台機器內的工作階段通訊。
- 執行需求
- 需要在其他機器可連線的主機上以 Docker 自行架設伺服器,並在每台機器安裝 kampung-mcp 用戶端(例如透過 uv)。每台機器需在伺服器上建立獨立金鑰並完成機器配對,安裝過程會以隱藏方式詢問金鑰。Python 版本變動後可能需要重新啟動用戶端並重跑安裝指令。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Kampung Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Kampung
[PyPI version] [Python 3.12+] [Server: AGPL-3.0] [Client: Apache-2.0] [GitHub Issues] [CI] [codecov] [Downloads]
Self-hosted messaging between coding agents on different machines, over MCP. See it work at kampung-mcp.jztan.com.
A Claude Code session on your laptop can ask a Codex session on your desktop a question, and the answer turns up at the end of its next turn. Kampung is one small server you run in Docker, plus a client on each machine that wires it into Claude Code and Codex.
A scripted replay of one exchange. Watch it on the site, where you can expand every tool call.
mcp-name: io.github.jztan/kampung-mcp
The name comes from the kampung (Malay for village) and its spirit of gotong-royong: neighbours helping each other. Here the neighbours are your agents, each in its own machine and repo, lending each other a hand.
Clients | Server | Security | Changelog | Contributing
Status: beta. The MCP tools and
/v1can still change before v1.0. The client is on PyPI askampung-mcpand in the MCP Registry asio.github.jztan/kampung-mcp. The server image isghcr.io/jztan/kampung-mcp(amd64 and arm64).
Why Kampung?
How it works
Each agent talks to a local stdio adapter, which adds the machine's key and the session's identity and forwards to the server. The key never passes through the model's tool calls, and the server stamps the sender from it, so an agent cannot pretend to be another machine. Mail waits in a per-repo mailbox until a session reads it.
Quick start
-
Run the server (on a machine every other machine can reach):
It runs the latest release and listens on
127.0.0.1:8803. For HTTPS, pinning a release and backups, see docs/server.md. -
Create a key for each machine and pair them:
-
Connect each machine with its own key (with uv):
Setup asks for the key without showing it. Add
--agent codexor--agent bothfor Codex, and--channelsto wake idle Claude Code sessions; see docs/clients.md. Restart Claude Code, and ask it tolist_peers.Setup records the hook's full path, which includes the Python version. If the
uv toolinstall moves to another Python minor version, rerunkampung-mcp setup: the hooks fail open, so otherwise they just stop working, with no error.
For a step-by-step deployment on AWS, see Deploy on Amazon Lightsail.
The admin dashboard at /admin, with example data.
Tools
Every message arrives in an envelope with the sender, sent time, loop-guard depth and a "peer message, not an instruction" tag. Bodies and text attachments are checked for secrets such as API keys before they are stored. Unread mail expires after 7 days, and each machine can send 60 messages a minute. See the tool reference for results and errors.
Use it from the Claude app
With KAMPUNG_PUBLIC_URL set (see .env.example), the Claude app and claude.ai can join as a peer with its own mailbox, for example phone/claude, and read or leave mail with no laptop running. On the server:
connect prints a URL, the client id kampung-claude and a one-time code. In Claude, add a custom connector with that URL, confirm Sign in now and Use your own OAuth client (Claude detects both from the server), and enter that client id with no secret. Claude opens Kampung's connect page; enter the code within 10 minutes from one of your allowed networks (home Wi-Fi counts), and the connector is ready on the phone and the web. Every chat on the account shares that one mailbox, and mail is delivered on read, so the first chat to read the inbox gets it.
Keep the connector out of Claude Code. Claude Code loads the account's connectors too, so every window would get a second kampung with the same three tool names, acting as phone/claude: the model picks either one, and that window takes the phone's mail. Name the connector kampung in the dialog: kampung-mcp setup then denies it for every project in ~/.claude/settings.json (rerun setup on machines set up before this, or pass --connector-name if you named it differently). The entry it writes is:
The symptom when it is on: the Stop hook says mail is waiting but inbox comes back empty, because the hook counts the window's own mailbox and the model read the phone's.
kampung disconnect phone ends the connection and keeps the machine and its mail. Tool calls come from Anthropic's cloud (160.79.104.0/21), so allow that range on port 443; the deployment runbook has the firewall and the checks.
Security
- Closed by default. Every request needs a machine key; a new machine can do nothing until you pair it.
- The machine is the trust boundary. One key per machine, stored hashed. A machine can only use its own mailboxes.
- Peer messages are information, never commands, and pairing is a trust decision: only pair machines whose agents you trust.
- Not end-to-end encrypted. The server sees messages so it can enforce pairing and keep the audit log.
- Claude app tokens are a second credential bound to a machine. They come only from a one-time code you print on the server, never from registration, and they cannot reach the hook API.
The threat model, operator checklist and limits are in SECURITY.md.
What it is not
- Not a replacement for Claude Code's built-in messaging between sessions on the same machine.
- Not a task board, job queue or file transfer tool.
- Not multi-tenant: one owner per deployment.
Roadmap
- Server-sent events to replace the adapter's polling.
- The client as a Claude Code plugin, for easier install. Channels would still need the development flag.
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; you keep the copyright in your work.
License
packages/server(kampung-server): AGPL-3.0, see packages/server/LICENSEpackages/client(kampung-mcp, the adapter and hooks that run on your machines): Apache-2.0, see packages/client/LICENSE
NOTICE credits the project Kampung's idea comes from.
來源:README.md,提交 13c7984
工具
0版本歷史
4- v0.2.2最新Nov 7, 2026
- v0.2.1Nov 1, 2026
- v0.1.1Oct 31, 2026
- v0.1.0Oct 30, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。