This repository provides a Python implementation of a Model Context Protocol (MCP) server for LINE Bot messages, enabling Language Models to analyze LINE conversations through a standardized interface, using FastAPI and Pydantic.
This Python-based project implements a Model Context Protocol (MCP) server, enabling Language Models to access and analyze LINE Bot conversations through a standardized interface. It leverages Python 3.8+ and key packages like fastapi
, pydantic
, and line-bot-sdk
.
Features: The server offers asynchronous operation, environment-based configuration, comprehensive logging, LINE Bot webhook handling, and JSON-based message storage. It supports text, sticker, and image messages.
Installation & Structure: Installation involves cloning the repository and installing dependencies via pip install -r requirements.txt
. The project structure includes src/line/
for the server implementation, data/
for message storage, and tests/
for testing.
Configuration & Usage: Configuration requires setting up a .env
file with LINE channel secrets, access tokens, and server port details. The server can be integrated with Claude Desktop by adding a configuration block specifying the command, arguments, and environment variables.
API & Error Handling: The server provides API endpoints for listing and reading LINE Bot message resources, supporting filtering by date, user, or content. Comprehensive error handling and security features are implemented.
amornpan/py-mcp-line
February 27, 2025
March 27, 2025
Python