MCP BaoStock Server

MCP BaoStock Server

Stock market data server with multiple APIs, powered by BaoStock.

56
Stars
19
Forks
56
Watchers
2
Issues
MCP BaoStock Server offers a stock data API service based on BaoStock, providing endpoints for retrieving diverse market information. It supports queries for stock basics, K-line historical data, industry classification, dividends, financial indicators, index data, and valuation metrics. Developed in Python, it is designed for easy integration and rapid access to comprehensive Chinese stock market data. The server enables detailed analysis and research with example test cases for each supported endpoint.

Key Features

Provides stock basics information queries
Supports historical K-line (candlestick) data retrieval
Enables industry classification data access
Offers dividend and bonus distribution information
Retrieves quarterly financial indicators such as profitability and growth
Includes index data queries
Delivers valuation metrics like PE and PB ratios
Runs as a Python 3.10+ API server
Integrates with BaoStock and pandas
Sample test cases for all endpoints

Use Cases

Retrieving daily or historical stock prices for analysis
Accessing fundamentals for individual Chinese stocks
Integrating real-time or batch stock data into trading platforms
Performing financial research and reporting
Building dashboards for monitoring market indicators
Evaluating company and industry performance over quarters
Analyzing dividend history and trends for investment decisions
Comparing valuation metrics across companies
Academic research on Chinese financial markets
Automating data collection for quantitative models

README

MCP BaoStock Server

一个基于BaoStock的股票数据服务器,提供了多个接口用于获取股票市场数据。

功能特点

  • 提供股票基本信息查询
  • 支持K线历史数据获取
  • 行业分类数据查询
  • 分红派息数据查询
  • 季度财务指标数据(盈利能力、营运能力、成长能力)
  • 指数数据查询
  • 估值指标数据查询

安装与使用

依赖要求

  • Python 3.10+
  • baostock
  • pandas

使用说明

安装使用

bash
uv run mcp-baostock-server

接口测试用例

以下是各个接口的测试用例示例:

1. 获取股票基本信息

python
# 获取贵州茅台(sh.600519)的基本信息,包括上市日期、行业分类等基础数据

2. 获取K线历史数据

python
获取平安银行(sz.000001)从2023年1月1日到2023年1月31日的日K线数据,使用前复权方式

3. 获取行业分类数据

python
查询中国平安(sh.601318)所属的行业分类信息

4. 获取分红派息数据

python
查看工商银行(sh.601398)在2022年的分红派息详细信息

5. 获取季度盈利能力数据

python
获取贵州茅台2023年第一季度的盈利能力数据,包括净利润、毛利率等指标

6. 获取季度营运能力数据

python
分析招商银行(sh.600036)2023年第二季度的营运能力指标,包括应收账款周转率和存货周转率

7. 获取季度成长能力数据

python
评估比亚迪(sz.002594)2023年第三季度的成长能力,包括营收增长率和净利润增长率

8. 获取指数数据

python
获取沪深300指数(sh.000300)从2023年1月1日到2023年12月31日的日线行情数据

9. 获取估值指标数据

python
分析阿里巴巴(sh.688699)从2023年初至今的估值指标变化,包括市盈率、市净率等数据

技术交流

  • 微信: iamxxn886

Star History

Star History Chart

Repository Owner

HuggingAGI
HuggingAGI

User

Repository Details

Language Python
Default Branch master
Size 137 KB
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Korea Stock MCP Server

    Korea Stock MCP Server

    MCP server for AI-powered analysis of Korean stock data using DART and KRX APIs

    Korea Stock MCP Server provides Model Context Protocol (MCP) compliant access to Korean stock data and disclosures. It integrates official APIs from DART and KRX to enable AI-driven analysis of financial statements, stock prices, and company disclosures. The server is designed for use with agents or assistants like Claude Desktop, offering context-aware tools for financial research and reporting.

    • 5
    • MCP
    • jjlabsio/korea-stock-mcp
  • BlockBeats MCP Server

    BlockBeats MCP Server

    Delivering real-time blockchain news and in-depth articles to AI agents via MCP.

    BlockBeats MCP Server provides AI agents with access to the latest blockchain news and detailed articles from BlockBeats through an MCP-compliant server. Featuring rapid retrieval of news and in-depth content across multiple languages, it supports integration with clients such as Claude Desktop. The server offers two main tools for fetching fast news updates and comprehensive articles, enabling seamless knowledge delivery for AI systems.

    • 8
    • MCP
    • kukapay/blockbeats-mcp
  • Crypto Indicators MCP Server

    Crypto Indicators MCP Server

    Technical analysis indicators and strategies for AI trading via the Model Context Protocol.

    Crypto Indicators MCP Server provides over 50 cryptocurrency technical analysis indicators and quantitative trading strategies through an MCP-compliant server interface. The tool is designed for AI trading agents and can integrate seamlessly with platforms like Claude Desktop. It offers support for multiple exchanges via CCXT, modular design for easy maintenance, and outputs actionable trading signals based on market trends.

    • 91
    • MCP
    • kukapay/crypto-indicators-mcp
  • Crypto Orderbook MCP

    Crypto Orderbook MCP

    Real-time crypto order book analytics for AI agents and trading systems.

    Crypto Orderbook MCP provides an MCP-compatible server that analyzes order book depth and imbalance across major cryptocurrency exchanges. It empowers AI agents and trading systems with unified, real-time market structure insights. Users can calculate and compare key order book metrics such as bid/ask depth and imbalance across multiple platforms using straightforward tools. The server returns data in structured formats for seamless integration with AI-enabled workflows.

    • 10
    • MCP
    • kukapay/crypto-orderbook-mcp
  • Crypto Whitepapers MCP Server

    Crypto Whitepapers MCP Server

    Structured crypto whitepaper knowledge base and search server for AI agents.

    Crypto Whitepapers MCP Server provides an MCP-compliant server that acts as a structured knowledge base of cryptocurrency project whitepapers for AI agents. It enables searching, loading, indexing, and querying of whitepaper PDFs while supporting integration with Claude Desktop via the Model Context Protocol. The tool implements interactive tools and prompts to help users and AI analyze, search, and extract insights from crypto whitepapers.

    • 5
    • MCP
    • kukapay/crypto-whitepapers-mcp
  • Crypto Portfolio MCP

    Crypto Portfolio MCP

    Real-time crypto portfolio management and analysis via MCP.

    Crypto Portfolio MCP is an MCP server that enables users and AI agents to track, manage, and optimize cryptocurrency portfolio allocations with live Binance price integration. It allows querying of portfolio status, addition of holdings, price fetching, value history chart generation, and portfolio analysis suggestions. The server provides persistent storage using SQLite and exposes API-like tools for seamless interaction through an MCP client. Designed for integration with platforms like Claude Desktop, it facilitates dynamic crypto asset management and insight generation.

    • 9
    • MCP
    • kukapay/crypto-portfolio-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results