npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wbavon/china-market-data

v0.2.0

Published

Free Chinese market data MCP server — A-shares, indices, fundamentals, sectors. Multi-source with automatic fallback (Tencent/Baostock/Eastmoney/Sina).

Readme

China Market Data

Free Chinese A-share market data service for AI agents. Powered by akshare — data from 东方财富/新浪/同花顺, 100% local.

Architecture

Agent (Claude/Cursor/VS Code)
  ↓
MCP Server (stdio)          CLI (python3 engine/engine.py)
  ↓                              ↓
┌──────────────────────────────────────────┐
│          data_service.py                 │
│  Stock / Index / Board / Macro / Screener│
└────────────────┬─────────────────────────┘
                 ↓
        akshare (Python lib)
       ┌────┬────┬─────┐
       东方财富 新浪 同花顺 ...

Quick Start

Note: On macOS/Linux use python3 and pip3; on Windows use python and pip.

# Install dependencies
pip install -r engine/requirements.txt

# Initialize database (optional)
python engine/engine.py init

# Query real-time quote
python engine/engine.py stock --symbol 600519

# Historical K-line
python engine/engine.py hist 600519 --start 20240101 --period daily

# Fundamentals
python engine/engine.py info 600519

# Screen stocks
python engine/engine.py screener --min-pe 5 --max-pe 20

# Industry ranking
python engine/engine.py board-industry

# Macro
python engine/engine.py macro cpi

MCP Server

Add to your MCP client config (Claude Desktop / Cursor / VS Code):

macOS / Linux:

{
  "mcpServers": {
    "china-market-data": {
      "command": "python3",
      "args": ["/path/to/china-market-data/mcp_server.py"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "china-market-data": {
      "command": "python",
      "args": ["C:\\path\\to\\china-market-data\\mcp_server.py"]
    }
  }
}

Available Tools

| Tool | Description | |------|-------------| | market_stock_quotes | Single stock real-time quote | | market_market_quotes | All A-share market quotes | | market_stock_history | Historical K-line data | | market_stock_info | Company basic info | | market_stock_financials | Financial statements | | market_index_history | Index historical data | | market_indices | Major indices real-time | | market_board_industry | Industry sector ranking | | market_board_concept | Concept sector ranking | | market_board_flow | Sector capital flow | | market_stock_fund_flow | Stock capital flow | | market_screener | Stock screener (PE/market cap/industry) | | market_industries | List industry classifications | | market_macro | Macroeconomic indicators (GDP/CPI/PPI/M2) |

CLI Commands

python engine/engine.py stock --symbol 600519                  # 实时行情
python engine/engine.py hist 600519 --start 20240101            # 历史K线
python engine/engine.py info 600519                             # 基本信息
python engine/engine.py financials 600519 --type 利润表          # 财报
python engine/engine.py index-hist 000001                       # 指数历史
python engine/engine.py indices                                 # 主要指数
python engine/engine.py board-industry                          # 行业排行
python engine/engine.py board-concept                           # 概念排行
python engine/engine.py board-flow --type industry              # 资金流向
python engine/engine.py fund-flow 600519                        # 个股资金流
python engine/engine.py screener --min-pe 5 --max-pe 20         # 选股
python engine/engine.py industries                              # 行业列表
python engine/engine.py macro cpi                               # CPI
python engine/engine.py macro gdp                               # GDP

Requirements

  • Python 3.9+
  • akshare>=1.10.0
  • pandas>=2.0.0
  • baostock>=0.8.8
  • requests, numpy (akshare deps)
  • Supported platforms: macOS, Linux, Windows

Data Sources

Multi-source with automatic fallback:

| Data Type | Primary | Fallback | Last Resort | |-----------|---------|----------|-------------| | Historical K-line | Tencent Finance | Baostock | akshare | | Real-time Quotes | Eastmoney | Sina Finance | — | | Sector/Board | akshare (Eastmoney) | — | — | | Financials | akshare (Sina) | — | — | | Macro | akshare | — | — |

Three-tier cache: Memory (hot) → File (warm) → Network (cold). Stale file cache serves as fallback when all sources fail.

Data Storage

SQLite at ~/.chinamarket/data/market.db (macOS/Linux) or %USERPROFILE%\.chinamarket\data\market.db (Windows). Auto-created on first use.

License

MIT