LINE MCP Companion
Logs in as a secondary LINE device to sync selected chats locally (SQLite + full-text search, without marking read), and exposes MCP tools to list allowed chats, read/search messages, fetch attachments and media, get unread summaries, trigger syncs, and send messages, stickers or quoted replies (through a confirmation queue), plus chat trust levels, AI reply suggestions, scam alerts and scam-warning composition, sticker listing, and digests posted to LINE groups.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LINE MCP Companion
在 Android 手機上以「次要裝置」登入 LINE,把你勾選的聊天存在手機本機,並在 127.0.0.1 提供 MCP,讓 AI 幫你讀訊息、擬回覆、抓詐騙。預設不標已讀,AI 功能預設全關。
⚠️ 非官方協定,帳號可能被限制或停用 本 App 使用非官方的 LINE 通訊協定(LINEJS),不是 LINE 官方功能。LINE 可能因此限制或停用你的帳號。建議用次要帳號或測試帳號。 本專案與 LY Corporation 沒有任何關係,也未獲授權或背書。「LINE」是 LY Corporation 的商標。
功能
本機同步:只同步勾選的聊天,SQLite + 全文搜尋(中文可用),不標已讀
MCP(Streamable HTTP):
127.0.0.1:47823/mcp,Bearer token,只綁本機代聊二選一(總控台切換)
由連接器代聊:外部 AI(Claude、ChatGPT…)經 MCP 的
send_message回覆,App 不需要 API keyApp 內建 AI:任何 OpenAI 相容端點(OpenAI / Grok / 本機 llama-server…)+備援模型鏈;送雲端前預設去識別化(人名、電話、帳號…)
雲端連接器(預設關):ChatGPT / Claude / Grok / Gemini 的自訂 MCP 連接器 — OAuth 2.1(DCR + PKCE + App 內配對碼)、Streamable HTTP + 舊版 SSE、可選 Cloudflare 通道,見 docs/connectors.md
信任狀態:每個聊天的 AI 回覆、反詐提醒各自「審核(預設)→ 自動」,一鍵降回;緊急停止全部降回
安全預設:AI 代聊有自己的白名單(要同時在 MCP 白名單)、確認佇列(可改字 / 貼圖再送)、頻率 / 每日上限、活躍時段、緊急停止、稽核紀錄、提示注入防護;被隱藏 / 收回的訊息不回、不當脈絡
紀錄:反詐與 AI 代聊紀錄(加密保存、可篩選、匯出 CSV、保留天數、清除)
長按訊息回覆這則:引用回覆,可請 AI 擬一句,或回你用過的貼圖
去 AI 味:送出前把太像 AI 的句子改自然(Lieflat 規則,每個聊天可關)
反詐雷達:本機規則 + 可擴充範例庫,不需要 AI;可選擇在群組即時引用回覆提醒並 @ 管理員(每群預設關)
日報:AI 助理經 MCP 寫回、或 App 內建 AI 產生;報紙版面、選日期、點來源跳回原訊息;可手動或每天定時貼到群組(網址會拿掉)
安全讀取連結(每個聊天預設關):先過反詐規則、詐騙網域、短網址展開、私有 IP 檢查才抓標題 / 文字,不執行 JS、不帶 cookie
社群貼文草稿:把聊天內容整理成你口吻的 FB / IG / Threads / X 草稿(只草稿,不發文)
Related MCP server: line-mcp
MCP 工具
類別 | 工具 |
讀取 |
|
送出 |
|
審核 |
|
反詐 |
|
ChatGPT 相容 |
|
日報 |
|
連結 |
|
所有工具都只看得到白名單內的聊天;送出類預設進確認佇列,要你在 App 按「送出」。連接器設定見 docs/connectors.md。
安裝(側載)
下載對應的 APK:真機用
arm64-v8a,模擬器用x86_64確認簽章(release 版):
apksigner verify --print-certs line-mcp-app-0.2.1-arm64-v8a-release.apk憑證 SHA-256 必須是:
75:E7:2F:E9:BC:01:B9:E8:9F:78:A9:42:53:12:58:1C:1D:4D:AA:92:E9:CB:E2:14:63:F8:76:18:97:EC:A9:0A開啟 App → 看完風險說明 → 產生 QR → 用另一台裝置顯示並以手機 LINE 掃描 → 輸入 PIN
在「聊天」勾選要開放的聊天;在「設定」用指紋 / 螢幕鎖確認後複製 MCP 設定
開發
需要 Node 24、Bun(打包)、Android SDK。
npm install
npm test # 單元 / 端到端測試(全部假資料,不連 LINE、不呼叫 AI)
npm run typecheck
LMA_PASSPHRASE='至少 12 個字的密語' npm start # 桌面執行;沒設 token 會自動產生並只印一次
npm run android:debug # debug APK(含 Mock 模式)
npm run android:release # release APK(移除 Mock,需 release keystore)桌面模式必須設
LMA_PASSPHRASE(加密 LINE token / E2EE 金鑰),否則拒絕啟動release 簽章:keystore 放在 repo 外(預設
../keys/release.jks+ 權限 0600 的../keys/keystore.pass,可用LMA_KEYSTORE/LMA_KEYSTORE_PASS_FILE覆寫);找不到就不簽,不會退回 debug 金鑰Mock 模式(只在 debug 版):設定 → 開發者 → Mock 模式,完全離線的假資料,見 docs/mock-mode.md
安全設計與威脅模型:docs/SECURITY-REVIEW-BRIEF.md
授權
Apache-2.0(見 LICENSE、NOTICE),src/style/lieflat/ 除外:該目錄改作自 Lieflat Less AI Tone,維持 CC BY-NC 4.0(僅限非商業使用)。第三方授權見 THIRD_PARTY_NOTICES.md。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Let AI agents securely access the text messages on your phone.
Read, search and summarize your WhatsApp, Telegram, Slack and Discord chats. Replies need your OK.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Let your AI agent message and call your Android phone, and get your reply or the call transcript.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to read, reply, send images, and search LINE messages by logging in as a secondary device, without official API or browser.49897 npm12MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to read, search, and reply to personal LINE messages, including end-to-end-encrypted chats and media, all decrypted locally.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-capable AI clients to search both sides of a user's own macOS LINE Desktop chat history — listing chats, reading messages, searching text, and pulling recent activity from local read-only database snapshots. It never sends messages, marks chats read, clicks through the UI, or requires a LINE Official Account.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to operate a personal LINE account through MCP, listing friends and groups, retrieving and searching message history, and sending text, mentions, and registered media. Also supports group creation, display-name changes, and reply drafting based on owner-approved conversation history.MIT