Skip to main content
Glama
line-desktop-mcp

line-desktop-mcp

by onlygummy

line-desktop-mcp

ci pypi downloads

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

  • login scans a QR code and saves the LINE session.

  • logout ends the session and deletes the saved login; the archive is kept.

  • list_chats lists chats with name, kind, unread count, and a last preview.

  • get_messages reads one chat and returns its messages, with images attached.

  • search_messages searches the local archive for text across chats.

  • unread summarises 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 sync

Point the client at the checkout:

{
  "mcpServers": {
    "line-desktop-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/line-desktop-mcp", "line-desktop-mcp"]
    }
  }
}
  1. Ask the client to call login.

  2. A window titled Line Desktop MCP opens on the machine running the server.

  3. Scan the code with the LINE app, and enter the PIN if LINE asks for one.

  4. Call list_chats to find the chat you want.

  5. Call get_messages with 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 tools
get_messagesRead LINE messagesA
Idempotent

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 chatsA
Idempotent

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 LINEA
Idempotent

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 LINEA
DestructiveIdempotent

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 messagesA
Idempotent

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 messagesA
Idempotent

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

    A4.4/5.0

    Scored across 6 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count5/5

    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.

    Completeness3/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI tools to read and send messages through LINE Desktop via MCP, supporting manual or automatic sending without official LINE API tokens.
      131
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      MCP server for browser automation that drives Chrome via an extension, preserving login state and offering 45 tools for navigation, interaction, scraping, and screenshots.
      53
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables a single LINE account to be managed over MCP, with status checks, chat listing, recent message retrieval, and two-step text message sending.
      1
      MIT