Skip to main content
Glama
xhjiang1998
by xhjiang1998

xianyu-buyer-mcp

Xianyu (Goofish) buyer-side inquiry MCP Server. Supports searching products, batch sending inquiry messages, and automatically collecting seller replies.

Features

Tool

Description

login

Log in to Xianyu by scanning a QR code (required on first use; cookies are reused automatically afterward)

check_login

Check the login status

search

Search products and return a product list + seller IDs

send_inquiry

Send an inquiry message to a single seller

batch_send_inquiry

Send inquiry messages in batch

get_conversations

Get the IM conversation list and view all seller replies

get_conversation_detail

Get the complete chat history with a specific seller

Related MCP server: Goofish MCP Server

Installation

Prerequisites

  • Python 3.11+

  • Xianyu/Taobao app (for QR-code login)

  • Xianyu web version / Taobao desktop client (for receiving and replying to messages)

Steps

# 1. 克隆项目
git clone https://github.com/<your-username>/xianyu-buyer-mcp.git
cd xianyu-buyer-mcp

# 2. 安装依赖
pip install -e .

# 3. 安装 Chromium 浏览器
playwright install chromium

Optional Configuration

Copy the environment variable template and modify it as needed:

cp .env.example .env

Variable

Default

Description

PLAYWRIGHT_HEADLESS

false

Whether to run in headless mode (it is recommended to keep false so you can scan the QR code)

PROXY

(empty)

HTTP proxy address

COOKIES_PATH

~/.xianyu-buyer-mcp/cookies.json

Cookie storage path

XIANYU_HOME_URL

https://www.goofish.com

Xianyu homepage URL

Use with MCP Clients

Claude Desktop / Cursor / QoderWork

Add the following to the MCP configuration file:

{
  "mcpServers": {
    "xianyu-buyer": {
      "command": "python",
      "args": ["/path/to/xianyu-buyer-mcp/server.py"]
    }
  }
}

First-Time Use

  1. Call the login tool in the AI assistant

  2. A browser window automatically pops up to the Xianyu login page

  3. Scan the QR code with the Xianyu or Taobao app

  4. Cookies are automatically saved to ~/.xianyu-buyer-mcp/cookies.json

  5. No need to scan again on subsequent uses

Typical Workflow

cp .env.example .env
# 1. 登录
login()

# 2. 搜索商品
search("MacBook Pro M1 16G 512G", max_price=5000)

# 3. 批量询价
batch_send_inquiry(
  items='[{"itemId": "xxx", "sellerId": "yyy"}, ...]',
  message="你好,还在吗?"
)

# 4. 查看回复
get_conversations()

# 5. 查看某个对话详情
get_conversation_detail(item_id="xxx", seller_id="yyy")

Technical Details

  • Anti-detection: Uses playwright-stealth + custom UA + navigator spoofing to reduce the risk of being identified as a bot

  • CAPTCHA avoidance: Seller information queries go through the lib.mtop.request SDK on the IM page, avoiding slider CAPTCHA triggers on product detail pages

  • Rate limiting: Batch messages are sent 2 seconds apart to avoid triggering platform risk controls

  • Thread safety: All browser operations are serialized and executed in a single-threaded executor

Notes

  • Xianyu has anti-scraping mechanisms. Do not make high-frequency calls or use it for large-scale data collection

  • Cookies have a limited validity period and you will need to scan the QR code again after they expire

  • This project is for learning and research purposes only. Please comply with the Xianyu platform terms of use

License

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    An MCP server that automates Xianyu marketplace operations through Playwright, allowing users to manage listings and conduct market research via natural language. It features integrated tools for generating AI-powered product descriptions and cover images using DashScope.
    11
    21
  • A
    license
    B
    quality
    B
    maintenance
    MCP server for automating Xianyu (Goofish) marketplace operations: publish, manage items, handle IM messages, and more via CLI or AI agents.
    4
    17
    139
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.

  • First AI Agent e-commerce marketplace with 74+ AI products, MCP protocol, and Alipay payments

  • Shopping MCP for AI agents: search, compare, Amazon buy links. Auto-register.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xhjiang1998/xianyu-buyer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server