闲鱼 MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| XIANYU_HEADLESS | No | Whether to run the browser in headless mode (example value: false). | false |
| XIANYU_COOKIE_FILE | No | Path to the cookie file used for login persistence. | ./cookies/default.json |
| XIANYU_USER_DATA_DIR | No | Directory for browser user data. | ./user_data |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
闲鱼自动化 MCP 服务器 - 提供商品搜索、发布、消息、数据分析等功能
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| helloB | 测试工具 - 验证 MCP 服务器是否正常运行 |
| check_server_statusB | 检查服务器状态 |
| search_itemsB | 搜索闲鱼商品(带错误恢复) Args: keyword: 搜索关键词 price_min: 最低价格 price_max: 最高价格 location: 地区筛选 sort_by: 排序方式 (default, price_asc, price_desc, sales) limit: 返回数量限制 Returns: 商品列表 |
| publish_itemB | 发布闲鱼商品 Args: title: 标题(最多 20 字) description: 描述(最多 1000 字) price: 价格 images: 图片路径列表 category: 分类 location: 地区 condition: 新旧程度 delivery: 配送方式 dry_run: 是否仅预检查表单,不真正提交发布 Returns: 发布结果 {"success": bool, "item_id": str, "message": str} |
| list_my_itemsC | 列出当前账号在个人主页可管理的商品 Args: limit: 数量限制 Returns: 商品列表 |
| edit_itemA | 编辑已发布商品 Args: item_id: 商品 ID updates: 更新内容,可包含 title/description/price/location/condition/delivery/images dry_run: 是否仅试填,不真正提交 Returns: 编辑结果 |
| delete_itemA | 下架商品(默认)或在明确允许时删除商品 Args: item_id: 商品 ID force_delete: 当无法下架时是否尝试删除 dry_run: 是否仅检查按钮和确认弹窗,不真正执行 Returns: 处理结果 |
| get_conversationsC | 获取会话列表 Args: limit: 数量限制 sendable_only: 是否仅返回可发送会话 context_only: 是否仅返回已有商品上下文的会话 Returns: 会话列表和状态 |
| get_unread_messagesB | 获取未读消息数 Returns: 未读消息状态 |
| get_sendable_conversationsC | 获取可发送会话列表 Args: limit: 返回数量限制 warm_context: 是否尝试预热前几个会话的商品上下文 Returns: 可发送会话列表和状态 |
| get_messagesC | 获取指定会话的消息列表 Args: conversation_id: 会话 ID limit: 消息数量限制 Returns: 消息列表和状态 |
| send_messageC | 发送消息 Args: user_id: 用户 ID content: 消息内容 Returns: 发送结果 |
| get_item_analyticsC | 获取商品统计数据 Args: item_id: 商品 ID Returns: 商品统计数据 |
| get_sales_analyticsC | 获取销售统计 Args: days: 统计天数 Returns: 销售统计数据 |
| get_traffic_analyticsC | 获取流量统计 Args: days: 统计天数 Returns: 流量统计数据 |
| get_top_itemsC | 获取热门商品排行 Args: limit: 返回数量 sort_by: 排序方式 (sales, views, wants) Returns: 商品列表 |
| analyze_competitorsC | 分析竞品商品 Args: item_ids: 竞品商品 ID 列表 Returns: 竞品分析结果 |
| generate_reportC | 生成综合分析报告 Args: days: 统计天数 Returns: 报告数据 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 18 tools
Most tools target distinct resources or actions, but several overlaps create ambiguity: get_sendable_conversations largely duplicates get_conversations with sendable_only=true, hello overlaps with check_server_status, generate_report overlaps with get_sales_analytics, and get_top_items overlaps with search_items when sorted by sales.
The tool set is consistently snake_case and mostly follows a verb_noun or get_noun pattern. The only notable outlier is 'hello', while names like check_server_status, search_items, and get_traffic_analytics fit the convention.
18 tools is slightly above the typical ideal range, but the server spans multiple subdomains: health checks, item search/publishing, messaging, and analytics. The count is mostly justified, though a few redundant tools inflate it.
The surface covers item CRUD, search, messaging, and several analytics views, which is strong for this domain. Minor gaps remain, such as a dedicated get_item detail endpoint and any order/transaction management, but core workflows are covered.