SuperAPIAI Directory

stock-mcp-server

github.com · AI developer platforms

stock-mcp-server (Qinglong) is a server that provides real-time data from the Chinese A-share market to AI agents through the MCP protocol. It can connect to MCP-capable AI agents such as Claude Code, Cursor, Codex CLI, VS Code, Windsurf, Cline, and Zed, offering real-time quotes, multi-stock batch snapshots, daily/weekly/monthly K-lines (with forward and backward adjustment support), stock search, and market index capabilities. All data comes from Tencent Finance's public quote interfaces, with second-level latency, and uses only real upstream data without simulation or estimation: when an upstream call fails, it returns an error rather than fabricating data. The project runs on Python 3.10+ and uv, and supports local installation, integration into clients via MCP configuration files, and HTTP mode for shared servers. The materials explicitly state that it is for research and educational purposes only, does not constitute investment advice, and is licensed under the MIT License.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose stock-mcp-server is an MCP server for AI agents and development tools, with the project alias Qinglong, and the repository address is https://github.com/niuheilong/stock-mcp-server . Its core purpose is to enable any MCP-capable AI agent to access real-time quote data from the mainland China A-share market through the MCP protocol, so that stock information can be queried directly in conversations, programming, or data analysis scenarios without developers having to integrate quote interfaces themselves.

Main capabilities The project provides the following stock data-related capabilities:

  1. Real-time quotes: obtain real-time quote information for individual stocks.
  2. Multi-stock batch snapshots: supports batch quote snapshot queries for multiple stocks.
  3. K-line data: supports daily, weekly, and monthly K-lines, with forward and backward adjustment methods.
  4. Stock search: supports searching for stocks by name and other information.
  5. Market indices: supports querying market index data.

Regarding data sources, the project uses only Tencent Finance's public interfaces qt.gtimg.cn and web.ifzq.gtimg.cn. The official description emphasizes that the data is not simulated or estimated in any way: if an upstream call fails, the tool returns an error rather than fabricating numbers. Quotes have second-level latency but are not exchange-grade data and should be used as research data.

Usage The runtime requirements are Python 3.10+ and uv. The materials list a local installation option, but do not give a specific local installation command; the local installation command is not provided for now.

Ways to connect to AI agents include three categories:

  1. Cursor, Windsurf, Cline, VS Code: connect via .mcp.json or MCP settings.
  2. Claude Desktop: configure via claude_desktop_config.json.
  3. HTTP mode: connect as a shared server.

In terms of interaction, users can directly make queries in natural language, for example asking "How is Kweichow Moutai doing today?" or "Show the last 5 trading days of Huasheng Tiancheng." Stock codes support multiple input formats: 600410, sh600410, and 600410.SH are all accepted. The rule for the first digit of the code is: Shanghai stocks start with 6, Shenzhen stocks start with 0, 2, or 3, and Beijing stocks start with 4 or 8.

Applicable scenarios and limitations The project is suitable for developers and researchers who need to integrate A-share real-time quote query capabilities into MCP-compatible AI agents, and can assist with research or educational work such as viewing market data and answering stock information questions within programming tools.

Limitations include: the data comes from Tencent Finance's public interfaces, and although quotes are near real-time, they are not exchange-grade and should be treated as research data; coverage of the Beijing Stock Exchange dependson the upstream interface; the project is not affiliated with Tencent and is for research and educational use only, not constituting investment advice. The license is MIT; see the LICENSE file for details.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools