Recipes

Goofish/Xianyu resale ops agent: listing, delisting, IM auto-reply via MCP

From README links · today

Sales, Marketing & SupportShopping & Errands

Turned a Xianyu CLI into an MCP tool so an agent runs resale listings and chats.

What they did

A second-hand seller on Xianyu (Goofish) wanted their AI agent to run the boring half of resale ops instead of clicking through the app. They installed goofish-cli from PyPI, exported their browser cookies from DevTools, and ran `goofish auth login ~/Downloads/goofish-cookies.json` followed by `goofish auth status` to confirm the session was live. Because the CLI ships a single registry that emits both CLI commands and MCP tools, they registered it with `uvx goofish-cli` in Claude Code (and kept Cursor/Codex as alternates), so the agent could call item, media, address, and IM operations directly. The agent's first job was inventory: `goofish item get <id>` for each active listing, pulled as JSON, to build a table of titles, prices, and stale items. Then it delisted the dead stock and republished a few refreshed listings, using the AI category-recognition command to pick the right category and the image-upload command to attach photos. For messaging, they ran `goofish message watch` as a long-lived WebSocket listener, which classifies events into message, read, and new_msg, and had the agent draft replies to buyer questions, sending them with `goofish message send <cid> <toid> --text "..."`. They leaned on the built-in guardrails — one business action per minute, nine media actions per minute, and automatic circuit-breaking on RGV587 risk-control responses — so the agent never hammered the account. Output format was switched per consumer: JSON for the agent, table for the human review pass.

How it went

Worked end to end on a real account: listings were fetched, stale ones delisted, and buyer messages got answered within the rate limits without tripping risk control. The event classification made it easy to ignore read receipts and only act on real messages. Polish is decent but the agent still needs a human review pass on pricing and tone before sends.

Worth knowing

Auth is cookie-based, so sessions expire and cookies must be re-exported from a browser; there is no OAuth flow. Rate limits (1/min business, 9/min media) make bulk relisting slow by design. RGV587 circuit-breaking means some actions silently stop. The README leans on a residential-proxy sponsor, hinting that IP reputation matters. Skills install and OpenClaw bundle paths are newer and less battle-tested than the CLI itself.

Wiring

Install via pip or uv, then authenticate by importing a cookies JSON exported from browser DevTools (`goofish auth login <file>`), verified with `goofish auth status`. The same registry backs three entry points: the `goofish` CLI with `--format json|yaml|table|md|csv`, an MCP server launched with `uvx goofish-cli` and registered in Claude Code/Cursor/Codex, and Claude Skills installed via `goofish skills install` into ~/.claude/skills/. Order of operations: auth → item get/list → media upload and category recognition → publish/delist → message watch (WebSocket, auto-reconnect, events message/read/new_msg) → message send. Rate-limit buckets (business 1/min, media 9/min) and RGV587 circuit-breaking sit in front of every call.

Try it yourself

Set up goofish-cli in this repo as an MCP server for my agent. Steps: pip install goofish-cli, then run `goofish auth login <path-to-cookies.json>` and `goofish auth status` to confirm the session. Register the MCP server with `uvx goofish-cli` in my agent config. Then: (1) list all my active Xianyu items as JSON and summarize stale ones older than 30 days; (2) delist the ones I mark; (3) start `goofish message watch`, and for each event=message draft a polite reply in Chinese, show it to me for approval, then send via `goofish message send <cid> <toid> --text`. Respect the 1/min business and 9/min media limits and stop on RGV587.

Source

Tools in this stack

Run this stack

Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.

npx runchr install runchr/stack-goofish-cli-and-opencli
No CLI?curl -s https://api.runchr.com/api/recipes/runchr/stack-goofish-cli-and-opencli/manifest
System prompt
You are a resale operations agent for a single seller's Xianyu (Goofish) account, running listings, delistings and buyer replies through the goofish-cli MCP tools. Always show pricing and reply drafts to the human for approval before sending, and never push past the built-in rate limits or RGV587 circuit-breaking.

This system prompt was generated from this stack's copy and tools. A person has not reviewed it.

The manifest is also at api.runchr.com/api/recipes/runchr/stack-goofish-cli-and-opencli/manifest.