Skip to main content

line-desktop-mcp

Unofficial community project. Not affiliated with, endorsed by, or supported by LINE Corporation or LY Corporation. Uses your own logged-in account through the LINE Chrome Extension. Read tools are side-effect free; clear_session is the only destructive tool and needs explicit confirmation.

FastMCP server for LINE Desktop automation. Wraps line-ext-msg>=1.2 (LINE Chrome Extension reader) as MCP tools.

LINE tools

Read tools are side-effect free (no files written, no media downloaded). Every result uses an ok/data/error envelope; failures carry a next field telling the AI what to ask the user to do. Session tools live in their own domain: probe_session is safe to call any time, clear_session wipes the login and always needs a fresh QR scan afterwards.

Tool Description
line_status 5 readiness checks (Chrome, attach, extension, page, login)
wait_login Open Chrome and wait up to 3 min for the user to log in
list_rooms Chat rooms, optional unread_only / query filter
get_messages Latest messages, optional room ref + date/sender/keyword filters, include_media embeds image data URIs
unread_digest Unread rooms with latest preview in one call
unread_full Unread rooms with message bodies, with per-room progress
search_messages Keyword search inside REQUIRED rooms scope, with per-room progress
probe_session Login state + redacted storage check, safe any time, no side effects
clear_session Wipe LINE login only (destructive, needs confirm=true), next run needs QR scan

First run opens a separate Chrome profile: call line_status, log in with QR/email in the window that opens, then call wait_login. Chrome runs headless by default and pops a visible window only for the QR scan; the login normally survives restarts. Only clear_session forces a fresh login every time. Room ref accepts index, data-mid, or name substring (prefer data-mid or name: index shifts when rooms reorder). Dates use YYYY-MM-DD. search_messages never scans all rooms: pass candidates from list_rooms first. Message reads backfill by scrolling up to limit (bounded ~8s); pass scroll=false for fast on-screen-only reads. When login looks flaky, call probe_session first; call clear_session with confirm=true only after the user agrees to log out. wait_login accepts up to 600 seconds and always covers it without cutting off early. After a QR login it settles briefly and proves headless reuse inside the same call, so ok:true means later tools can call right away with no manual waiting. search_messages skips refs that match no room (returned as RoomNotFound entries) instead of failing the whole call. Image bubbles are text-only by default; pass include_media=true to get_messages when the AI needs to see pictures.

Tests

uv run python -m unittest discover -s tests -v

Browser-free unit tests only (room resolving, envelopes, login wait, session gate, CLI defaults). No Chrome needed.

Run (dev)

uv sync
uv run line-desktop-mcp --help
uv run line-desktop-mcp

Run with HTTP transport for remote access:

uv run line-desktop-mcp --transport http --port 8000

Run via FastMCP CLI:

uv run fastmcp run src/line_desktop_mcp/server.py:mcp

Use without cloning (after PyPI release)

uvx line-desktop-mcp --help
pipx install line-desktop-mcp
pipx run line-desktop-mcp --help

Test a local wheel before release:

uv build
uvx --from ./dist/line_desktop_mcp-1.1.0-py3-none-any.whl line-desktop-mcp --help

Claude Desktop config

{
  "mcpServers": {
    "line-desktop": {
      "command": "uvx",
      "args": ["line-desktop-mcp"]
    }
  }
}

For a local checkout use uv:

{
  "mcpServers": {
    "line-desktop": {
      "command": "uv",
      "args": ["--directory", "D:/path/to/line-desktop-mcp", "run", "line-desktop-mcp"]
    }
  }
}

Structure

src/line_desktop_mcp/
  server.py        # FastMCP("line-desktop-mcp") wiring only
  cli.py           # argparse + mcp.run(), installed as `line-desktop-mcp`
  tools/line_msg.py # LINE tools (status, login wait, rooms, messages, search)
  tools/session.py  # Session tools (probe_session read-only, clear_session destructive)

Add a new tool domain by creating tools/<domain>.py with a register_<domain>_tools(mcp) function, then calling it from server.py.

Publish

uv build
uv publish

Requires requires-python = ">=3.10" and the line-desktop-mcp console script defined in pyproject.toml.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

line_desktop_mcp-1.1.0.tar.gz (144.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

line_desktop_mcp-1.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file line_desktop_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: line_desktop_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 144.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for line_desktop_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 79bcd40c390f309f7f0816ed0b6559685bc0c75925ab4f324ac6ec1a1ee7fbdf
MD5 55971bfeb5a4e4ffa851a88f772401fc
BLAKE2b-256 48a7e9b18ff1e7152697da1e77354d6a29f6b4abdbc9239124cb474539c86c05

See more details on using hashes here.

File details

Details for the file line_desktop_mcp-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: line_desktop_mcp-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for line_desktop_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb0d40529207e5085cf2cfcabd35f223468eb5fd138436a4de5fa0f804d82d04
MD5 f0d4a11d20e247eed2f30bc53ffe0f44
BLAKE2b-256 9eb34fe0aff6bdbc2994bd1b23a7dd981f343c0c2144e91a82baa166695fa94a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page