xueqiu-mcp
Click on "Install 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-mcpWhat 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server giving AI agents one-connection access to China A-share market intelligence: financials,
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for stocksense-ai documentation, generated by doc2mcp.
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.45115MIT
- AlicenseNot gradedqualityCmaintenanceA 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.80MIT
- AlicenseAqualityCmaintenanceAn MCP server that gives AI assistants direct, structured access to China A-share market data.3Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/leewhite97/xueqiu-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server