line-selfbot-mcp
Integrates with a personal LINE account via LINE SelfBot, enabling tools to list chats, read message history, retrieve images for vision analysis, send text messages, and send E2EE images to individual or group chats.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@line-selfbot-mcp อ่านข้อความล่าสุด 10 ข้อความในกลุ่ม Dev Team แล้วสรุปให้หน่อย"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
line-selfbot-mcp
English | ภาษาไทย
LINE SelfBot MCP Server for Claude Desktop (v2.0.0 - 14 Tools)
Connect and control personal LINE accounts directly from AI Agents using the @evex/linejs library. Enables Claude Desktop to read, send, and receive messages, images, and files with End-to-End Encryption (E2EE), manage contacts/profiles, and listen for incoming messages in real-time—all headless without needing the LINE Desktop GUI application open.
🏛️ System Architecture
💡 Original Diagram Assets: View the interactive HTML version at
assets/line-selfbot-architecture.htmlor download the editable draw.io diagram atassets/line-selfbot-architecture.drawio.
flowchart TD
Claude["Claude Desktop<br/>(AI Agent)"] <-->|"MCP over stdio<br/>(JSON-RPC)"| MCP["mcp-server.js v2.0.0<br/>(@modelcontextprotocol/sdk)"]
MCP <-->|"Thrift RPC / E2EE / HTTPS"| LineJS["@evex/linejs<br/>(LINE Client Engine)"]
LineJS <-->|"legy.line-apps.com<br/>obs.line-apps.com"| LineServer["LINE Server"]
subgraph Storage & Local Files
LoginScript["run.js (Login)"] -.->|"Save AuthToken"| Storage["storage.json<br/>(Secret Key - E2EE)"]
Storage -.->|"Auto-load Token"| MCP
MCP -.->|"Save Attachments"| Downloads["downloads/<br/>(Files / Images / Videos)"]
end
subgraph Real-Time Engine
LineServer -.->|"Push Events (Long-polling)"| LineJS
LineJS -.->|"c.on('message')"| InboxBuffer["inbox Buffer<br/>(Max 500 msgs)"]
InboxBuffer -.->|"wait_for_message<br/>get_new_messages"| MCP
endComponent | Responsibility |
| LINE Client simulation engine connecting directly to LINE backend via Thrift RPC with E2EE and long-polling |
| One-time interactive terminal script to scan QR code, authenticate with PIN, and persist |
| Fast, lightweight MCP server hosting 14 tools over Stdio JSON-RPC protocol |
| Stores AuthToken, RefreshToken, Certificate, and E2EE Private Keys (Strictly Confidential - Never Share) |
| Dedicated local directory for attachments and media downloaded from LINE |
| Extension definition for 1-click installation via Anthropic Desktop Extension ( |
Related MCP server: line-desktop-mcp
✨ Key Features
💬 Read & Summarize Chats: Fetch recent chats (
list_chats) for both 1-on-1 private conversations and group chats, with contact names and unread counts.📜 Message History: Retrieve historical messages (
get_chat_messages) with sender display names (fromName), timestamps, and media indicators.🖼️ Multimodal Vision Support: Extract image attachments (
get_message_image) as Base64 image content blocks so Claude can visually inspect and analyze pictures.📥 Attachment Downloads: Download files, PDF documents, videos, and audio clips (
download_message_file) directly to thedownloads/directory.✉️ Send Messages & Photos: Send text messages (
send_message) and E2EE encrypted images (send_image) from local paths or remote URLs.📎 Send Any File Type: Upload documents (PDF, Word, Excel, ZIP), videos (MP4), and audio (MP3) seamlessly with automatic MIME type resolution (
send_file).👥 Contacts & Group Management: Search friends list (
list_friends), inspect group members and creators (list_group_members), or set custom friend nicknames (rename_friend).👤 Profile Controls: Inspect account profile (
get_my_profile) or update your display name and status message (update_my_profile).⚡ Real-Time Push Inbox: Wait synchronously for incoming messages (
wait_for_message) or query newly received messages from the real-time buffer (get_new_messages).
📋 Prerequisites
Operating System: Windows 10/11, macOS, or Linux
Node.js: Version 22 or higher (tested on v22 and v24)
Claude Desktop: Latest release
Mobile Device: Smartphone running the official LINE app logged in to your account (required for QR scan and 4-digit PIN confirmation)
🚀 Quick Start Guide
1. Clone Repository & Install Dependencies
git clone https://github.com/um1981/line-selfbot-mcp.git
cd line-selfbot-mcp
npm installNote: The project includes a configured
.npmrcpointing to the JSR registry (@jsr:registry=https://npm.jsr.io), allowing standardnpm installto resolve@evex/linejsautomatically.
2. Authenticate with LINE (First-time only)
Run the login script in your terminal:
npm run login
# or: node run.jsA QR Code will appear directly in your terminal.
Open the LINE app on your smartphone and scan the terminal QR code.
Enter the 4-digit PIN code shown on your terminal into your smartphone to authorize the login.
Once completed, your session credentials will be saved automatically to
storage.json.
3. Configure Claude Desktop
Open your Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the LINE-SelfBot entry under mcpServers (replace the paths with your exact local project directory):
{
"mcpServers": {
"LINE-SelfBot": {
"command": "node",
"args": [
"C:\\Users\\<Username>\\path\\to\\line-selfbot-mcp\\mcp-server.js"
],
"cwd": "C:\\Users\\<Username>\\path\\to\\line-selfbot-mcp"
}
}
}⚠️ Important: Always provide the
"cwd"property pointing to your project directory. This avoids file permission errors (EPERM) caused by Claude Desktop launching processes fromC:\Windows\System32on Windows.
Restart Claude Desktop to load the new MCP server.
🛠️ Available MCP Tools (14 Tools)
👤 Profile Management
Tool | Parameters | Description |
| – | View personal profile information (display name, MID, status message, LINE user ID). |
|
| Update your account display name and/or status message. |
|
| Override a friend's display name locally in your contact list (pass |
👥 Contacts & Groups
Tool | Parameters | Description |
|
| List recent 1-on-1 and group chats ordered by latest conversation. |
|
| Retrieve all friends from contact list with MID and status message. |
|
| Get all members, creator ( |
📖 Reading & Downloading
Tool | Parameters | Description |
|
| Read recent messages with sender name ( |
|
| Fetch raw image data as Base64 for Claude vision analysis. |
|
| Download attachments (PDF, documents, videos, audio) to local disk (default: |
📤 Sending Messages & Files
Tool | Parameters | Description |
|
| Send a plain text message to a recipient or group. |
|
| Send an image (JPEG, PNG, GIF, WebP) with E2EE encryption. |
|
| Send documents (PDF, DOCX, XLSX, ZIP), video (MP4), or audio (MP3) with E2EE. |
⚡ Real-Time Push & Polling
Tool | Parameters | Description |
|
| Block and wait for incoming real-time push messages (up to 50 seconds). |
|
| Query unread messages accumulated in the memory buffer since listener started. |
💡 Example Prompt Ideas
"Check my recent LINE chats and summarize any unread conversations."
"Find all friends in my contact list whose name contains 'Alex'."
"Who is currently in the 'Engineering Team' group, and who created it?"
"Read the last 15 messages in the project group and summarize the discussion."
"An image was just sent in my chat with Sarah—pull the image and describe what it shows."
"Download the latest PDF report sent in the Finance room and summarize its contents."
"Send the sales report file at
C:\reports\q3_summary.xlsxto Michael.""Send 'Are you available for a quick sync?' to John, wait for his reply, and notify me."
"Update my LINE status message to 'Traveling - Available on Slack'."
📦 Packaging as Desktop Extension (.mcpb)
For 1-click installation via Claude Desktop GUI (Settings → Extensions):
npx @anthropic-ai/mcpb packThis compiles a standalone line-selfbot-mcp.mcpb file. Double-click the file to install it.
(Note: You will still need to run run.js once inside the installation folder to establish your initial login session).
⚠️ Security & Disclaimer
Protect
storage.jsonat all costs:
Thestorage.jsonfile contains your active AuthToken, Certificates, and E2EE private keys. It grants complete access to your LINE account. Never commit this file to GitHub and never share it publicly (the repository.gitignoreis already configured to protect it).LINE Terms of Service:
Using a SelfBot is against LINE Corporation's Official Terms of Service. Unnatural messaging frequency or rapid re-logins can lead to account suspension. Always use a secondary/test LINE account for development.Automated Actions:
When instructed, Claude will send messages and update profiles immediately under your actual identity. For safety, you may instruct Claude in your system prompt to require explicit user confirmation before executingsend_messageorsend_file.File Safety:
Files downloaded viadownload_message_fileare written directly to disk. Exercise caution when opening attachments received from unknown contacts.
📜 Version History
Version | Highlights |
v1.0 – v1.2 | Basic support for |
v1.3 | Added 1-on-1 direct message support via |
v1.4 | Added |
v1.5 | Added |
v1.6 | Added |
v1.7 | Added |
v1.8 | Added real-time push architecture: |
v1.9 | Added |
v2.0.0 | Full suite of 14 tools including |
📚 References & Resources
📄 License
MIT License © 2026 um1981
Available Tools
14 toolsdownload_message_fileA
ดาวน์โหลดไฟล์แนบ (FILE/IMAGE/VIDEO/AUDIO) จากข้อความ บันทึกลงเครื่อง คืน path ของไฟล์
Inputs: chatMid (required), messageId (required), saveDir.
get_chat_messagesB
อ่านประวัติข้อความล่าสุดในแชท หากข้อความเป็นรูปภาพ/ไฟล์จะแสดง [IMAGE]/[FILE] พร้อม messageId
Inputs: chatMid (required), limit.
get_message_imageB
ดึงรูปภาพจากข้อความที่มี ID ระบุ เพื่อให้ AI มองเห็นรูปภาพนั้นโดยตรง
Inputs: chatMid (required), messageId (required).
get_my_profileA
ดูโปรไฟล์บัญชี LINE ของเรา (ชื่อ, MID, ข้อความสถานะ)
Inputs: no named parameters.
get_new_messagesA
ดึงข้อความใหม่ที่เข้ามาตั้งแต่เริ่มฟัง (ไม่รอ คืนทันที) ใช้เช็คว่ามีใครตอบมาบ้างระหว่างที่ไม่ได้ดู
Inputs: clear, chatMid.
list_chatsA
ดึงรายชื่อแชทล่าสุดทั้งหมด (ทั้งแชทส่วนตัว 1-on-1 และแชทกลุ่ม) เรียงตามการสนทนาล่าสุด
Inputs: limit.
list_friendsB
ดึงรายชื่อเพื่อนทั้งหมดในสมุดรายชื่อ LINE พร้อม MID และข้อความสถานะ
Inputs: search.
list_group_membersB
ดึงรายชื่อสมาชิกทั้งหมดในกลุ่ม พร้อม MID, ผู้สร้างกลุ่ม และผู้ที่ถูกเชิญแต่ยังไม่ตอบรับ
Inputs: chatMid (required).
rename_friendA
ตั้งชื่อที่แสดงของเพื่อนในเครื่องเรา (เหมือนแก้ชื่อเพื่อนในแอป) ไม่กระทบชื่อจริงของเขา ส่งค่าว่างเพื่อคืนชื่อเดิม
Inputs: newName (required), userMid (required).
send_fileB
ส่งไฟล์ (PDF, Word, Excel, ZIP, วิดีโอ, เสียง ฯลฯ) ไปยังห้องแชทหรือบุคคล ระบุ filePath หรือ fileUrl อย่างใดอย่างหนึ่ง
Inputs: chatMid (required), fileUrl, fileName, filePath.
send_imageB
ส่งรูปภาพไปยังห้องแชทหรือบุคคล ระบุ filePath (ไฟล์ในเครื่อง) หรือ imageUrl อย่างใดอย่างหนึ่ง
Inputs: chatMid (required), filePath, imageUrl.
send_messageB
ส่งข้อความไปยังห้องแชทหรือบุคคล
Inputs: chatMid (required), message (required).
update_my_profileB
เปลี่ยนชื่อที่แสดง (displayName) และ/หรือข้อความสถานะ (statusMessage) ของบัญชี LINE ตัวเอง ต้องยืนยันกับผู้ใช้ก่อนเปลี่ยน
Inputs: displayName, statusMessage.
wait_for_messageB
รอข้อความใหม่จาก LINE แบบ real-time (สูงสุด 50 วินาทีต่อครั้ง) คืนข้อความที่เข้ามาระหว่างรอ ระบุ chatMid เพื่อรอเฉพาะห้อง เรียกซ้ำได้หากยังไม่มีข้อความ
Inputs: chatMid, timeoutSec.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have clearly distinct resource+action targets (profile, friends, chats, sending by media type). The only mild overlap is between get_new_messages and wait_for_message (both retrieve incoming messages, differing only in blocking behavior), plus a slight image-specific vs generic download split (get_message_image vs download_message_file), but descriptions differentiate them adequately.
All 14 names follow a consistent snake_case verb_noun pattern (get_my_profile, list_chats, send_message, download_message_file, etc.). Even the less common verbs (wait_for, rename) fit the same predictable scheme.
14 tools is well within the ideal 3-15 range and each maps to a concrete messaging operation. Nothing feels redundant or bloated for a LINE automation server.
The surface covers the core lifecycle: read/update own profile, list chats/friends/members, read history, retrieve media, send text/image/file, and receive messages (blocking and polling). Minor gaps exist (no delete/recall message, message search, or friend add/block), but agents can accomplish the primary workflows.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Free WhatsApp MCP server for ChatGPT and Claude: read and search chats, every send you approve.
Let Claude or ChatGPT search, read and send your WhatsApp messages over MCP. OAuth sign-in.
Link a WhatsApp number by QR code and use it from Claude or ChatGPT via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGives Claude Desktop read-only access to your WhatsApp chats and message history via a local MCP server.4MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI tools to read and send messages through LINE Desktop via MCP, supporting manual or automatic sending without official LINE API tokens.131MIT
- FlicenseNot gradedqualityDmaintenanceEnables sending LINE messages (push, multicast, broadcast), retrieving user profiles, checking quotas, and sending flex messages via Claude using the LINE Messaging API.-
- 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