
Security News
Cloudflare Introduces a Faster TypeScript Compiler Written in Rust
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.
line-context-relay
Advanced tools
Local-first, read-only LINE conversation advice for ChatGPT/Codex on macOS.
LINE Context Relay — Read-only AI Chat Advisor for ChatGPT, Codex and MCP Agents
LINE Context Relay — 給 ChatGPT、Codex 與 MCP Agent 使用的唯讀 LINE 聊天顧問
繁體中文 · English · Security · Privacy · MIT License
A local-first, read-only LINE conversation assistant for macOS. It connects ChatGPT/Codex to LINE Desktop's local encrypted database through a narrowly allow-listed MCP server, refreshes the target chat using database evidence, builds private relationship context, and suggests whether and how to reply.
It never sends a LINE message.
Unofficial community project. Not affiliated with, endorsed by, or sponsored by LINE Corporation or OpenAI. Use only with your own account and data, and review the relevant product terms before use.
套件安裝與限制:INSTALL.md · 維護與發布:MAINTAINERS.md。npm 發布與外部採用尚未完成。
LINE Context Relay turns a Mac running LINE Desktop and ChatGPT/Codex into a private conversation-advice workflow:
flowchart LR
U["User or ChatGPT Remote"] --> C["ChatGPT / Codex on Mac"]
C --> M["Allow-listed line-readonly MCP"]
M --> S["Stable DB + WAL + SHM snapshot"]
S --> R["Bounded chat history"]
R --> X["Private local relationship context"]
X --> A["One reply decision or suggestion"]
A --> C
With ChatGPT Remote enabled in the user's desktop/mobile setup, a request can start from a phone, run on the paired Mac, read the local LINE context, and return a suggestion to ChatGPT. Remote availability, locked-computer behavior, and pairing depend on the installed ChatGPT version and must be verified on the user's own devices. The Mac must be powered on, online, and signed into a usable graphical session for LINE refresh actions.
The project is intentionally an advisor, not a bot that sends messages. Reply text is displayed in ChatGPT/Codex only.
SQLITE_OPEN_READONLY and query_only on the private snapshot onlychatId resolution; ambiguous names fail closedline-chat-advisor Codex skillThe MCP exposes exactly ten operations:
| Tool | Purpose | Writes LINE source DB? |
|---|---|---|
get_attachment_info | Read bounded attachment metadata without keys | No |
download_attachment | Fetch from fixed LINE OBS host, verify and save under Downloads | No |
line_status | Verify DB discovery, Keychain access, decryption, and snapshot state | No |
list_chats | List recent exact chat candidates | No |
read_history | Read bounded history and deduplicate it into private local memory | No |
refresh_latest | Passively poll, then activate or launch only LINE if needed | No |
get_relationship_context | Read private local semantic context | No |
save_relationship_context | Save bounded context to local memory with cursor/version checks | No |
sync_older_messages | Optional, constrained older-history backfill; not used for normal reads | No |
line_health | Return redacted diagnostics | No |
read_history and save_relationship_context may write to the ignored local
memory database. They never modify LINE's source DB. See PRIVACY.md
and AUDIT.md for the detailed boundary.
apsw-sqlite3mc wheelgit clone https://github.com/LEO0047/line-chat-advisor-mcp-ai-assistant.git
cd line-chat-advisor-mcp-ai-assistant
scripts/bootstrap
scripts/build-peekaboo
scripts/build-history-helper
scripts/bootstrap clones the three commits in VENDOR_LOCK.md
without executing vendor code, installs hash-pinned Python and lockfile-pinned
Node dependencies, and runs the tests. scripts/build-peekaboo separately
builds only the reviewed Peekaboo commit into the ignored runtime/ directory.
scripts/build-history-helper builds the project's bounded native AX adapter.
Historical backfill requires an already-open, focused chat with an exact window
title and one identifiable message list. It sends wheel events only to LINE;
it does not search, click results, read message text from UI, or use keys.
If LINE omits the accessible message list, the operation stops explicitly.
The Codex computer tool can open/scroll an exact chat when available; actual
text must still be read through read_history. Verify the oldest message and
count after loading, not just a successful scroll. Server completeness remains
unknown without an authoritative acknowledgement.
For window-read timeouts, use the bounded diagnostic and recovery procedure in Historical UI troubleshooting. Keep window recovery, actual scrolling, and verified new history as separate results.
Register the MCP in ~/.codex/config.toml, replacing the placeholder with the
absolute clone path:
[mcp_servers.line-readonly]
command = "/opt/homebrew/bin/node"
args = ["<absolute-project-path>/src/line-readonly-mcp/server.mjs"]
Install the global skill without copying private state:
mkdir -p "$HOME/.codex/skills"
ln -s "$(pwd)/skills/line-chat-advisor" "$HOME/.codex/skills/line-chat-advisor"
Do not overwrite an existing skill path without reviewing it. Restart/reload ChatGPT/Codex after changing MCP or skill configuration.
LINE's local DB is encrypted. The project includes a deliberately isolated, user-assisted capture path that stores the validated key directly in Login Keychain and removes temporary artifacts:
scripts/prepare-key-capture
# Sign in only to the visible temporary LINE copy.
scripts/capture-key
scripts/cleanup-key-capture # safe to run again if cleanup is needed
Read SECURITY.md and AUDIT.md first. Never paste the
key into a terminal command, .env, issue, log, prompt, or repository. The
technique may break after LINE/macOS updates and may be subject to LINE's terms;
use it only on your own Mac and account.
npm run test
scripts/doctor
npm start
After reloading Codex, prompts such as these trigger the global skill:
Read the latest LINE messages from <exact contact name>, use the full
relationship context, tell me whether I should reply, and if so give me only
one reply in my style. Do not send it.
The skill requires this sequence:
line_status → refresh_latest → get_relationship_context → read_history
→ save_relationship_context
ok: true and localSnapshotRefreshed: true permit reading the refreshed local
snapshot. While locked, the bridge polls passively for the requested window or
until the target advances, without UI actions. targetAdvanced only records
local message progress, which may be outgoing. Neither app activation nor local
changes prove server completeness: freshnessVerified is now always false,
with syncComplete: null and serverWatermark: null until an authoritative
server acknowledgement is available. Consumers of the older freshness flag
must use localSnapshotRefreshed for local-read success instead.
Results report snapshot time, latest target-message time, and unverified server sync. DB/key/snapshot failures still stop the read. Date-range requests return transcripts; reply-advice requests return a short suggestion when appropriate.
The documented LINE Messaging API receives messages for Official Accounts through webhooks; it is not a private Desktop-chat synchronization acknowledgement or backfill interface for this bridge. Its documentation also says received text cannot be fetched again by API. No server completeness guarantee is implemented here.
src/line-readonly-mcp/ — Python DB bridge and Node MCP serversrc/key-capture/ — isolated Keychain/key-validation helpersskills/line-chat-advisor/ — global Codex skill sourcescripts/ — bootstrap, build, doctor, capture, and cleanup commandstests/ — Python and real stdio MCP testsAUDIT.md — upstream security reviewVENDOR_LOCK.md — source URLs and reviewed commitsACCEPTANCE.md — sanitized verification statusDependencies, vendor working copies, build outputs, databases, snapshots, screenshots, logs, keys, local memory, and contact material are intentionally excluded from Git. They are recreated locally or remain private.
npm run test
scripts/doctor
git diff --check
Before changing a vendor pin, repeat the security audit. Never add a message send path or a generic GUI/keyboard tool to the MCP allow-list.
Original code in this repository is released under the MIT License. Fetched upstream projects remain under their own licenses. Their source, license, and reviewed commit are listed in VENDOR_LOCK.md.
LINE Context Relay 是 macOS 上的本機優先、唯讀 LINE 聊天輔助機器人。 它透過受限 MCP 讓 ChatGPT/Codex 讀取 LINE Desktop 的本機加密資料庫,先用 DB 證據刷新精確目標聊天室,再結合完整關係脈絡,判斷現在該不該回;需要回覆 時只提供一句最像使用者的版本。
本專案永遠不會傳送 LINE 訊息。 建議只顯示在 ChatGPT/Codex。
若使用者的 ChatGPT 桌面版與手機已啟用並配對 ChatGPT Remote,可以由手機送出 任務,讓配對的 Mac 執行本機 LINE 讀取,再把建議帶回 ChatGPT。Remote、Locked Use 與鎖定畫面下的實際可用性會隨版本與裝置狀態改變,必須在自己的設備實測; Mac 仍需開機、連網,且已登入可用的圖形工作階段。
SQLITE_OPEN_READONLY 與 query_only 開啟副本chatId 解析,重名就停止而不是猜測line-chat-advisor skillsend_message、通用輸入、任意 app、OCR、截圖、Shell MCP 或
AppleScript MCP一般讀取固定依序執行:
line_status → refresh_latest → get_relationship_context → read_history
→ save_relationship_context
refresh_latest 以 localSnapshotRefreshed 表示已取得本機穩定唯讀快照;
鎖屏時會持續被動檢查至指定期限或目標前進。targetAdvanced 僅表示本機目標
紀錄前進,不能證明伺服器同步完整;freshnessVerified 保持 false,
syncComplete 與 serverWatermark 保持 null。輸出會附讀取時間與同步未確認提示,
不因鎖屏阻擋本機讀取;DB/金鑰/快照失敗仍停止。read_history 與
save_relationship_context 只會寫入被 Git 忽略、權限為 0600 的本機記憶,
永遠不會修改 LINE 來源 DB。
git clone https://github.com/LEO0047/line-chat-advisor-mcp-ai-assistant.git
cd line-chat-advisor-mcp-ai-assistant
scripts/bootstrap
scripts/build-peekaboo
scripts/bootstrap 會依 VENDOR_LOCK.md 下載三個經審查的固定
commit,不執行 vendor 程式,接著安裝 lockfile/hash 鎖定依賴並跑測試。
Peekaboo 必須用獨立指令明確建置,產物只放在被忽略的 runtime/。
在 ~/.codex/config.toml 註冊 MCP:
[mcp_servers.line-readonly]
command = "/opt/homebrew/bin/node"
args = ["<專案絕對路徑>/src/line-readonly-mcp/server.mjs"]
安裝全域 skill:
mkdir -p "$HOME/.codex/skills"
ln -s "$(pwd)/skills/line-chat-advisor" "$HOME/.codex/skills/line-chat-advisor"
修改 MCP 或 skill 後必須重新載入 ChatGPT/Codex,已開啟的 task 不會自動更新 啟動時載入的工具清單。
LINE 本機 DB 有加密。專案提供隔離、需要使用者配合的一次性流程,驗證後直接 把金鑰寫入 Login Keychain,並刪除暫存檔:
scripts/prepare-key-capture
# 只登入畫面上可見的暫時 LINE 副本
scripts/capture-key
scripts/cleanup-key-capture
執行前請完整閱讀 SECURITY.md 與 AUDIT.md。金鑰不可
放入命令列、.env、Issue、log、prompt 或 Git。這項技術可能因 LINE/macOS 更新
失效,也可能受到 LINE 使用條款限制;只能用於自己的 Mac、帳號與資料。
npm run test
scripts/doctor
npm start
重新載入 Codex 後,可使用:
讀取 LINE:<聯絡人精確名稱> 的最近訊息,結合完整關係脈絡,告訴我現在該不該回;
需要回覆時只給我一句最像我的版本,不要傳送。
需要回覆時只會輸出一句建議;不需要時只輸出 現在不用回。;刷新或安全條件
不成立時只回報阻塞原因,不會改用 Computer Use、OCR 或舊快照。
以下內容永遠不進 Git:LINE DB/WAL/SHM、Keychain 金鑰、擷取候選值、聊天內容、 chatId、聯絡人名稱、截圖、OCR、log、本機 memory、dependency tree、vendor working copy、binary 與 build artifacts。詳細規則見 PRIVACY.md。
本 repo 的原創程式採 MIT License。透過 bootstrap 下載的第三方專案 仍使用各自授權;來源、license 與固定 commit 請見 VENDOR_LOCK.md。
本專案是非官方社群工具,與 LINE Corporation、OpenAI 無隸屬、贊助或背書關係。
FAQs
Local-first, read-only LINE conversation advice for ChatGPT/Codex on macOS.
We found that line-context-relay demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.