{"id":51148860,"url":"https://github.com/raidenyn/line-mcp","last_synced_at":"2026-06-26T04:30:42.570Z","repository":{"id":365503013,"uuid":"1267222714","full_name":"raidenyn/line-mcp","owner":"raidenyn","description":"Line Messenger MCP server to get access to your messages","archived":false,"fork":false,"pushed_at":"2026-06-17T15:18:53.000Z","size":6514,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T17:25:26.656Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raidenyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-12T10:38:28.000Z","updated_at":"2026-06-17T15:24:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/raidenyn/line-mcp","commit_stats":null,"previous_names":["raidenyn/line-mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raidenyn/line-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raidenyn%2Fline-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raidenyn%2Fline-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raidenyn%2Fline-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raidenyn%2Fline-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raidenyn","download_url":"https://codeload.github.com/raidenyn/line-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raidenyn%2Fline-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34803678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-26T04:30:41.862Z","updated_at":"2026-06-26T04:30:42.548Z","avatar_url":"https://github.com/raidenyn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LINE MCP Server\n\nAn [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that exposes your LINE messenger to AI assistants. Lets Claude read your chats, messages, and images directly from LINE.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `list_chats` | List recent LINE chats |\n| `get_messages` | Fetch messages from a chat |\n| `get_image` | Download and return an image from a message |\n| `sample_messages` | Fetch raw text messages with timestamps; accepts optional `since`/`until` for historical ranges — use before writing regex templates |\n| `manage_templates` | Save, update, delete, or list regex templates for a chat (persisted in `data/templates/`) |\n| `get_transactions` | Parse bank notifications into structured transactions; paginates the full history when `since` is given; auto-loads saved templates |\n| `summarize_transactions` | Aggregate transactions into totals grouped by month or merchant |\n\n### Transaction tools\n\nSome LINE channels (e.g. UOB Thai, CardX Thailand, SCB Connect) deliver bank notifications as templated messages. The transaction tools let Claude extract structured data from them without any hardcoded parsers.\n\nTemplates are saved per-chat on the server and loaded automatically — no need to re-derive patterns each session.\n\n**Workflow (first time for a new bank chat):**\n1. Call `sample_messages` to inspect raw message text — pass `since` to reach older messages if the bank changed its format months ago\n2. Call `manage_templates` (`action: upsert`) to save a named regex template — required capture groups are `(?\u003coriginal_amount\u003e...)` and `(?\u003coriginal_currency\u003e...)`; add `(?\u003cbalance\u003e...)` to enable automatic native-currency `amount` calculation from balance diffs\n3. Call `get_transactions` with no `templates` argument — saved templates are loaded automatically\n4. Call `summarize_transactions` to get totals grouped by month or merchant\n\n**Workflow (subsequent sessions):**\n- Just call `get_transactions` — templates are already saved.\n\nTemplates support `valid_from` / `valid_until` (ISO 8601 with timezone) so that old messages are handled by old templates and new messages by new ones when a bank changes its format.\n\n**Example — UOB Thai** (bilingual Thai+English messages, non-breaking spaces around \"Available credit\"):\n```json\n{\n  \"name\": \"uob-debit\",\n  \"pattern\": \"You\\\\s+have\\\\s+spent\\\\s+(?\u003coriginal_currency\u003eTHB)\\\\s+(?\u003coriginal_amount\u003e[\\\\d,]+\\\\.?\\\\d*)\\\\s+using\\\\s+UOB\\\\s+card\\\\s+\\\\(ending\\\\s+(?\u003caccount\u003e[^)]+)\\\\)\\\\s+at\\\\s+(?\u003cmerchant\u003e.+?)\\\\s+on\\\\s+(?\u003cdate\u003e\\\\d{2}/\\\\d{2})\\\\.\\\\s+Available\\\\s+credit:\\\\s+THB\\\\s+(?\u003cbalance\u003e[\\\\d,]+\\\\.?\\\\d*)\",\n  \"amount_sign\": \"debit\",\n  \"date_format\": \"DD/MM\"\n}\n```\n\n**Example — CardX Thailand** (English-only, date format \"9 Jun 26\"):\n```json\n{\n  \"name\": \"cardx-debit\",\n  \"pattern\": \"CardX\\\\s+would\\\\s+like\\\\s+to\\\\s+inform\\\\s+that\\\\s+you\\\\s+have\\\\s+made\\\\s+transaction\\\\s+via\\\\s+card\\\\s+ending\\\\s+with\\\\s+(?\u003caccount\u003e\\\\d+)\\\\s+at\\\\s+(?\u003cmerchant\u003e.+?)\\\\s+in\\\\s+the\\\\s+amount\\\\s+of\\\\s+(?\u003coriginal_amount\u003e[\\\\d,]+\\\\.?\\\\d*)\\\\s+(?\u003coriginal_currency\u003e[A-Z]+)\\\\s+on\\\\s+(?\u003cdate\u003e.+?)\\\\.\\\\s+You\\\\s+have\\\\s+available\\\\s+credit\\\\s+limit\\\\s+(?\u003cbalance\u003e[\\\\d,]+\\\\.?\\\\d*)\",\n  \"amount_sign\": \"debit\"\n}\n```\n\n\u003e **Tip:** Use `\\\\s+` instead of a literal space throughout patterns. LINE bank messages frequently contain non-breaking spaces (U+00A0) that look identical but break literal-space matches.\n\n\u003e **Tip:** Pass `since` to `get_transactions` (e.g. `since: \"2026-05-01\"`) to fetch the complete history for a month. Without `since`, only the latest 200 messages are checked.\n\nWhen a bank changes its message format, save a new template with an appropriate `valid_from` date — no code changes needed.\n\n## How it works\n\nThe server runs as an HTTP server using the [Streamable HTTP MCP transport](https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/transports/#streamable-http). It implements OAuth 2.0, so Claude Code handles authentication natively — no manual token setup required.\n\n**Auth flow:**\n1. On first use, Claude Code detects a `401` and opens an authorization page in your browser\n2. A QR code is displayed — scan it with the LINE mobile app\n3. Enter the PIN if prompted (skipped on repeat logins using a saved certificate)\n4. Claude Code receives tokens automatically and retries the tool call\n\n**Token lifecycle:** MCP tokens are self-contained HMAC-signed blobs embedding LINE credentials and expiry. The signing key is stored in `data/secret`. LINE access tokens are refreshed transparently when they near expiry.\n\n**Message cache:** Every message fetched from LINE is automatically stored in a local SQLite database (`data/cache/messages.db`). On subsequent calls, the server reads from the cache first and only fetches messages newer than the latest cached entry from LINE. This means history older than LINE's ~2-week API window remains accessible indefinitely — `since` dates from months ago work without any special configuration.\n\n## Usage\n\n### Docker (recommended)\n\n```bash\ndocker compose up -d\nclaude mcp add --transport http --scope user line http://localhost:3000/mcp\n```\n\nCall any LINE tool in Claude — the OAuth flow will trigger automatically on first use.\n\n### Local development\n\n**Prerequisites:** Node.js 20+\n\n```bash\nnpm install\nnpm start          # starts HTTP MCP server on http://localhost:3000\n```\n\n```bash\nclaude mcp add --transport http --scope user line http://localhost:3000/mcp\n```\n\n## Commands\n\n```bash\nnpm run build        # compile TypeScript → dist/\nnpm start            # run with ts-node (development)\nnpm test             # run all tests\nnpm run test:unit    # run unit tests only (no LINE session required)\nnpm run test:e2e     # run e2e tests (requires .line-auth.json)\n```\n\n## E2E tests\n\nTests require a valid LINE session. Export your auth data to `.line-auth.json` in the project root, then run `npm run test:e2e`. The test suite launches the server as a child process, seeds a test token to bypass OAuth, and connects over the MCP HTTP transport.\n\n## Security notes\n\n- `data/secret` — auto-created on first run; backs all token signatures. Back it up; deleting it invalidates all issued tokens.\n- `.line-auth.json` — contains live LINE credentials. Keep it out of version control (it is in `.gitignore`).\n- The server binds to `0.0.0.0` — use a firewall or reverse proxy if exposing beyond localhost.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraidenyn%2Fline-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraidenyn%2Fline-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraidenyn%2Fline-mcp/lists"}