Skip to main content

AKShare MCP Server

An MCP stdio server for A-share market technical analysis powered by AkShare.

Features

  • Real-time A-share quotes with multi-source fallback and in-memory cache.
  • A-share historical K-line data (daily/weekly/monthly) with local cache.
  • A-share intraday minute K-line data (1/5/15/30/60).
  • Technical indicators (Bollinger, RSI, MACD, KDJ, ADX, EMA).
  • Index analysis, index/ETF spot, sector fund flow, northbound fund flow.
  • Market calendar and market status.
  • Export to CSV/Parquet in any user-specified directory.

Install

pip install stock-trading-mcp

Run

stock-trading-mcp

PyPI

This package is published to PyPI. You can verify releases at: https://pypi.org/project/stock-trading-mcp/

Cache directory

Historical K-line data is cached to a local directory. By default the cache is created under the current working directory as .akshare_cache. You can override this by setting AKSHARE_MCP_CACHE_DIR to any path you want.

Example tool calls

Intraday minutes (with export)

{
  "tool": "stock_intraday",
  "arguments": {
    "symbol": "601138",
    "period": "15",
    "raw_only": true,
    "save_dir": "./data",
    "save_format": "csv"
  }
}

Market calendar / market status

{
  "tool": "market_calendar",
  "arguments": {
    "start_date": "20260202",
    "end_date": "20260209"
  }
}
{
  "tool": "market_status",
  "arguments": {}
}

Note: market_calendar/market_status use Sina calendar by default and fall back to a cached calendar. If both are unavailable, a weekday-based heuristic is used and responses include "approximate": true.

ETF list / ETF spot

{
  "tool": "etf_list",
  "arguments": {
    "category": "ETF基金",
    "keyword": "软件",
    "limit": 20
  }
}
{
  "tool": "etf_spot",
  "arguments": {
    "keyword": "软件",
    "limit": 20
  }
}

Note: etf_spot uses Eastmoney by default and falls back to Sina ETF list data if Eastmoney is unavailable (e.g., proxy/network issues).

ETF flow (share change / redemption)

{
  "tool": "etf_flow",
  "arguments": {
    "market": "SSE",
    "date": "20250115",
    "prev_date": "20250114",
    "limit": 20
  }
}

Note: etf_flow reports ETF share changes (not cash flow). SZSE provides only latest shares and does not support date comparison.

ETF intraday (15-minute) with export

{
  "tool": "etf_intraday",
  "arguments": {
    "symbol": "159707",
    "period": "15",
    "start_date": "20260209",
    "end_date": "20260209",
    "save_dir": "./data",
    "save_format": "csv",
    "raw_only": true
  }
}

ETF history

{
  "tool": "etf_history",
  "arguments": {
    "symbol": "159xxx",
    "period": "daily",
    "start_date": "20260202",
    "end_date": "20260209"
  }
}

Index spot

{
  "tool": "index_spot",
  "arguments": {
    "category": "沪深重要指数",
    "limit": 20
  }
}

涨停板/强势股/炸板股池

{
  "tool": "ztb_pool",
  "arguments": {
    "pool_type": "strong",
    "limit": 20
  }
}

盘口异动 / 板块异动

{
  "tool": "pankou_changes",
  "arguments": {
    "change_type": "火箭发射"
  }
}
{
  "tool": "board_changes",
  "arguments": {}
}

市场热度

{
  "tool": "market_hot",
  "arguments": {
    "source": "em_rank",
    "limit": 20
  }
}
{
  "tool": "market_hot",
  "arguments": {
    "source": "baidu_hot_search",
    "market": "A股",
    "time": "今日",
    "limit": 20
  }
}

概念/行业资金流 + 行业榜单

{
  "tool": "fund_flow",
  "arguments": {
    "scope": "concept",
    "period": "即时",
    "limit": 20
  }
}
{
  "tool": "fund_flow",
  "arguments": {
    "scope": "industry",
    "period": "即时",
    "limit": 20
  }
}
{
  "tool": "fund_flow",
  "arguments": {
    "mode": "industry_rank",
    "limit": 20
  }
}

Note: fund_flow with mode=industry_rank returns today's industry ranking.

Stock analysis (with export)

{
  "tool": "stock_analysis",
  "arguments": {
    "symbol": "601138",
    "period": "daily",
    "days": 365,
    "raw_only": false,
    "save_dir": "./data",
    "save_format": "parquet"
  }
}

Index analysis (raw only, with export)

{
  "tool": "index_analysis",
  "arguments": {
    "symbol": "000001",
    "period": "daily",
    "raw_only": true,
    "save_dir": "./data",
    "save_format": "csv"
  }
}

Metadata

Release files for stock-trading-mcp 0.2.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stock-trading-mcp 0.2.19
File Size Uploaded Provenance Actions
stock_trading_mcp-0.2.19.tar.gz 27.6 kB Without provenance Details for stock_trading_mcp-0.2.19.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stock-trading-mcp 0.2.19
File Interpreter ABI Platform Actions
stock_trading_mcp-0.2.19-py3-none-any.whl Python 3 none any Details for stock_trading_mcp-0.2.19-py3-none-any.whl

Total release size: 56.6 kB

Release files / stock_trading_mcp-0.2.19.tar.gz

Download URL stock_trading_mcp-0.2.19.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ba85f45bcc4eb398b68cf0dd7cb3d2ab94d767244b874db063b270ed8cfc9ab6
BLAKE2b-256 checksum
How to use checksums
326b737b40d4130f805be9e4ac102e121dbf3bceb5ffa126b605036a8f95b4ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / stock_trading_mcp-0.2.19-py3-none-any.whl

Download URL stock_trading_mcp-0.2.19-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e4d0a79bda9fdb27ed596f682ee87fc2f7d776dd490e4f84066091b27d7403e
BLAKE2b-256 checksum
How to use checksums
f6f537aa9b235b5d1a3ea1dd252c557a6f685714258368fec01db75de7e7556a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Security for stock-trading-mcp 0.2.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page