# curzer1995-777/line-local-mcp-user-key architecture

> Architecture diagram of the GitHub repository curzer1995-777/line-local-mcp-user-key, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/curzer1995-777/line-local-mcp-user-key
- Repository: https://github.com/curzer1995-777/line-local-mcp-user-key
- Video tour (about a minute): https://gitdiagram.com/curzer1995-777/line-local-mcp-user-key/video

## Overview

LINE Local MCP is a read-only macOS MCP server for searching a user's local LINE Desktop history. An AI client connects through the CLI-launched MCP server, uses tools to check readiness, find chats, read conversations, search messages, or gather recent activity, and receives results with sensitive text redacted by default. Repository operations query disposable encrypted database snapshots using a user-provided Keychain key; the project does not send messages or modify LINE data. The README documents STDIO and loopback HTTP transports. Repository excerpts are partial, so connections among unsampled implementation details are omitted.

Main entry points: [`src/line_local_mcp/repository.py`](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/repository.py) (History repository), [`src/line_local_mcp/server.py`](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py) (MCP server), [`src/line_local_mcp/cli.py`](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/cli.py) (CLI launcher), [`src/line_local_mcp/database.py`](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/database.py) (Snapshot database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP entry"]
  node_cli["CLI launcher<br/>[cli.py]"]
  node_server["MCP server<br/>[server.py]"]
end

subgraph group_tools["Read tools"]
  node_status["LINE status<br/>[server.py]"]
  node_chats["List chats<br/>[server.py]"]
  node_messages["Get messages<br/>[server.py]"]
  node_search["Search messages<br/>[server.py]"]
  node_activity["Recent activity<br/>[server.py]"]
end

subgraph group_data["History access"]
  node_repository["History repository<br/>[repository.py]"]
  node_database["Snapshot database<br/>[database.py]"]
end

subgraph group_privacy["Key and privacy"]
  node_redaction["Sensitive text filter<br/>[redaction.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

node_client(("AI client"))
node_linefiles[("LINE local database")]
node_keychain[("macOS Keychain")]

node_client -->|"starts"| node_cli
node_cli -->|"launches"| node_server
node_server -->|"dispatches"| node_status
node_server -->|"dispatches"| node_chats
node_server -->|"dispatches"| node_messages
node_server -->|"dispatches"| node_search
node_server -->|"dispatches"| node_activity
node_status -->|"calls status"| node_repository
node_chats -->|"lists chats"| node_repository
node_messages -->|"reads messages"| node_repository
node_search -->|"searches text"| node_repository
node_activity -->|"loads activity"| node_repository
node_repository -->|"queries"| node_database
node_database -->|"copies snapshot"| node_linefiles
node_database -->|"reads key"| node_keychain
node_repository -->|"filters text"| node_redaction
node_repository -->|"uses settings"| node_settings
node_cli -->|"checks status"| node_repository
node_cli -->|"stores key"| node_keychain
node_server -->|"serves results"| node_client

click node_cli "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/cli.py"
click node_server "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_status "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_chats "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_messages "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_search "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_activity "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py"
click node_repository "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/repository.py"
click node_database "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/database.py"
click node_redaction "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/redaction.py"
click node_settings "https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_server,node_client toneBlue
class node_status,node_chats,node_messages,node_search,node_activity,node_linefiles,node_keychain toneAmber
class node_repository,node_database toneMint
class node_redaction,node_settings toneRose
```

## Components

### MCP entry

- [CLI launcher](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/cli.py): `src/line_local_mcp/cli.py`
- [MCP server](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`

### Read tools

- [LINE status](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`
- [List chats](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`
- [Get messages](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`
- [Search messages](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`
- [Recent activity](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/server.py): `src/line_local_mcp/server.py`

### History access

- [History repository](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/repository.py): `src/line_local_mcp/repository.py`
- [Snapshot database](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/database.py): `src/line_local_mcp/database.py`

### Key and privacy

- [Sensitive text filter](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/redaction.py): `src/line_local_mcp/redaction.py`
- [Runtime settings](https://github.com/curzer1995-777/line-local-mcp-user-key/blob/main/src/line_local_mcp/config.py): `src/line_local_mcp/config.py`

### Other components

- **AI client**
- **LINE local database**
- **macOS Keychain**

## Connections

- AI client → CLI launcher: starts
- CLI launcher → MCP server: launches
- MCP server → LINE status: dispatches
- MCP server → List chats: dispatches
- MCP server → Get messages: dispatches
- MCP server → Search messages: dispatches
- MCP server → Recent activity: dispatches
- LINE status → History repository: calls status
- List chats → History repository: lists chats
- Get messages → History repository: reads messages
- Search messages → History repository: searches text
- Recent activity → History repository: loads activity
- History repository → Snapshot database: queries
- Snapshot database → LINE local database: copies snapshot
- Snapshot database → macOS Keychain: reads key
- History repository → Sensitive text filter: filters text
- History repository → Runtime settings: uses settings
- CLI launcher → History repository: checks status
- CLI launcher → macOS Keychain: stores key
- MCP server → AI client: serves results
