Content
# Tool List
MCP (Model Context Protocol) server that allows AI assistants (Claude, etc.) to control your LINE account — view chat lists, read/view message history, check unread messages, send/respond to messages, view group member lists, and read images in chats.
> ⚠️ **Warning:** This is a self-bot (runs on a real user account, not an official account) — it violates LINE Terms of Service and **risks account suspension**. It is recommended to use a secondary account for testing only and keep `storage.json` (containing tokens) confidential.
## Features
- 🔐 Login with QR (terminal/web) or authToken — token is saved permanently after one-time login
- 💬 View chat lists, read history (automatically decrypts E2EE), check unread messages
- ✉️ Send/respond to messages (supports E2EE 1:1 and groups)
- 📎 Send images/files/videos/audio (from path, URL, or base64)
- 👥 View group member lists
- 🖼️ Read/download images in chats (can be sent to AI for content analysis)
- 📡 Receive real-time messages
## Installation
Requires [Deno](https://deno.com/) v2+:
```bash
curl -fsSL https://deno.land/install.sh | sh
```
Clone and install dependencies:
```bash
git clone <repo-url> line-self-bot-mcp
cd line-self-bot-mcp
deno install
```
## Login
One-time login — token is saved in `storage.json` and MCP server uses it automatically (including syncing E2EE keys during login to prevent "invalid sender key" issues)
**Scan QR in terminal** (easiest):
```bash
deno task login
```
**Scan QR via web page** (opens browser automatically, suitable for remote machines):
```bash
deno task login:web # opens http://localhost:8770
```
> Remote machine: forward port first — `ssh -L 8770:localhost:8770 user@host`
Open LINE app on mobile → add friend → QR code → scan and you're ready to use
## Connect with Claude
Use **absolute path** of `main.ts` and full path of `deno` (in case PATH doesn't find it)
**Claude Code:**
```bash
claude mcp add -s user line -- /path/to/deno run -A /abs/path/to/line-self-bot-mcp/main.ts
```
**Claude Desktop** — add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"line": {
"command": "/path/to/deno",
"args": ["run", "-A", "/abs/path/to/line-self-bot-mcp/main.ts"]
}
}
}
```
> If you haven't logged in before, you can log in through the tool: `line_login_web` (opens web page + browser), `line_login` (returns QR as an image), or `line_login_token`
## Tools
| Tool | Function |
|------|---------|
**Login**
| Tool | Function |
|------|---------|
| `line_login` | Scan QR to log in (returns QR image) |
| `line_login_web` | Open web page + browser to scan QR automatically |
| `line_login_token` | Log in with existing authToken |
| `line_status` | Check login status + profile |
**Read**
| Tool | Function |
|------|---------|
| `line_list_chats` | Chat lists (groups + friends) with latest messages |
| `line_refresh_chats` | Sync friends/groups from server (when new friends/groups are added) |
| `line_unread` | Unread chats + number of pending messages |
| `line_get_history` | Message history (decrypts E2EE, always up-to-date) |
| `line_recent_messages` | Real-time messages received after server starts |
| `line_group_members` | Group member lists (+ creators / invited members) |
| `line_get_image` | Read/download images in chats for AI content analysis |
**Send**
| Tool | Function |
|------|---------|
| `line_send_message` | Send/respond to messages (supports replyTo) |
| `line_send_image` | Send images (from path / URL / base64) |
| `line_send_file` | Send files/documents/videos/audio (from path / URL / base64) |
| `line_send_flex` | Send Flex Message *(only available for official accounts — regular user accounts cannot send)* |
**Audio settings (prepare for calls)**
| Tool | Function |
|------|---------|
| `line_audio_list` | Dynamically detect microphone/speaker on the machine (PulseAudio/PipeWire) |
| `line_audio_set` | Select microphone/speaker to use (enter full or partial name) |
| `line_audio_test` | Test — play tone on speaker / measure microphone level |
> 💡 Let AI help with audio settings: "View audio devices on the machine" → "Use headset as microphone and speaker" → "Test audio"
### Example commands with AI
- "Check unread LINE chats"
- "Read chat with [name] and summarize"
- "Respond to [name] with ..."
- "Send image /path/to/pic.jpg to [name]"
- "View members of group [group name]"
## Structure
```
main.ts entry point — creates server + service and connects stdio
login.ts login helper (scan QR in terminal/web)
storage.json session/token (do not commit — in .gitignore)
src/
types.ts shared types
config.ts paths, ports, constants (media kind, etc.)
browser.ts opens browser across OS
line/service.ts service layer — login, chats, history, send, E2EE, polling
web/login-page.ts login web page (QR)
tools/ defines MCP tools by category
index.ts registers all tools
helpers.ts ok / json / guard
format.ts formats text (time, transcript)
login.ts tools: login / status
chats.ts tools: list / unread / history / group members
messages.ts tools: send / flex / recent
media.ts tools: get image
```
## Run / Test
```bash
deno task start # run MCP server (stdio)
deno task inspect # open MCP Inspector to test tools interactively
```
## Limitations
- **Flex Message cannot be sent from user accounts** — LINE restricts it to official accounts (`INCOMPATIBLE_APP_VERSION`)
- This is an unofficial client — LINE protocol structure may change at any time
## License
MIT
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
Appwrite
Build like a team of hundreds