Commit Graph

339 Commits

Author SHA1 Message Date
zy
cd28e4064e 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>
2025-09-09 23:13:05 +08:00
zy
8fdb461f8f docs: update CLAUDE.md with development guidelines (#46)
- Add requirements for formatting Go source files after modifications
- Specify the need to delete unnecessary scripts and build files generated during testing
- Introduce a branching policy for feature changes
- Establish a rule against pushing to remote without prior approval
- Outline the review process including local and remote PR reviews
2025-09-09 01:11:25 +08:00
zy
cc14518d03 docs: add feed detail feature documentation with video demo
- Add new feature section for getting post details with interactions and comments
- Include important tips about required parameters (feedID and xsec_token)
- Add reminder that login is required for this feature
- Add hint to users about clicking titles to expand video demos
- Include video demonstration link

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 01:06:03 +08:00
zy
27575689a6 feat: enhance feed detail functionality with MCP interface improvements (#45)
* feat: add feed detail page functionality with gin and MCP interfaces

Add comprehensive Feed detail page support:
- Create new FeedDetailAction in xiaohongshu/feed_detail.go
- Add HTTP API endpoint POST /api/v1/feeds/detail
- Add MCP tool 'get_feed_detail' for MCP protocol support
- Support feed_id and xsec_token parameters (both required)
- Raw __INITIAL_STATE__ JSON data saved to feed_detail.json
- Return structured data for both HTTP and MCP interfaces

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance feed detail functionality with MCP interface improvements

- Add comprehensive feed detail page support with proper data extraction
- Create dedicated feed_detail.go file for FeedDetailAction
- Optimize Go struct definitions based on actual JSON data analysis
- Remove unnecessary fields from FeedDetail, DetailImageInfo, CommentList, and Comment structs
- Update MCP interface description to reflect comment retrieval capability
- Support both HTTP REST API and MCP protocol interfaces
- Implement proper Vue 3 reactive data extraction from window.__INITIAL_STATE__
- Include feed content, user info, interaction data, and comment lists

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: restore JSON file writing for testing and improve code structure

- Restore feed_detail.json file writing for testing purposes
- Improve error handling by separating marshal and unmarshal steps
- Keep the original data extraction logic for complex Vue reactive data structure

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: simplify JSON unmarshaling using struct instead of map[string]any

- Replace complex map[string]any extraction with direct struct unmarshaling
- Define inline struct matching the actual JSON response structure
- Remove unnecessary extractFeedDetailData and extractNestedValue methods
- Significantly reduce code complexity and improve readability

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

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: improve MCP interface descriptions for better usability

- Enhance get_feed_detail parameter descriptions with clear source information
- Clarify publish_content images parameter supports both local paths and URLs
- Improve search_feeds description to specify supported search types
- Keep descriptions concise and practical without over-complication

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: revert search_feeds keyword description to keep it simple

- Remove unnecessary details from keyword description
- Keep interface descriptions concise and clear

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 00:55:24 +08:00
zy
12ba28759f docs: add video demonstrations to main features with collapsible sections (#40)
- Replace plain text feature list with collapsible sections
- Add video demonstrations for all 5 main features:
  * Login and check login status (2 videos)
  * Publish image-text content (1 video)
  * Search content (1 video)
  * Get recommendation list (1 video)
- Merge login and check login status into single feature point
- Organize features in logical usage order
- Maintain clean document structure with expandable video demos

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-07 22:59:22 +08:00
zy
6517cc1423 docs: merge MCP_README.md into main README with collapsible sections (#39)
- Consolidate all MCP client integration docs into single README
- Replace simple client list with detailed collapsible sections
- Add enhanced quick start with service verification steps
- Include all tested configurations for Cursor, VSCode, MCP Inspector
- Preserve all demo screenshots and configuration examples
- Remove duplicate MCP_README.md file to reduce maintenance overhead

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-07 22:45:38 +08:00
zy
0d66edf55d Merge pull request #34 from xpzouying/update-vscode-mcp
修改 vscode 接入的方式
2025-09-06 21:05:01 +08:00
zy
f7ce2a7b16 修改 vscode 接入的方式
vscode 接入的方式,更换成新的 StreamHTTP 的方式
2025-09-06 21:04:37 +08:00
zy
8c68283edb Merge pull request #33 from xpzouying/fix-mcp-cursor-integration
Fix MCP Cursor integration with Streamable HTTP protocol
2025-09-06 20:31:49 +08:00
zy
9b086c162e fix: implement MCP Streamable HTTP protocol for Cursor integration
- Replace basic JSON-RPC implementation with Streamable HTTP protocol
- Add support for GET (SSE) and POST (JSON-RPC) requests
- Update protocol version from 2024-11-05 to 2025-03-26
- Fix list_feeds tool definition to match actual API (remove unused page/pageSize params)
- Add ping method support for MCP Inspector
- Update Cursor configuration to use url field instead of curl command
- Add comprehensive MCP integration documentation

Fixes #32

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 19:26:05 +08:00
zy
62b87f82d2 Update README.md 2025-09-05 01:44:25 +08:00
zy
0d64bd5e85 Update README.md 2025-09-05 01:30:59 +08:00
zy
ad500c3360 chore: 更新用户名常量为小红书的配置
- 将用户名常量从 "xpzouying" 修改为 "xiaohongshu-mcp" 以反映最新的配置要求
2025-08-31 15:56:01 +08:00
zy
aa09687751 feat: 添加搜索功能 (#16)
- 新增 SearchFeeds 服务方法,支持关键词搜索小红书内容
- 添加 search_feeds MCP 工具,提供搜索接口
- 新增 /api/v1/feeds/search API 端点
- 实现搜索页面的浏览器自动化操作
- 优化 MCP 协议支持,处理 notifications/initialized 和 notifications/cancelled 通知
- 更新文档,添加搜索功能说明和使用示例
- 重构类型定义,优化数据结构

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 23:35:22 +08:00
zy
a0a063d418 fix: 修复 settings.local.json 文件中的配置项格式
- 更新配置项,确保 JSON 格式正确
- 添加新的浏览器导航和点击操作支持

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-08-17 16:57:04 +08:00
zy
b64b241651 docs: 更新 MCP_README.md,增强 Claude Desktop 和 Cursor 的配置说明 (#15)
- 📝 修改 Claude Desktop 的 MCP 服务器配置示例,更新为使用 curl 命令
-  为 Cursor 添加项目级和全局配置示例,提升文档清晰度
- 🔧 更新相关图片文件,确保文档内容一致性

支持的 MCP 客户端:
 Claude Code CLI
 Claude Desktop
 Cursor
 VSCode
 MCP Inspector

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-08-17 16:55:07 +08:00
zy
1ddc87349e docs: 完善 MCP 服务接入文档,新增 VSCode 配置支持 (#14)
文档改进:
- 📝 重构 MCP_README.md,使文档更加简洁实用
-  新增 VSCode 的 MCP 配置示例和说明
- 🔧 提供多种配置方式:全局设置和工作区设置
- 📚 更新主 README.md,添加 VSCode 到支持的客户端列表
- 🎯 优化文档结构,提升用户体验

支持的 MCP 客户端:
 Claude Code CLI
 Claude Desktop
 Cursor
 VSCode (新增)
 MCP Inspector

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 16:33:08 +08:00
zy
a7e975cf7c refactor: 重构代码架构,解耦处理器和服务 (#13)
重大架构改进:
- 移除全局变量 xiaohongshuService,改用依赖注入
- 将代码按职责分离到不同文件:
  * app_server.go - 核心服务器结构
  * types.go - 统一类型定义
  * routes.go - 路由配置
  * middleware.go - 中间件
  * handlers_api.go - REST API 处理器
  * handlers_mcp.go - MCP 协议处理器
- 将通用工具函数从 AppServer 方法改为独立函数
- 删除未使用的类型定义(LoginWaitRequest)
- 修复 JSON 编码错误处理

优势:
 更好的依赖注入模式
 清晰的职责分离
 提高代码可测试性
 符合 Go 最佳实践
 降低耦合度,提高内聚性

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 16:15:54 +08:00
zy
0e4450b12c refactor: 改进浏览器实例管理,按需创建浏览器实例 (#12)
- 移除全局浏览器单例,改为按需创建浏览器实例
- 添加 configs/browser.go 用于管理无头模式配置
- 更新 service.go 中所有方法,每次调用时创建新的浏览器实例
- 更新测试文件,使用新的浏览器管理方式
- 确保每个浏览器实例使用后正确关闭,避免资源泄漏

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:30:16 +08:00
zy
cfaee894f5 docs: 更新 README 文件,添加无头模式和非无头模式的运行示例 2025-08-17 15:06:50 +08:00
zy
86224dcaa3 update find content element (#10)
- Updated the getContentElement function to utilize the Race method for improved efficiency in finding content elements.
- Added error handling for cases where no elements are found, ensuring better logging and debugging capabilities.
2025-08-13 02:34:50 +08:00
zy
2312b76293 Merge pull request #9 from xpzouying/fix-star-history
fix: 更正 Star History 为官方格式
2025-08-12 01:40:29 +08:00
zy
93e424e09e fix: 更正 Star History 为官方格式
- 修正 type 参数从 Date 改为 Timeline
- 修正域名从 star-history.com 改为 www.star-history.com
- 使用官方推荐的正确格式

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:39:56 +08:00
zy
2fc66fc408 Merge pull request #8 from xpzouying/add-star-history
docs: 添加 Star History 图表
2025-08-12 01:38:51 +08:00
zy
8d5b773cb3 docs: 添加 Star History 图表
- 在 README 底部添加 Star History 图表
- 展示项目 star 增长趋势
- 使用 star-history.com 服务自动生成图表

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:38:02 +08:00
zy
3026e1347a Merge pull request #7 from xpzouying/optimize-readme-images
docs: 优化README中的图片显示尺寸
2025-08-12 01:34:55 +08:00
zy
8e6798393c docs: 优化README中的图片显示尺寸
- 将发布结果截图从原始尺寸(1170x3941)限制为宽度400px
- 使用HTML img标签替代Markdown语法以控制显示大小
- 改善GitHub上的阅读体验

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:34:02 +08:00
zy
4ae05ee130 Merge pull request #6 from xpzouying/get-feeds-list
feat: 添加获取小红书首页 Feeds 列表功能
2025-08-12 01:27:07 +08:00
zy
3b892b805a docs: 更新 README 文件,添加小红书使用步骤和待办事项 2025-08-12 01:25:45 +08:00
zy
aee7b321d3 feat: 添加获取小红书首页 Feeds 列表的 HTTP 和 MCP 接口
- 在 service.go 中添加 ListFeeds 业务逻辑,复用 xiaohongshu 包功能
- 添加 HTTP 接口 GET /api/v1/feeds/list
- 添加 MCP tool: list_feeds,支持通过 MCP 协议获取 Feeds
- 返回结构化的 Feeds 数据,包含列表和数量统计
- 更新 .gitignore 忽略构建产物和测试脚本
- 更新项目配置,添加 chmod 权限

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:22:19 +08:00
zy
bfa830026c chore: 更新项目配置
- 添加 gofmt 和 goimports 自动审批权限
- 添加 CLAUDE.md 项目指导文件,要求格式化 Go 源码

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:12:15 +08:00
zy
108da414fd feat: 实现获取小红书首页 Feed 列表功能
- 添加 FeedsListAction 用于获取页面 window.__INITIAL_STATE__ 数据
- 定义完整的 Feed 数据结构,包含笔记、视频、用户信息等
- 实现 GetFeedsList 方法解析并返回 Feed 列表
- 添加单元测试验证数据获取和 JSON 序列化

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:11:27 +08:00
zy
e156592d34 增加上传图片后,更多的等待时间 (#5)
FIX: #1
2025-08-11 23:15:50 +08:00
zy
5f8d6e174f update docs 2025-08-10 17:20:36 +08:00
zy
2170c58086 Update README with new examples and enhance binary assets for publishing features (#3) 2025-08-10 17:16:05 +08:00
zy
6ff3ca70b3 update video and images (#2)
* update image path

* add gif
2025-08-10 16:12:13 +08:00
zy
58faab15c4 mcp: add image url support (#1)
* refactor: remove redundant validation in service and clean up code

- Remove validatePublishRequest function as gin binding already handles validation
- Remove unused errors import
- Simplify PublishContent method by relying on gin's built-in validation
- Add comprehensive image processing support with URL download capability

* 添加 MCP 说明文档,完善教程
2025-08-10 15:44:15 +08:00
zy
7cd35ebb71 feat: implement xiaohongshu automation with MCP server
Complete implementation of xiaohongshu (Little Red Book) automation system:

### Core Features:
- **QR Code Login**: Automated login with cookie persistence
- **Content Publishing**: Post text, images with AI-powered descriptions
- **Browser Management**: Headless Chrome automation via go-rod
- **Cookie Persistence**: Session management for login state
- **MCP Server**: Model Context Protocol integration for Claude

### Technical Components:
- go-rod browser automation with stealth mode
- MCP server for Claude Code integration
- Cookie-based session management
- Robust error handling and logging
- Cross-platform compatibility

### API Endpoints:
- Login status checking and QR code authentication
- Content publishing with image upload support
- Navigation and page interaction utilities

This provides a complete foundation for xiaohongshu automation
with proper session management and MCP integration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 13:09:00 +08:00
zy
3783e44c5e Initial commit 2025-08-03 17:08:45 +08:00