A
amornpan/py-mcp-line
python mcp LINE
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
我们没有从该仓库取到可核对的安装命令,也没有公开的远端端点。这两样都没有时,我们不出配置——编一条出来比不给更糟。 各客户端的接法 →
- 来源明细
- 收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 10 个来源列出
- 评分构成
- 综合分 1,003 · 10 个来源 · mcp
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
# Python LINE MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol server implementation in Python that provides access to LINE Bot messages. This server enables Language Models to read and analyze LINE conversations through a standardized interface.
## Features
### Core Functionality
Asynchronous operation using Python's asyncio
Environment-based configuration using python-dotenv
Comprehensive logging system
LINE Bot webhook event handling
Message storage in JSON format
FastAPI integration for API endpoints
Pydantic models for data validation
Support for text, sticker, and image messages
## Prerequisites
Python 3.8+
Required Python packages:
fastapi
pydantic
python-dotenv
mcp-server
line-bot-sdk
uvicorn
## Installation
bash
git clone https://github.com/amornpan/py-mcp-line.git
cd py-mcp-line
pip install -r requirements.txt
## Project Structure
PY-MCP-LINE/
├── src/
│ └── line/
│ ├── init.py
│ └── server.py
├── data/
│ └── messages.json
├── tests/
│ ├── init.py
│ └── testline.py
├── .env
├── .env.example
├── .gitignore
├── README.md
├── Dockerfile
└── requirements.txt
### Directory Structure Explanation
src/line/ - Main source code directory
init.py - Package initialization
server.py - Main server implementation
data/ - Data storage directory
messages.json - Stored LINE messages
tests/ - Test files directory
init.py - Test package initialization
testline.py - LINE functionality tests
.env - Environment configuration file (not in git)
.env.example - Example environment configuration
.gitignore - Git ignore rules
README.md - Project documentation
Dockerfile - Docker configuration
requirements.txt - Project dependencies
## Configuration
Create a .env file in the project root:
env
LINECHANNELSECRET=yourchannelsecret
LINEACCESSTOKEN=youraccesstoken
SERVERPORT=8000
MESSAGESFILE=data/messages.json
## API Implementation Details
### Resource Listing
python
@app.listresources()
async def listresources() -> list[Resource]
Lists available message types from the LINE Bot
Returns resources with URIs in the format line:// /data
Includes resource descriptions and MIME types
### Resource Reading
python
@app.readresource()
async def readresource(uri: AnyUrl) -> str
Reads messages of the specified type
Accepts URIs in the format line:// /data
Returns messages in JSON format
Supports filtering by date, user, or content
## Usage with Claude Desktop
Add to your Claude Desktop configuration:
On MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json
On Windows: %APPDATA%/Claude/claudedesktopconfig.json
json
"mcpServers": {
"line": {
"command": "python",
"args": [
"server.py"
],
"env": {
"LINECHANNELSECRET": "yourchannelsecret",
"LINEACCESSTOKEN": "youraccesstoken",
"SERVERPORT": "8000",
"MESSAGESFILE": "data/messages.json"
## Error Handling
The server implements comprehensive error handling for:
Webhook validation failures
Message storage errors
Resource access errors
URI validation
LINE API response errors
All errors are logged and returned with appropriate error messages.
## Features
### Core Functionality
Asynchronous operation using Python's asyncio
Environment-based configuration using python-dotenv
Comprehensive logging system
LINE Bot webhook event handling
Message storage in JSON format
FastAPI integration for API endpoints
Pydantic models for data validation
Support for text, sticker, and image messages
## Prerequisites
Python 3.8+
Required Python packages:
fastapi
pydantic
python-dotenv
mcp-server
line-bot-sdk
uvicorn
## Installation
bash
git clone https://github.com/amornpan/py-mcp-line.git
cd py-mcp-line
pip install -r requirements.txt
## Project Structure
PY-MCP-LINE/
├── src/
│ └── line/
│ ├── init.py
│ └── server.py
├── data/
│ └── messages.json
├── tests/
│ ├── init.py
│ └── testline.py
├── .env
├── .env.example
├── .gitignore
├── README.md
├── Dockerfile
└── requirements.txt
### Directory Structure Explanation
src/line/ - Main source code directory
init.py - Package initialization
server.py - Main server implementation
data/ - Data storage directory
messages.json - Stored LINE messages
tests/ - Test files directory
init.py - Test package initialization
testline.py - LINE functionality tests
.env - Environment configuration file (not in git)
.env.example - Example environment configuration
.gitignore - Git ignore rules
README.md - Project documentation
Dockerfile - Docker configuration
requirements.txt - Project dependencies
## Configuration
Create a .env file in the project root:
env
LINECHANNELSECRET=yourchannelsecret
LINEACCESSTOKEN=youraccesstoken
SERVERPORT=8000
MESSAGESFILE=data/messages.json
## API Implementation Details
### Resource Listing
python
@app.listresources()
async def listresources() -> list[Resource]
Lists available message types from the LINE Bot
Returns resources with URIs in the format line:// /data
Includes resource descriptions and MIME types
### Resource Reading
python
@app.readresource()
async def readresource(uri: AnyUrl) -> str
Reads messages of the specified type
Accepts URIs in the format line:// /data
Returns messages in JSON format
Supports filtering by date, user, or content
## Usage with Claude Desktop
Add to your Claude Desktop configuration:
On MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json
On Windows: %APPDATA%/Claude/claudedesktopconfig.json
json
"mcpServers": {
"line": {
"command": "python",
"args": [
"server.py"
],
"env": {
"LINECHANNELSECRET": "yourchannelsecret",
"LINEACCESSTOKEN": "youraccesstoken",
"SERVERPORT": "8000",
"MESSAGESFILE": "data/messages.json"
## Error Handling
The server implements comprehensive error handling for:
Webhook validation failures
Message storage errors
Resource access errors
URI validation
LINE API response errors
All errors are logged and returned with appropriate error messages.
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/amornpan-py-mcp-line/)
- 来源
- awesome · https://github.com/amornpan/py-mcp-line
- 按领域浏览
- MCP 服务
- 收录来源
- 10 个独立来源
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。