实现通知自动化闭环:SQLite任务状态、定时同步、未处理查询与回复状态回写;下线MCP对外未读通知工具
This commit is contained in:
+10
-3
@@ -6,10 +6,11 @@
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 小红书 **17 个 MCP 工具**(登录、浏览、发布、互动、通知)
|
||||
- 小红书 **17 个 MCP 工具**(登录、浏览、发布、互动、通知、自动化)
|
||||
- 带 Bearer Token 鉴权与按路由限流的 REST API
|
||||
- 基于 `rebrowser-playwright` 的浏览器自动化,按平台串行队列执行
|
||||
- 文件型 Cookie 持久化(`0600` 权限、原子写入)
|
||||
- 通知任务状态入库 SQLite(`$COOKIE_DIR/xiaohongshu/automation.db`),保障自动回复幂等
|
||||
- Web 控制台(React + Vite):登录、内容浏览、发布、接口测试
|
||||
- 安全控制:Token 常量时间比对、绑定地址安全门、错误信息脱敏、日志字段脱敏
|
||||
- 支持 Docker 部署
|
||||
@@ -102,7 +103,7 @@ pnpm test
|
||||
| `xhs_reply_comment` | 回复评论 |
|
||||
| `xhs_like` | 切换点赞状态 |
|
||||
| `xhs_favorite` | 切换收藏状态 |
|
||||
| `xhs_get_comment_notifications` | 获取未读评论/@通知 |
|
||||
| `xhs_get_unprocessed_notifications` | 从本地 SQLite 获取“未处理”通知任务 |
|
||||
| `xhs_reply_notification` | 对通知进行回复 |
|
||||
|
||||
## REST API
|
||||
@@ -151,6 +152,7 @@ curl -X POST \
|
||||
| `POST` | `/api/xhs/like` | 点赞切换 | 10/min |
|
||||
| `POST` | `/api/xhs/favorite` | 收藏切换 | 10/min |
|
||||
| `GET` | `/api/xhs/notifications/comments` | 获取评论通知 | 60/min |
|
||||
| `GET` | `/api/xhs/notifications/unprocessed` | 获取本地未处理通知任务 | 60/min |
|
||||
| `POST` | `/api/xhs/notifications/reply` | 回复通知 | 10/min |
|
||||
|
||||
### 返回格式
|
||||
@@ -229,6 +231,9 @@ docker run -d \
|
||||
| `COOKIE_DIR` | `~/.social-mcp` | Cookie/Token 存储目录 |
|
||||
| `MAX_QUEUE_DEPTH` | `10` | 单平台最大排队深度 |
|
||||
| `ALLOW_REMOTE` | 空 | 仅当值为 `yes-i-understand-the-risk` 时允许公网绑定 |
|
||||
| `XHS_NOTIFICATION_POLL_ENABLED` | `true` | 是否启用通知定时同步到 SQLite |
|
||||
| `XHS_NOTIFICATION_POLL_INTERVAL_SEC` | `60` | 通知同步周期(秒,最小 15) |
|
||||
| `XHS_NOTIFICATION_POLL_MAX_COUNT` | `20` | 每次同步最多拉取通知数 |
|
||||
|
||||
## 项目结构
|
||||
|
||||
@@ -265,7 +270,9 @@ social-mcp/
|
||||
│ ├── publish-video.ts
|
||||
│ ├── comment.ts
|
||||
│ ├── interaction.ts
|
||||
│ └── notification.ts
|
||||
│ ├── notification.ts
|
||||
│ ├── notification-state.ts
|
||||
│ └── notification-sync.ts
|
||||
└── web/
|
||||
└── src/
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user