这是一个用于与微信读书(WeRead)API交互的工具,旨在助力大语言模型客户端(LLM clients)获取并处理微信读书的数据,可获取用户书架信息、搜索特定类别书籍以及获取指定书籍的笔记和标注。
本工具可帮助大语言模型客户端与微信读书API交互,获取和处理微信读书的数据。使用前需完成安装和环境变量配置。
{
"total_books": 208,
"books": [
{
"title": "隐藏的自我",
"author": "大卫·伊格曼",
"progress": 100,
"isbn": "9787536684455"
},
...
]
}
keyword:需要搜索的关键词max_results (可选):返回的最大结果数,默认为10[
{
"title": "思考,快与慢",
"author": "丹尼尔·卡尼曼",
"progress": 75,
"isbn": "9787208056432"
},
...
]
book_id:需要查询的书籍ID{
"chapter_1": [
{
"type": "highlight",
"content": "系统1的运行是无意识且快速的,不怎么费脑力..."
},
{
"type": "note",
"content": "系统1负责直觉和快速判断,系统2负责缓慢的理性思考。"
}
},
...
}
git clone https://github.com/yourusername/we-read-mcp.git
cd we-read-mcp
pip install requests configargparse
python main.py
可以通过以下方式配置:
config.json{
"cookie": "填写你的微信读书Cookie",
"proxy": "http://your-proxy-server:port"
}
export WEREAD_COOKIE="填写你的微信读书Cookie"
export WEREAD_PROXY="http://your-proxy-server:port"
python main.py --command get_bookshelf
输出:
{
"total_books": 208,
"books": [
{
"title": "隐藏的自我",
"author": "大卫·伊格曼",
"progress": 100,
"isbn": "9787536684455"
},
...
]
}
python main.py --command search_books --keyword "心理学" --max_results 5
输出:
[
{
"title": "思考,快与慢",
"author": "丹尼尔·卡尼曼",
"progress": 75,
"isbn": "9787208056432"
},
...
]
python main.py --command get_book_notes_and_highlights --book_id "9787208056432"
输出:
{
"chapter_1": [
{
"type": "highlight",
"content": "系统1的运行是无意识且快速的,不怎么费脑力..."
},
{
"type": "note",
"content": "系统1负责直觉和快速判断,系统2负责缓慢的理性思考。"
}
},
...
}
本项目采用MIT License协议开源。