Home / MCP / Xueqiu MCP Server
Provides stock data via MCP: real-time quotes, index performance, Northbound data, funds, and stock code search.
Configuration
View docs{
"mcpServers": {
"xueqiu_mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/xueqiu_mcp",
"run",
"main.py"
],
"env": {
"XUEQIU_TOKEN": "YOUR_TOKEN"
}
}
}
}You can query Xueqiu stock data directly from Claude or other AI assistants by running a lightweight MCP server that wraps the Snowball API. This server provides real-time quotes, index performance, Northbound data for major markets, fund data, and stock code lookups, all accessible through your preferred MCP client.
Start your MCP client and point it to your local MCP server process. The server exposes stock data querying capabilities such as real-time quotes, index performance, Northbound data for Shanghai/Shenzhen and Hong Kong, fund data, and stock code searches. Run the server in the background or foreground, then use your MCP client to request the data you need. To stop or restart, manage the process via your usual workflow.
# Prerequisites
- Ensure you have Python and a Python environment tool available
- Install the MCP tool runner (uv) which you will use to manage and run MCP servers
# Clone the project
git clone https://github.com/liqiongyu/xueqiu_mcp.git
cd xueqiu_mcp
# Set up the dependency environment using uv
uv venv
uv pip install -e .# Create a configuration file with your Snowball token in the project root
# Example content for the token
XUEQIU_TOKEN=你的雪球token
```
You can also quickly set the token with a shell command like this:
```
echo 'XUEQIU_TOKEN="xq_a_token=xxxxx;u=xxxx"' > .env# Start the MCP server using uv. Replace the path with your actual project path.
uv --directory /path/to/xueqiu_mcp run main.pyIf you already use Claude Desktop, you can configure the MCP client with these settings to run the server from your environment:
"xueqiu-mcp": {
"args": [
"--directory",
"/path/to/xueqiu_mcp",
"run",
"main.py"
],
"command": "uv"
}Fetches the latest real-time stock price and basic trading data for a given ticker or symbol.
Retrieves performance data for major indices and benchmarks.
Gets Northbound data for Mainland-Hong Kong stock connections (Shen/Harbor, etc.).
Queries fund-related information and statistics.
Searches and returns stock codes based on keywords or company names.