Lists available message types from the LINE Bot with URIs in the format line://<message_type>/data
Reads messages of the specified type, accepting URIs in the format line://<message_type>/data and returning messages in JSON format
The LINE Bot Integration MCP provides a bridge between language models and LINE messaging platform. It enables AI assistants to read, analyze, and interact with LINE conversations through a standardized Model Context Protocol interface. This server implementation handles webhook events from LINE, stores messages, and makes them accessible through a clean API.
The LINE Bot Integration MCP server allows language models to access and analyze LINE Bot messages. It provides a standardized interface for reading different types of LINE messages including text, stickers, and images.
git clone https://github.com/amornpan/py-mcp-line.git
cd py-mcp-line
pip install -r requirements.txt
.env
file in the project root with your LINE credentials:LINE_CHANNEL_SECRET=your_channel_secret
LINE_ACCESS_TOKEN=your_access_token
SERVER_PORT=8000
MESSAGES_FILE=data/messages.json
data
directory exists:mkdir -p data
Run the server using Python:
python src/line/server.py
The server will start on the port specified in your .env
file (default: 8000).
In your LINE Developer Console, set the webhook URL to your server's endpoint:
https://your-server-domain/webhook
Make sure to enable webhook delivery for your LINE Bot.
The MCP server provides resources in the format line://<message_type>/data
, where <message_type>
can be:
text
- Text messagessticker
- Sticker messagesimage
- Image messagesWhen a language model requests these resources, it will receive the stored messages in JSON format.
The server implements comprehensive error handling for:
All errors are logged and returned with appropriate error messages.
If you encounter issues:
.env
filedata
directory exists and is writableFor additional help, contact the developer at amornpan@gmail.com.