xueqiu-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., "@xueqiu-mcp What are the hottest stocks on Xueqiu right now?"
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.
xueqiu-mcp
An MCP server for Xueqiu (Snowball) that exposes community posts, stock quotes, watchlists, portfolios, and market news to AI assistants through standard Model Context Protocol tools.
It is designed for Claude Desktop, Cursor, Codex, QoderWork, and other MCP-compatible clients that can launch stdio servers.
This project relies on publicly reachable Xueqiu endpoints and an optional user cookie token. API availability, permissions, and response shapes may change without notice.
Highlights
Area | Tools | Capabilities |
Community and KOL tracking | 11 | User search, profiles, following list, timelines, original articles, post details, comments, hot posts, stock KOLs, news feeds, and 7x24 live news |
Stock market data | 8 | Single-stock quotes, batch quotes, hot stocks, stock screener, company profiles, dividend history, industry/concept tags, and industry performance |
Watchlist viewing (read-only) | 4 | Read personal or public user watchlists and inspect watchlist stocks and funds |
Watchlist editing (write) | 6 | Add or remove stocks, funds, and cubes in the logged-in user's watchlists |
Portfolio tracking | 3 | Read public Xueqiu portfolios, current holdings, and rebalancing history |
Related MCP server: Xueqiu MCP
Use Cases
Track recent posts, long-form articles, and discussions from Xueqiu users or market KOLs.
Query real-time quotes and valuation metrics for A-shares, Hong Kong stocks, and US stocks.
Inspect your own watchlists or public watchlists from other Xueqiu users.
Pull Xueqiu hot discussions, news feeds, and 7x24 live updates into AI workflows.
Combine stock screening, industry data, and company profiles for research workflows.
Installation
Requirements
Node.js 20 or later
npm
An MCP client that supports stdio servers
Build Locally
git clone <repo-url>
cd xueqiu-mcp
npm install
npm run buildThe compiled server entrypoint is dist/index.js.
Authentication
Login state is resolved in this order:
XUEQIU_TOKENenvironment variable (a barexq_a_tokenvalue or a full cookie string)A local cookie file written by
npm run loginAn in-memory anonymous token (public endpoints only)
One-time login (recommended)
npm run login opens your installed Google Chrome. Sign in once with the QR code or SMS code, and the login cookie is saved locally. The server picks it up automatically on startup — no environment variable needed and no browser download.
npm run loginIt reuses your installed Chrome, so nothing extra is downloaded. If Chrome is missing, either install it or fall back to Playwright's bundled Chromium (a ~150 MB one-time download):
npx playwright install chromiumThe cookie is stored at ~/.config/xueqiu-mcp/cookies.json (%USERPROFILE%\.config\xueqiu-mcp\cookies.json on Windows). When it expires, run npm run login again.
Manual token
You can still copy the cookie by hand:
Log in to Xueqiu.
Open Developer Tools →
Application/Storage→Cookiesforhttps://xueqiu.com.Copy
xq_a_token. Login-only endpoints usually also needu, so copyingxq_a_token=...; u=...together is safest.
Claude Desktop / Cursor / QoderWork
Add the server to your MCP client configuration:
{
"mcpServers": {
"xueqiu-mcp": {
"command": "node",
"args": ["/path/to/xueqiu-mcp/dist/index.js"]
}
}
}If you already ran
npm run login, noenvblock is needed. To override the saved cookie, add"env": { "XUEQIU_TOKEN": "your value" }.
Codex CLI
Add the server to ~/.codex/config.toml:
[mcp_servers.xueqiu-mcp]
command = "node"
args = ["/path/to/xueqiu-mcp/dist/index.js"]If you already ran
npm run login, noenvblock is needed. To override the saved cookie, addenv = { XUEQIU_TOKEN = "your value" }.
Restart your MCP client after saving the configuration.
Tools
Community and KOL Tracking
Tool | Description | Parameters |
| Get the current logged-in user profile | None |
| Get the current user's following list with automatic pagination | None |
| Search Xueqiu users by keyword |
|
| Get a user's detailed profile |
|
| Get a user's timeline, including original and reposted content |
|
| Get a user's original long-form articles |
|
| Get full content for a post or article |
|
| Get comments for a post |
|
| Get hot posts by day, week, or month |
|
| Get active users for a stock symbol |
|
| Get Xueqiu news feeds or 7x24 live news |
|
get_hot_posts.scope supports day, week, and month. get_news_feed.category supports headline, a_stock, us_stock, hk_stock, fund, and live.
Stock Market Data
Tool | Description | Parameters |
| Get detailed quote and valuation metrics for one stock |
|
| Get quotes for multiple symbols |
|
| Get hot stock rankings |
|
| Sort and screen stocks by percent change, market cap, PE, PB, turnover, amount, or volume |
|
| Get A-share company profile data |
|
| Get A-share dividend and allotment history |
|
| Get industry and concept tags for a stock |
|
| Get industry sectors and performance data |
|
Symbol examples: SH600519, SZ000001, 00700, AAPL.
Watchlist Viewing (read-only)
Tool | Description | Parameters |
| Get the current user's watchlist folders | None |
| Get public watchlist folders for any user |
|
| Get stocks in a watchlist folder, optionally for a public user |
|
| Get funds in a watchlist folder, optionally for a public user |
|
Common system folder IDs include -1 for all stocks, -5 for A-shares, -6 for US stocks, and -7 for Hong Kong stocks; -110 for all funds, -17 for funds, and -16 for private funds. Prefer IDs returned by get_watchlists or get_user_watchlists.
Watchlist Editing (write)
Tool | Description | Parameters |
| Add a stock to the current user's default watchlist |
|
| Add a fund to the current user's default fund watchlist |
|
| Follow a Xueqiu cube and add it to the current user's watchlist |
|
| Remove a stock from the current user's watchlist |
|
| Remove a fund from the current user's fund watchlist |
|
| Unfollow a Xueqiu cube and remove it from the current user's watchlist |
|
These write tools require a valid login (npm run login or XUEQIU_TOKEN). Items are added to or removed from the default folder of each kind; the server routes by symbol prefix (SH/SZ stocks, F/P funds, ZH cubes).
Portfolio Tracking
Tool | Description | Parameters |
| Get public portfolios created by a Xueqiu user |
|
| Get current holdings for a portfolio |
|
| Get historical rebalancing records for a portfolio |
|
Examples
Show me the latest posts from this Xueqiu user.Search for Xueqiu users who discuss new energy stocks.What is in user 2292705444's public watchlist?Get the current quote, PE, PB, and dividend yield for SH600519.Compare quotes for SH600519, SZ300750, and AAPL.What are the hottest A-share stocks today?Show current holdings for portfolio ZH2001629.Show the latest Xueqiu 7x24 live news.Development
npm run dev # Start from TypeScript source with tsx
npm run build # Compile TypeScript to dist/
npm start # Start the compiled MCP serverArchitecture
xueqiu-mcp/
├── src/
│ ├── index.ts # MCP server entrypoint, tool registration, and response formatting
│ ├── xueqiu-api.ts # Xueqiu API client, token handling, and HTTP helpers
│ ├── login.ts # One-time browser login helper
│ ├── login-cookie.ts # Login-state validation and Cookie serialization
│ └── cookie-store.ts # Local Cookie persistence
├── test/ # Login and API regression tests
├── dist/ # Compiled output
├── package.json # Package metadata and scripts
├── tsconfig.json # TypeScript configuration
└── README.mdThe implementation intentionally keeps the runtime small:
Node.js / ESM / ES2022
TypeScript
@modelcontextprotocol/sdkPlaywright (login helper)
zod
Data, Permissions, and Safety
XUEQIU_TOKENis read from the environment and should not be committed to source control.Anonymous tokens are fetched only when needed and are kept in memory.
Login-required tools fail fast when neither a valid local Cookie nor
XUEQIU_TOKENis available.Visibility of other users' watchlists, portfolios, and profiles depends on their privacy settings and Xueqiu's API permissions.
Xueqiu may change endpoints, fields, rate limits, or access policies at any time.
Requests are throttled (default ~1–1.5 s between requests, jittered) and retried with exponential backoff for transient
429/5xx/network errors only.401/403/400are never auto-retried. After 5 consecutive transient failures the client opens a 5-minute circuit breaker. SetXUEQIU_MIN_INTERVAL_MSto override the throttle interval (0disables it).Use reasonable request rates and respect Xueqiu's terms of service.
Disclaimer
This project is for personal learning, research, and automation assistance only. It is not investment advice, trading advice, or a recommendation to buy or sell securities. This project is not affiliated with, endorsed by, or officially authorized by Xueqiu or Beijing Xueqiu Information Technology Co., Ltd. Users are responsible for complying with Xueqiu's terms, platform rules, and applicable laws. All consequences arising from use of this project are the user's responsibility.
License
MIT
Available Tools
32 toolsadd_watchlist_cube添加自选组合AIdempotent
关注一个雪球组合(cube),将其加入当前用户的「关注」默认分组。需要有效登录态。
Inputs: cube_symbol (required). Returns: success
add_watchlist_fund添加自选基金AIdempotent
将一只基金加入当前用户的自选基金默认分组。需要有效登录态。公募基金代码以 F 开头,私募基金代码以 P 开头。
Inputs: symbol (required). Returns: success
add_watchlist_stock添加自选股票AIdempotent
将一只股票加入当前用户的自选股默认分组。需要有效登录态。symbol 支持 A股、港股、美股等雪球代码。
Inputs: symbol (required). Returns: success
get_batch_quotes批量获取行情ARead-onlyIdempotent
批量获取多只股票的实时行情。一次可查询多只,适合对比和监控。
Inputs: symbols (required). Returns: count, quotes
get_company_profile获取公司概况ARead-onlyIdempotent
获取A股上市公司的基本信息,包括公司名称、法人、注册资本、主营业务、经营范围等。
Inputs: symbol (required). Returns: company
get_cube_holdings获取组合持仓ARead-onlyIdempotent
获取某个雪球组合的当前持仓详情,包括每只股票的名称、代码、仓位占比等。
Inputs: cube_symbol (required). Returns: cash, holdings, last_rebalancing_time
get_cube_rebalancing获取组合调仓记录BRead-onlyIdempotent
获取某个雪球组合的历史调仓记录,包括每次调仓的持仓变化、目标仓位、成交价格等。
Inputs: cube_symbol (required), page, count. Returns: count, total, records
get_current_user获取当前用户ARead-onlyIdempotent
获取当前登录用户的信息,包括昵称、ID、粉丝数等。需要有效登录态。
Inputs: no named parameters. Returns: user
get_hot_posts获取热门帖子ARead-onlyIdempotent
获取雪球热门帖子列表。可按日、周、月筛选热度排行。适合发现当前市场热点话题。
Inputs: page, count, scope. Returns: count, posts
get_hot_stocks获取热门股票ARead-onlyIdempotent
获取雪球热门股票排行榜。可按市场筛选:A股、港股、美股。
Inputs: count, market. Returns: count, stocks
get_industry_list获取行业板块列表BRead-onlyIdempotent
获取行业板块列表及涨跌数据,可查看各行业的实时涨跌幅。
Inputs: level. Returns: count, industries
get_my_following获取我的关注列表ARead-onlyIdempotent
获取当前登录用户关注的人的列表(分页)。需要有效登录态。返回 has_more 和 next_page 用于继续翻页。
Inputs: page, count. Returns: count, total, users, has_more, +1 more
get_news_feed获取资讯流ARead-onlyIdempotent
获取雪球资讯Feed流。可按分类筛选:头条、A股、美股、港股、基金,或 7x24 快讯。
Inputs: count, category. Returns: kind, count, items, posts
get_post_comments获取帖子评论ARead-onlyIdempotent
获取某篇雪球帖子下的评论。
Inputs: post_id (required), page, sort, count. Returns: count, comments
get_post_detail获取帖子详情ARead-onlyIdempotent
获取某篇雪球帖子/文章的完整内容,包括正文、互动数据等。
Inputs: post_id (required). Returns: post
get_stock_dividend获取分红历史ARead-onlyIdempotent
获取A股上市公司的历史分红送转记录。
Inputs: symbol (required). Returns: count, dividends
get_stock_industry获取个股行业标签ARead-onlyIdempotent
获取某只A股股票所属的行业和概念板块标签。
Inputs: symbol (required). Returns: count, industries
get_stock_kol获取个股活跃大VARead-onlyIdempotent
获取某个股票下的活跃大V/KOL列表。适合发现关注特定标的的意见领袖。
Inputs: symbol (required), count, start. Returns: count, users
get_stock_quote获取单只股票行情ARead-onlyIdempotent
获取单只股票的详细实时行情,包括现价、涨跌幅、PE/PB、市值、股息率、换手率等。
Inputs: symbol (required). Returns: quote
get_user_articles获取用户原创文章ARead-onlyIdempotent
获取指定雪球用户的原创文章(不含转发)。适合追踪大V的深度分析和长文。
Inputs: user_id (required), page, count. Returns: count, posts, total, has_more, +1 more
get_user_cubes获取用户组合列表ARead-onlyIdempotent
获取某个雪球用户创建的投资组合列表。可看到组合名称、代码、收益率、关注人数等。
Inputs: user_id (required), page, count. Returns: count, cubes, total, has_more, +1 more
get_user_posts获取用户动态ARead-onlyIdempotent
获取指定雪球用户的最新动态(包含原创和转发)。适合追踪大V的所有发言。
Inputs: user_id (required), page, count. Returns: count, posts
get_user_profile获取用户资料BRead-onlyIdempotent
获取雪球用户的详细资料,包括昵称、简介、粉丝数、认证信息等。
Inputs: user_id (required). Returns: user
get_user_watchlists获取用户自选分组ARead-onlyIdempotent
获取任意雪球用户的自选股分组列表(文件夹结构和数量统计)。配合 get_watchlist_stocks 可查看该用户的自选股详情。
Inputs: user_id (required). Returns: cubes, funds, stocks
get_watchlist_funds获取自选基金ARead-onlyIdempotent
获取某个自选基金分组下的基金列表,返回基金代码、名称、目标仓位。支持查看他人自选基金(传入 user_id)。建议先用 get_watchlists / get_user_watchlists 获取基金分组 pid。
Inputs: pid, user_id. Returns: count, funds
get_watchlists获取我的自选分组ARead-onlyIdempotent
获取当前登录用户的自选股分组列表,包含股票、关注(组合)、基金等所有分类。需要有效登录态。
Inputs: no named parameters. Returns: count, watchlists
get_watchlist_stocks获取自选股列表ARead-onlyIdempotent
获取某个自选股分组下的所有股票列表,返回股票代码和名称。支持查看他人自选股(传入 user_id)。建议先用 get_user_watchlists 获取分组 pid。
Inputs: pid (required), user_id, category. Returns: count, stocks
remove_watchlist_cube删除自选组合ADestructiveIdempotent
取消关注一个雪球组合(cube),从当前用户的「关注」分组中删除。需要有效登录态。
Inputs: cube_symbol (required). Returns: success
remove_watchlist_fund删除自选基金ADestructiveIdempotent
从当前用户的自选基金分组中删除一只基金。需要有效登录态。
Inputs: symbol (required). Returns: success
remove_watchlist_stock删除自选股票ADestructiveIdempotent
从当前用户的自选股分组中删除一只股票。需要有效登录态。
Inputs: symbol (required). Returns: success
screen_stocks股票筛选BRead-onlyIdempotent
股票筛选器。可按涨跌幅、市值、PE、PB、换手率等条件排序筛选。
Inputs: page, size, order, market, +1 more. Returns: count, total, stocks
search_users搜索用户ARead-onlyIdempotent
搜索雪球用户。可按关键词搜索大V,获取用户ID、昵称、粉丝数等信息。
Inputs: query (required), page, count. Returns: count, users
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 32 tools
Most tools map to distinct resource/action pairs, but several are easy to confuse: get_watchlists vs get_user_watchlists overlap for the current user, and get_stock_quote vs get_batch_quotes are the same quote concept with different cardinality. Descriptions help, but the boundaries are not always obvious.
The dominant verb_noun pattern is consistent, with get_, add_, and remove_ prefixes across resources. Minor deviations like get_my_following, screen_stocks, and get_stock_kol break the pattern slightly but do not create real confusion.
32 tools is a heavy surface for an MCP server, even though Xueqiu covers multiple subdomains. Several tools could be consolidated, such as single vs batch quotes and the overlapping watchlist listing tools, making the count feel excessive for agent selection.
The set covers user/social, quotes, screening, watchlist add/remove, and cube data well. However, there are notable gaps: there is no get_watchlist_cubes to list followed cubes despite add/remove cube tools, and no fund quote/detail tools to support fund watchlist entries.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server based on Model Context Protocol that enables AI assistants to query and search for stock information using the Tushare API.47MIT
- AlicenseCqualityDmaintenanceA MCP service based on the Xueqiu (Chinese stock market) API that enables users to query stock data directly through Claude or other AI assistants.45116MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates Futu OpenAPI, enabling AI models to query real-time market data and execute trades across Hong Kong, US, and A-share markets.30 PyPI81MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives AI assistants direct, structured access to China A-share market data.3Apache 2.0