a-share-mcp-is-just-i-need  by 24mlight

A-share financial data server

created 3 months ago
328 stars

Top 84.4% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Model Context Protocol (MCP) server specifically designed for the A-share stock market. It offers comprehensive data querying capabilities, including stock fundamentals, historical K-line data, financial metrics, and macroeconomic indicators, aiming to answer virtually any question about the A-share market for researchers and financial analysts.

How It Works

The server leverages the Baostock API as its primary data source, ensuring no cost for data access. It is built with Python and utilizes uv for package management. The architecture includes a main server entry point (mcp_server.py), a data source interface, and various modules for data formatting and specific market tools (stock market, financial reports, indices, macroeconomic data). This modular design facilitates extensibility and maintainability.

Quick Start & Requirements

  • Installation: Install dependencies using uv sync within a virtual environment created by uv venv.
  • Prerequisites: Python 3.10+ is required. The project was developed on Windows.
  • Configuration: Users need to configure the server in MCP-compatible clients (e.g., VS Code, CherryStudio) using uv run python mcp_server.py with appropriate working directory arguments.
  • Documentation: Links to Baostock data update times and MCP server configuration examples are provided.

Highlighted Details

  • Provides access to stock basic information, historical K-line data, dividend data, adjustment factors, financial reports (profit, operation, growth, balance, cash flow, DuPont analysis), index constituents (SZ50, HS300, ZZ500), and macroeconomic data (deposit rates, loan rates, reserve ratios, money supply, SHIBOR).
  • Utilizes Baostock, a free data source, eliminating the need for paid accounts.
  • Includes tools for data analysis and market overview.
  • Supports stdio transport for MCP clients.

Maintenance & Community

The project welcomes contributions via Issues or Pull Requests. A "buy me a coffee" link is available for donations.

Licensing & Compatibility

The project is licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

Data availability is subject to Baostock's update schedule; real-time data might not be immediately accessible after market close. The project was primarily developed and tested on Windows, though macOS/Linux configurations are mentioned.

Health Check
Last commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
195 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.