chatmux
概览
作者提供的说明(英文原文)
Local-first MCP server for your own LINE and Telegram chats. Data stays on your machine.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 2 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新★ 1
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: –
- 传输方式:
- 分类: 聊天与邮件
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 2 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
作者没有在注册中心列出安装信息。请查看下方作者的 README。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月10日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 echoedinvoker 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于3个月前
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“聊天与邮件”中的其他服务器比较i
- 星标数多于此分类中其他 1915 个服务器的 77%
- 发布到注册中心的时间比此分类中其他 1915 个服务器的 18% 更新
- 基础检查结果等于或优于此分类中其他 1915 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
chatmux 安全吗?
它在 2 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于3个月前,最新版本(0.1.0)于4个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。
有什么可以替代它?
同一分类中有:Inbox Zero, Agent-Native Mail, Agent-Native Dispatch
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Agent-Native Mail
Agent-Native Superhuman - email client with keyboard shortcuts and AI triage
Agent-Native Dispatch
Central Slack/Telegram router with jobs, memory, approvals, and A2A delegation
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
chatmux
Local-first personal chat data layer daemon. Connects IM platforms (v0.1: LINE) via child-process adapters, stores messages to JSONL + SQLite/FTS5, exposes MCP tools for AI clients.
The three repos
chatmux is the core. Platforms plug in below it, consumers sit above it, and both sides of that boundary live in their own repos:
| Repo | Role |
|---|---|
| chatmux (this one) | Core daemon: storage, safety rail, MCP server, LINE adapter |
| chatmux-adapter-telegram | Second platform adapter (Telegram, MTProto user session) |
| chat.nvim | Reference consumer: read and reply to chats inside Neovim |
Adapters speak the adapter protocol; consumers speak MCP. Either side can be replaced without touching the other.
Quickstart
1. Install
git clone https://github.com/echoedinvoker/chatmux.git
cd chatmux bun install
2. Decide whether to connect an account yet
With no adapters.json, bun run start launches the LINE adapter, which means step 3 puts your LINE account on the line — read Account Risk Warning before you run it. If you would rather look around first, start with no adapter at all:
mkdir -p ~/.local/share/chatmux
cat > ~/.local/share/chatmux/adapters.json <<'JSON' { "adapters": [], "mcp": { "port": 7717 } } JSON bun run start
The daemon comes up with storage and the full MCP interface — you can initialize, list tools, and read resources. There is simply no chat data behind them until an adapter is connected. Set CHATMUX_DATA_DIR to keep this trial run out of your real data directory:
CHATMUX_DATA_DIR=/tmp/chatmux-trial bun run start
Each entry in adapters takes platform, a command string, and an args array (plus optional cwd and env):
{ "platform": "telegram", "command": "python", "args": ["-m", "chatmux_adapter_telegram"] }
For Telegram, follow the setup in chatmux-adapter-telegram — it has its own credentials and login flow, and does not involve LINE.
3. First login (QR code)
bun run start
A QR code will appear in the terminal
Open LINE on your phone → open the QR scanner → scan
iOS: Home → the scan icon
Android: Home → Add friends → QR code
After successful login, authToken is saved for future auto-login
4. Connect Claude Code
Register the daemon's MCP endpoint with Claude Code:
claude mcp add --transport http chatmux http://127.0.0.1:7717/mcp
claude mcp list # chatmux: ... - ✔ Connected
The daemon listens on two transports at once: a TCP port on `127.0.0.1` (default 7717) for standard MCP clients like Claude Code, and a unix socket for same-host sidecar consumers like chat.nvim. Use the TCP url for Claude Code — the MCP spec only defines stdio and streamable HTTP transports, so no MCP client accepts a unix socket path.
Port is configurable via CHATMUX_MCP_PORT, or mcp.port in adapters.json; set it to 0 to disable the TCP listener. See docs/mcp-interface.md.
Architecture
LINE adapter ←── stdio JSON-RPC ──→ core daemon ←── MCP Streamable HTTP ──→ Claude Code
(Node+tsx) (child process) (Bun) (127.0.0.1 TCP / unix) (MCP client) ├─ SafetyRail ├─ Storage (JSONL → SQLite/FTS5) ├─ Adapter Runner └─ MCP Server
- Core daemon (Bun): central process managing storage, safety, and MCP server
- LINE adapter (Node+tsx): child process connecting to LINE via IOSIPAD slot
- Storage: JSONL append-only truth source + SQLite/FTS5 queryable view
- MCP server: Streamable HTTP over TCP (standard MCP clients; loopback by default, settable for containers) + unix socket (same-host sidecars), 8 tools + 4 resources
MCP Tools
| Tool | Description |
|---|---|
list_chats | List chats with last message preview, search, pagination |
read_messages | Read messages from a chat, paginated by timestamp |
read_events | Tail the event log from an opaque cursor — resumable, survives backfill reordering, and re-delivers a message when it is edited or retracted |
search_messages | Full-text search (CJK supported via FTS5 trigram + LIKE fallback) |
send_message | Send message through SafetyRail (rate-limited, error-tracked) |
get_media | Local file path for a message's image or sticker; downloads and caches on first call |
probe_latest | Diagnostic, read-only: ask the adapter for a chat's newest N messages without landing them |
get_status | System status: adapter connection + storage stats |
MCP Resources
| URI | Description |
|---|---|
chat://chats | All chat list |
chat://chats/{id}/messages | Recent messages for a chat |
chat://chats/{id}/info | Chat details with members |
chat://status | System status |
Writing a consumer
Core exposes primitives, not policy. Anything that decides *what matters* — which chats are worth surfacing, where a notification goes, when to stay quiet — belongs in a consumer, on the far side of the MCP boundary.
examples/notifier/ is a working reference: it tails the event log with a persisted cursor and hands each message to a hook you fill in. Its mcp-client.ts uses raw fetch rather than the TypeScript SDK, so it doubles as a wire-protocol reference for consumers in any language.
systemd Service
cp config/chatmux.service ~/.config/systemd/user/
systemctl --user daemon-reload systemctl --user enable --now chatmux
Edit WorkingDirectory to point at your clone before copying it.
How it comes back
The unit ships Restart=always, not on-failure. A chat backend is supposed to be there all day, and there are three ways it can stop being there — it crashes, something sends it a signal, or it exits cleanly — of which on-failure only recovers from the first. systemctl --user stop still stops it: a stop you asked for is not a failure, under either setting.
⚠️ **If you are on an older unit with
Restart=on-failure,kill -TERMwill not bring
it back — and that is not a missing restart policy.** systemd counts SIGTERM, SIGHUP,
SIGINT and SIGPIPE as an intended stop, so
on-failureleaves the service sitting in
inactiveafter any of them. Onlykill -9(SIGKILL) counts as a failure there.
With the
Restart=alwaysthis unit now ships, TERM comes back too — measured
2026-08-02:
kill -TERM $MainPIDmovedNRestarts1 → 2 and produced a newMainPID
within the 10s
RestartSec. That makes TERM the useful test:kill -9restarts under
*either* setting, so it cannot tell you which one is in effect. If you want to confirm
alwaysis live, send TERM and watchsystemctl --user show chatmux -p MainPID,NRestarts
change.
StartLimitIntervalSec=300 / StartLimitBurst=5 cap a crash loop: five starts inside five minutes and systemd stops trying, leaving the unit failed for you to look at rather than restarting into the same wall forever. Clear it with systemctl --user reset-failed chatmux.
Containers
A systemd user service is the intended way to run chatmux. If you want it in a container instead, deploy/container/ is a reference that builds and answers — not an official image, and it runs zero adapters, because adapters hold logged-in sessions and a container you rebuild is the wrong home for those.
The one thing you cannot skip is CHATMUX_MCP_HOST. The daemon binds 127.0.0.1 by default, which inside a container is the container's own loopback — a published port then maps to a socket nobody is listening on, and every connection is refused while the logs look perfectly healthy. Read deploy/container/README.md before assuming your port mapping is broken.
Development
bun run dev # Start with --watch (auto-reload)
bun test # Run all tests bun run start # Start daemon
See docs/ for detailed architecture and protocol documentation.
Limitations
Known and accepted, with what would make each worth revisiting.
- The chat list caps at 1000, silently.
chat://chatsis hard-coded to that limit. Consumers can detect an overflow by comparing thetotalfield against what arrived, so it will not bite you without saying so. Worth raising once a vault approaches ~500 chats, or the first time that completeness check fires. - The JSONL log holds duplicate history. Backfill re-ingested some messages many times over, leaving the event log several times larger than the messages in it. This has stopped: recent growth is almost entirely new distinct messages, and the worst-case duplicate count has been frozen across repeated measurements. It is not a correctness problem — ingestion is idempotent and the SQLite projection is unaffected — so the fix, if ever needed, is a one-off compaction rather than a code change. Worth doing if the log passes ~500 MB, if the duplicate count starts climbing again, or if cold start slows noticeably.
- Retractions in Telegram one-to-one chats are missed. Group retractions land; direct ones do not, because the adapter cannot recover the chat id for those events from its entity cache, and core will not match a message on id alone — that ambiguity is exactly what the storage key was widened to remove. So a message you retracted on your phone can stay visible here. Worth fixing once the adapter can resolve the chat id itself, or as soon as retraction accuracy matters to a consumer.
- Reactions are not stored at all. The platforms send them; no layer reads them. Nothing in core, the schema, or the MCP surface represents a reaction, so a consumer cannot show what a phone shows. Worth building when reactions carry meaning you would otherwise miss — it is new storage, not a display tweak.
- `read_receipt` is declared but never emitted. The LINE adapter advertises the capability and core is ready to ingest it; nothing constructs the event. Whether read state should reach a UI at all is an open product question, not a pending bug — but the declaration is wrong today, so do not branch on
supported_eventsfor this one. Worth fixing as soon as any consumer does branch on it, or once that product question gets an answer.
⚠️ Account Risk Warning
This project uses @evex/linejs, an unofficial LINE client library. Using unofficial APIs may violate LINE's Terms of Service. Your LINE account may be restricted, suspended, or permanently banned. Use at your own risk.
The IOSIPAD device slot is used to avoid interfering with your phone's LINE app, but LINE may change their multi-device policy at any time.
⚠️ Legal Disclaimer
This software is provided "as is", without warranty of any kind. The author is not responsible for any consequences of using this software, including but not limited to account restrictions, data loss, or violations of third-party terms of service.
This is a personal tool for personal use. Do not use it for spam, harassment, unauthorized access to others' messages, or any illegal activity.
🔒 Privacy Disclosure
chatmux stores decrypted message content in plaintext on your local machine:
~/.local/share/chatmux/events.jsonl— all events (append-only)~/.local/share/chatmux/chatmux.db— SQLite database with messages, contacts, chats~/.local/share/chatmux/adapters/line/auth.json— LINE auth token~/.local/share/chatmux/adapters/line/storage.json— E2EE key storage
These files are protected by filesystem permissions (o