@studiotoonoo/mcp-line
v1.0.2
Published
MCP server for sending messages to LINE via LINE Messaging API
Downloads
386
Readme
mcp-line
MCP Server สำหรับส่งข้อความไปยัง LINE ผ่าน LINE Messaging API
ความสามารถ (Tools)
| Tool | คำอธิบาย |
|------|---------|
| send_text | ส่งข้อความ text ไปยัง LINE user ที่กำหนด |
| send_image | ส่งรูปภาพไปยัง LINE user ที่กำหนด |
| broadcast_text | broadcast ข้อความไปยังทุกคนที่เป็น friend ของ bot |
| get_bot_info | ดึงข้อมูล LINE bot เช่น ชื่อ, รูปโปรไฟล์, จำนวน follower |
ความต้องการเบื้องต้น
- Node.js 18 ขึ้นไป (ตรวจสอบด้วย
node --version) — ดาวน์โหลด Node.js - LINE Messaging API Channel Access Token (สร้างได้ที่ LINE Developers Console)
การติดตั้ง
Claude Desktop
เพิ่มการตั้งค่าใน claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"mcp-line": {
"command": "npx",
"args": ["-y", "@studiotoonoo/mcp-line@latest"],
"env": {
"LINE_CHANNEL_ACCESS_TOKEN": "your_channel_access_token_here",
"LINE_DEFAULT_USER_ID": "Uxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Claude Code (CLI)
claude mcp add mcp-line -- npx -y @studiotoonoo/mcp-line@latestจากนั้นตั้งค่า environment variables:
export LINE_CHANNEL_ACCESS_TOKEN="your_channel_access_token_here"
export LINE_DEFAULT_USER_ID="Uxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Smithery
ติดตั้งผ่าน Smithery Marketplace แล้วกรอก token ใน config form
Environment Variables
| Variable | Required | คำอธิบาย |
|----------|----------|---------|
| LINE_CHANNEL_ACCESS_TOKEN | ✅ | Channel Access Token จาก LINE Developers Console |
| LINE_DEFAULT_USER_ID | ❌ | LINE userId ของผู้รับ default (ขึ้นต้นด้วย U...) |
วิธีหา LINE Channel Access Token
- ไปที่ LINE Developers Console
- เลือก Provider → Channel → Messaging API
- เลื่อนลงไปที่ Channel access token → กด Issue
วิธีหา LINE User ID
ส่ง message ใดๆ ให้ bot ก่อน จากนั้นดู User ID ได้จาก:
- LINE Developers Console → Messaging API → Webhook
- หรือใช้ tool
get_bot_infoเพื่อดู User ID ของตัวเอง
ตัวอย่างการใช้งาน
ส่งข้อความ "สวัสดี" ไปหา LINE ของฉันbroadcast ข้อความ "แจ้งเตือน: ระบบจะ maintenance วันพรุ่งนี้ 02:00-04:00 น."ดึงข้อมูล LINE bot ของฉันLicense
MIT
