# goofish-cli [Health: Active]

**Category:** 🛒 E-Commerce  
**Repository:** https://github.com/fancyboi999/goofish-cli  
**GitHub Stars:** 370  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/goofish-cli

## Description
闲鱼 CLI · 原生支持 MCP · 为 AI Agent 而生 | Goofish (Xianyu) automation CLI · MCP-ready · Built for AI Agents

## Tools
Capabilities this server exposes over MCP:

- **auth_login** — 导入登录态（默认从本机浏览器 auto-detect；支持 Chrome/Edge/Brave/Safari/Firefox 等）
- **auth_reset_guard** — 手动解除风控熔断状态
- **auth_status** — 检查登录态是否有效，返回 unb / tracknick / 昵称
- **media_upload** — 上传图片，独立媒体预算，返回可复用图片收据
- **category_recommend** — AI 识别商品类目，输入标题+图片返回 catId/catName
- **item_delete** — 下架/删除商品（写操作，受限流和风控护栏保护）
- **item_get** — 查询闲鱼商品详情（只读）
- **item_list** — 查看当前账号的在售商品（API 直签）
- **location_default** — 获取账号默认发布地址
- **item_publish** — 发布商品（自动识别类目 + 默认地址），价格单位元
- **item_view** — 浏览器视角查看商品详情（读取页面响应，含图片和卖家字段）
- **message_history** — 拉取指定 cid 会话的历史消息（翻页到底）
- **message_list_chats** — 会话列表：HTTP + 默认短时 WS 发现，最近消息补齐并按活动时间倒序
- **message_send** — 向会话发送消息（text/image）。text 必填，image 走 url+wh
- **message_watch** — 常驻 IM 长连接，下行事件以 JSONL 输出到 stdout（Ctrl-C 退出）
- **search_items** — 搜索闲鱼商品（浏览器路径，抗风控；--pages 跨页抓取）
- **skills_install** — 把内置 Claude Skills 复制到 ~/.claude/skills/（或 --dest 指定目录）

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "goofish-cli": {
    "command": "uvx",
    "args": ["goofish-cli"]
  }
}
```

## Documentation

## What goofish-cli does

goofish-cli provides structured access to core Goofish (Xianyu) operations through both a terminal interface and MCP. Its command registry covers authentication, item details, item publishing and removal, marketplace search, browser-style item viewing, media uploads, category recommendations, default publishing locations, and buyer conversations.

The same definitions are used by the CLI, MCP tools, and installable Claude Skills. The package includes five skills for general Goofish guidance, item publishing, buyer replies, risk checks, and shop diagnosis. The shop-diagnosis skill is read-only, while item publishing and messaging can perform write operations.

## How it works

Install the Python package, import a Goofish login state from a browser-exported cookie file or cookie string, and verify it with `auth status`. MCP clients can launch the command with `uvx goofish-cli`, allowing agents to use the registered commands as tools.

Command output can be selected with `--format json`, `yaml`, `table`, `md`, or `csv`. JSON is suitable for agent workflows, while table output is intended for interactive terminal use. Messaging includes both short-lived conversation synchronization and a persistent watch mode. The watch command uses a WebSocket connection with automatic reconnection and emits JSONL events for received messages, read receipts, and lightweight new-message notifications.

## Setup and configuration

Install with either `pip install goofish-cli` or `uv pip install goofish-cli`. Import credentials with a command such as `goofish auth login ~/Downloads/goofish-cookies.json`, then run `goofish auth status` to check the session.

A sandbox mode is available for environments with Docker Desktop or Docker Engine. It runs Chromium in a container-backed virtual desktop, keeps login data in a separate volume, and exposes an observation page for manual interaction. Configure an MCP client to launch `goofish sandbox mcp` when the agent should use the sandbox rather than the host mode. The client must be able to find both `goofish` and `docker`; the first sandbox start downloads and builds an image.

Claude Skills can be copied to `~/.claude/skills/` with `goofish skills install`, or installed into another directory with `--dest`. The command also supports listing skills without copying them.

## Tools and capabilities

- Check login validity and reset a manually triggered risk guard.
- Retrieve item details or browser-style item views, search listings, and recommend categories.
- Publish or remove items, upload images, and obtain the default publishing location.
- List conversations, retrieve message history, send text or image messages, and watch for live events.
- Apply account and business rate limits, including separate limits for operational and media requests.
- Share one command registry across CLI, MCP, and Claude Skill entry points.

## Limitations and notes

Goofish access requires an authenticated account. Item publishing, deletion, media uploads, and message sending are write operations, so agents should obtain appropriate confirmation before invoking them. The built-in safeguards apply request throttling and can automatically trip a risk circuit breaker; `auth reset-guard` is available for manual recovery.

Message discovery and history are subject to the behavior of the underlying HTTP and WebSocket paths. Conversation summaries can be incomplete, and a lightweight `new_msg` event may require a separate history request to retrieve message text.

Sandbox use requires Docker and manual interaction when the platform requests verification. The sandbox does not automatically open a host browser. When Goofish requires an interactive verification step, use the sandbox browse command and complete it in the observation page.

_Full upstream README: https://allmcps.com/mcp/goofish-cli/readme_

