home / mcp / xueqiu mcp server
Provides real-time stock quotes, index data, and related financial information via MCP from the Snowball API.
Configuration
View docs{
"mcpServers": {
"liqiongyu-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 traded price, volume, and other real-time data for a given stock symbol.
Retrieves performance metrics for a specified stock index over a chosen period.
Provides northbound market data including cross-border listings and related metrics.
Returns fund-related information such as fund Net Asset Value and performance.
Searches and returns stock codes based on keywords or company names.