xianyu-buyer-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xianyu-buyer-mcpsearch MacBook Pro, then send batch inquiries to top 5 sellers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 |
| Log in to Xianyu by scanning a QR code (required on first use; cookies are reused automatically afterward) |
| Check the login status |
| Search products and return a product list + seller IDs |
| Send an inquiry message to a single seller |
| Send inquiry messages in batch |
| Get the IM conversation list and view all seller replies |
| Get the complete chat history with a specific seller |
Related MCP server: goofish-cli
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 chromiumOptional Configuration
Copy the environment variable template and modify it as needed:
cp .env.example .envVariable | Default | Description |
|
| Whether to run in headless mode (it is recommended to keep |
| (empty) | HTTP proxy address |
|
| Cookie storage path |
|
| 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
Call the
logintool in the AI assistantA browser window automatically pops up to the Xianyu login page
Scan the QR code with the Xianyu or Taobao app
Cookies are automatically saved to
~/.xianyu-buyer-mcp/cookies.jsonNo 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 botCAPTCHA avoidance: Seller information queries go through the
lib.mtop.requestSDK on the IM page, avoiding slider CAPTCHA triggers on product detail pagesRate 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
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Search multi-merchant supply, checkout, and track orders via MCP.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Related MCP Servers
- FlicenseBqualityCmaintenanceEnables searching and monitoring of Goofish (闲鱼) items via Playwright automation, providing structured item details and keyword-based monitoring.47-
- AlicenseBqualityAmaintenanceMCP server for automating Xianyu (Goofish) marketplace operations: publish, manage items, handle IM messages, and more via CLI or AI agents.417559 PyPI221Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Goofish (闲鱼) marketplace, supporting product search, batch inquiry messaging, and conversation management for buyers.4MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to search Xianyu second-hand marketplace for product prices with automatic cookie detection.2-