feat: 添加小红书Feed评论功能 (#50)

实现通过HTTP GIN API和MCP API发表评论到小红书Feed的功能:
- 新增POST /api/v1/feeds/comment端点
- 新增post_comment_to_feed MCP工具
- 添加PostCommentRequest和PostCommentResponse类型
- 实现PostCommentToFeed服务方法
- 新增CommentFeedAction用于浏览器自动化操作

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
zy
2025-09-09 23:13:05 +08:00
committed by GitHub
parent 8fdb461f8f
commit cd28e4064e
8 changed files with 204 additions and 1 deletions

View File

@@ -233,6 +233,28 @@ func (s *AppServer) processToolsList(request *JSONRPCRequest) *JSONRPCResponse {
"required": []string{"feed_id", "xsec_token"},
},
},
{
"name": "post_comment_to_feed",
"description": "发表评论到小红书笔记",
"inputSchema": map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"feed_id": map[string]interface{}{
"type": "string",
"description": "小红书笔记ID从Feed列表获取",
},
"xsec_token": map[string]interface{}{
"type": "string",
"description": "访问令牌从Feed列表的xsecToken字段获取",
},
"content": map[string]interface{}{
"type": "string",
"description": "评论内容",
},
},
"required": []string{"feed_id", "xsec_token", "content"},
},
},
}
return &JSONRPCResponse{
@@ -275,6 +297,8 @@ func (s *AppServer) processToolCall(ctx context.Context, request *JSONRPCRequest
result = s.handleSearchFeeds(ctx, toolArgs)
case "get_feed_detail":
result = s.handleGetFeedDetail(ctx, toolArgs)
case "post_comment_to_feed":
result = s.handlePostComment(ctx, toolArgs)
default:
return &JSONRPCResponse{
JSONRPC: "2.0",