docs: 优化图片支持方式的文档说明 (#124)

- 在README中详细说明两种图片支持方式(HTTP链接和本地路径)
- 明确推荐使用本地绝对路径的原因和优势
- 添加具体的使用示例和代码示例
- 优化MCP协议中images字段的描述,提供更清晰的格式说明
- 帮助用户更好地理解和使用图片发布功能

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

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
zy
2025-09-20 23:44:59 +08:00
committed by GitHub
parent 34120b4831
commit 716cf104ce
2 changed files with 33 additions and 1 deletions

View File

@@ -36,6 +36,26 @@ https://github.com/user-attachments/assets/bd9a9a4a-58cb-4421-b8f3-015f703ce1f9
支持发布图文内容到小红书,包括标题、内容描述和图片。后续支持更多的发布功能。
**图片支持方式:**
支持两种图片输入方式:
1. **HTTP/HTTPS 图片链接**
```
["https://example.com/image1.jpg", "https://example.com/image2.png"]
```
2. **本地图片绝对路径**(推荐)
```
["/Users/username/Pictures/image1.jpg", "/home/user/images/image2.png"]
```
**为什么推荐使用本地路径:**
- ✅ 稳定性更好,不依赖网络
- ✅ 上传速度更快
- ✅ 避免图片链接失效问题
- ✅ 支持更多图片格式
**发布图文帖子演示:**
https://github.com/user-attachments/assets/8aee0814-eb96-40af-b871-e66e6bbb6b06
@@ -475,6 +495,7 @@ npx @modelcontextprotocol/inspector
- `check_login_status` - 检查小红书登录状态(无参数)
- `publish_content` - 发布图文内容到小红书必需title, content, images
- `images`: 支持HTTP链接或本地绝对路径推荐使用本地路径
- `list_feeds` - 获取小红书首页推荐列表(无参数)
- `search_feeds` - 搜索小红书内容需要keyword
- `get_feed_detail` - 获取帖子详情需要feed_id, xsec_token
@@ -484,6 +505,7 @@ npx @modelcontextprotocol/inspector
使用 Claude Code 发布内容到小红书:
**示例1使用HTTP图片链接**
```
帮我写一篇帖子发布到小红书上,
配图为https://cn.bing.com/th?id=OHR.MaoriRock_EN-US6499689741_UHD.jpg&w=3840
@@ -492,6 +514,16 @@ npx @modelcontextprotocol/inspector
使用 xiaohongshu-mcp 进行发布。
```
**示例2使用本地图片路径推荐**
```
帮我写一篇关于春天的帖子发布到小红书上,
使用这些本地图片:
- /Users/username/Pictures/spring_flowers.jpg
- /Users/username/Pictures/cherry_blossom.jpg
使用 xiaohongshu-mcp 进行发布。
```
![claude-cli 进行发布](./assets/claude_push.gif)
**发布结果:**

View File

@@ -180,7 +180,7 @@ func (s *AppServer) processToolsList(request *JSONRPCRequest) *JSONRPCResponse {
},
"images": map[string]interface{}{
"type": "array",
"description": "图片路径列表支持本地路径或URL至少需要1张图片",
"description": "图片路径列表至少需要1张图片。支持两种方式1. HTTP/HTTPS图片链接自动下载2. 本地图片绝对路径(推荐,如:/Users/user/image.jpg",
"items": map[string]interface{}{
"type": "string",
},