Home / MCP / Xueqiu MCP Server

Xueqiu MCP Server

Provides stock data via MCP: real-time quotes, index performance, Northbound data, funds, and stock code search.

python
Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

# 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

Additional configuration and run details

# Start the MCP server using uv. Replace the path with your actual project path.
uv --directory /path/to/xueqiu_mcp run main.py

If 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"
}

Available tools

real_time_quote

Fetches the latest real-time stock price and basic trading data for a given ticker or symbol.

index_performance

Retrieves performance data for major indices and benchmarks.

northbound_data

Gets Northbound data for Mainland-Hong Kong stock connections (Shen/Harbor, etc.).

fund_data

Queries fund-related information and statistics.

search_stock_code

Searches and returns stock codes based on keywords or company names.