line-desktop-mcp
This MCP server lets you log in to your own LINE account via QR, read and archive your chats/messages/images locally, search them, and sign out, without writing to LINE.
login: scan a QR code and save/reuse a LINE session.logout: invalidate/delete the saved session while keeping the local archive and media.list_chats: list chats with name, kind, unread count, and last preview; supports filtering, caching, and offline archive answers.get_messages: read a chat's messages oldest-first, including time windows, context around a message id, and optional image attachments.search_messages: search locally archived text or message kinds across chats with filters, paging, and optional sync from LINE.unread: summarize unread chats and their newest messages in one call, optionally with images.
Automates LINE Desktop using your logged-in LINE Chrome Extension, providing tools to check login status, list chat rooms, read messages, view unread digests, search messages within selected rooms, and manage the LINE login session.
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-desktop-mcp Show me my unread LINE messages"
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-desktop-mcp
An MCP server that reads your own LINE chats. It logs in by scanning a QR code in a Tk window, lists chats, returns messages with their images, and can sign out again. It uses the unofficial OkLine SDK and FastMCP. Version 4.0.0. It is not affiliated with LINE Corporation or LY Corporation.
Read this first: Terms of Service. Automating a personal LINE account violates LINE's Terms of Service. Your account can be restricted or banned. Use only your own account, keep volumes human-like, and treat the session file as a password.
This server also keeps a plaintext local copy of the chats and images it reads.
What it does
loginscans a QR code and saves the LINE session.logoutends the session and deletes the saved login; the archive is kept.list_chatslists chats with name, kind, unread count, and a last preview.get_messagesreads one chat and returns its messages, with images attached.search_messagessearches the local archive for text across chats.unreadsummarises every chat with unread messages in one call.
It never writes to LINE: it does not send, mark anything as read, or delete anything. Every tool writes on this machine: the session, the message archive, and the image backups.
Related MCP server: nekoro-browser-mcp
Quick start
You need Python 3.10+ with Tk and uv, Node.js 18+ on PATH, a LINE account with its phone signed
in, and Windows, macOS, or Linux. The QR window needs a local desktop session.
Install from PyPI
Add the server to Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"line-desktop-mcp": {"command": "uvx", "args": ["line-desktop-mcp@latest"]}
}
}Or to opencode.json:
{
"mcp": {
"servers": {
"line-desktop-mcp": {"type": "local", "command": ["uvx", "line-desktop-mcp@latest"]}
}
}
}Run from a checkout
git clone https://github.com/onlygummy/line-desktop-mcp.git
cd line-desktop-mcp
uv syncPoint the client at the checkout:
{
"mcpServers": {
"line-desktop-mcp": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/line-desktop-mcp", "line-desktop-mcp"]
}
}
}Ask the client to call
login.A window titled
Line Desktop MCPopens on the machine running the server.Scan the code with the LINE app, and enter the PIN if LINE asks for one.
Call
list_chatsto find the chat you want.Call
get_messageswith the chat mid or part of its name.
Documentation
Read the tool reference, configuration, local storage, troubleshooting, development, and version history. See CONTRIBUTING.md before opening a pull request.
Privacy and safety
Treat the session file as a password: it holds your tokens and Letter Sealing keys.
Treat the archive and the media directory as sensitive: both are plaintext copies.
Tool results become model context at the provider you chose, which is part of the trust boundary.
Read the security policy for the threat model and reporting process.
License
MIT. OkLine is MIT and unofficial. Not affiliated with LINE or LY Corporation.
Available Tools
6 toolsget_messagesRead LINE messagesAIdempotent
Read the newest messages of one LINE chat, oldest first.
Pass after and before to read a time window instead of the newest
slice: a bare date means local midnight, and before includes the whole
day. The archive answers first, so a window that was read before is
cheap and works offline; LINE is only paged back when the archive
cannot fill limit.
Pass around to read the messages around one id, which is how a
search hit turns into its conversation. That answer comes from the
archive only, so the id must have been read before; context sets how
many messages appear on each side and limit is ignored. around
cannot be combined with after or before.
Returns a JSON result plus the images those messages contain. Messages
are decrypted when the saved session holds the Letter Sealing keys; a
sealed message that cannot be opened has sealed: true and no text.
Every message read is stored in a local SQLite archive, and every image
is saved under the media directory before it is attached, so the next
call is cheaper and still works when LINE is unreachable.
Pass include_images=false to keep the image message rows but attach
no image blocks. max_images defaults to 20 and caps the attachments;
max_image_bytes adds an optional byte cap. The ids that were not
attached appear in images_skipped. Pass max_images=null to remove
the count cap for one call.
Check partial: true means the page budget ran out before limit, so
older messages were not reached. Check stale: true means LINE could
not be reached and the result came from the local archive.
Inputs: chat (required), after, limit, around, +5 more.
list_chatsList LINE chatsAIdempotent
List your LINE chats with name, kind, unread count and last preview.
Call this before get_messages to find the chat you want. A direct
chat is named after the other person; a group keeps its LINE name.
Nothing is marked as read. The listing is cached for a few minutes and
archived locally, so it still answers when LINE cannot be reached
(stale: true says the data came from the archive). total counts the
chats after filtering and before the limit; truncated is true when
more chats exist than limit returned.
Inputs: limit, query, unread_only. Returns: object
loginLog in to LINEAIdempotent
Log in by scanning a QR code in a window on this machine.
Call this first. It returns at once when the saved session still works,
so it is safe to call on every start. Otherwise it opens the
'Line Desktop MCP' window, shows the QR, and waits up to timeout_sec
for the scan plus any PIN LINE asks for. Closing that window stops the
wait, in which case nothing is saved.
The window appears on this machine, so the login cannot be completed from a different host. Keep the session file private: it holds the access token and the Letter Sealing keys.
Inputs: force, timeout_sec. Returns: object
logoutLog out of LINEADestructiveIdempotent
Log this device out of LINE and delete the saved session.
LINE is asked to invalidate the session first. If that request fails,
the local file is deleted anyway, because the stored token is what
matters. Your phone stays logged in: only this server's device is
signed out, and the next login scans a fresh QR code.
The archive and the image backups are kept, so nothing that was already read is lost. Every tool still needs a login before it can reach LINE again, because the session file is what they run on.
Inputs: no named parameters. Returns: object
search_messagesSearch LINE messagesAIdempotent
Search archived messages for text, or for a message kind.
Pass query to match text, kinds to match what a message is, or
both. kinds=["image"] with no query is how you find photos and
files, which have no text to match.
Searches the local archive, which holds only the messages this server
has read. Read coverage before concluding that something does not
exist: a small messages_scanned means most history was never read.
Narrow the search with chats, after/before, from_sender, and
since_days. A bare date means local midnight, and before includes
the whole day. When both after and since_days are given, after
wins. order="oldest" answers "where did this start", and offset
pages through more hits; truncated: true means more hits exist
after this page.
from_sender accepts a mid or part of a name, matched only against
senders already archived. Pass chats to narrow the search, and
sync=true to read the newest page of those chats and page older
messages from LINE first (at most three older pages per chat).
Text search only sees messages that have text: images, stickers, and
sealed messages that could not be decrypted never match a query.
Each hit carries a snippet around the match when query was given.
match="words" needs every space-separated term of the query, in any
order, so "invoice today" also finds "today's invoice". It helps Latin
scripts only: Thai has no word separators, which makes the query one
term either way.
Inputs: sync, after, chats, kinds, +8 more. Returns: object
unreadRead unread messagesAIdempotent
List chats with unread messages and the newest messages in each.
One call instead of one get_messages per chat. Chats are ordered by
their latest activity, and chats_skipped says how many unread chats
did not fit in chats_limit. Every message read is archived, and
nothing is marked as read on LINE: the counts stay until the chat is
opened on the phone.
It costs one LINE request per chat, so the caps are low on purpose.
Images are downloaded only with include_images=true, because a digest
of ten chats can hold dozens. When LINE cannot be reached the archive
answers instead, and stale says so.
Inputs: per_chat, chats_limit, include_images.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
login/logout, list_chats, get_messages and search_messages each target a distinct action, but `unread` overlaps with `list_chats` (chat listing) and `get_messages` (newest messages per chat). The descriptions do a good job distinguishing the digest use case from full reads, so misselection is unlikely but possible.
The core read tools follow a clean verb_noun pattern (list_chats, get_messages, search_messages), but `login`, `logout` and especially `unread` break it — `unread` is an adjective with no verb and gives no hint of the action performed. Mixed conventions, though still readable.
Six tools is well-scoped for a LINE client: session handling, chat listing, message reading, search and an unread digest. Each tool earns its place with no redundancy padding the surface.
The surface is deliberately read-only: there is no send_message, no reply/react, no mark-as-read, and no way to act on what is read. Coverage of the reading/archiving lifecycle is excellent, but for a messaging domain the write side is a notable gap that will dead-end agents asked to respond.
Maintenance
Related MCP Connectors
Run LinkedIn, email, WhatsApp and iMessage outreach from any MCP client.
Let Claude or ChatGPT search, read and send your WhatsApp messages over MCP. OAuth sign-in.
LinkedIn MCP with 47 tools: post, comment, DM and run comment-to-DM automations inside your limits.
WhatsApp MCP on your own number: read chats, search contacts, send messages.
Related MCP Servers
- 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
- AlicenseCqualityCmaintenanceMCP server for browser automation that drives Chrome via an extension, preserving login state and offering 45 tools for navigation, interaction, scraping, and screenshots.535MIT
- AlicenseAqualityCmaintenanceLets MCP clients automate a logged-in LINE Chrome extension, enabling chat search, message reading, text sending, and live event streaming for messages and chat updates.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables a single LINE account to be managed over MCP, with status checks, chat listing, recent message retrieval, and two-step text message sending.1MIT