Skip to main content
Glama
tianzongbo

AkShare MCP Server

by tianzongbo

AkShare MCP Server

Local MCP server exposing AkShare tools for A-share and index data.

Features

  • Query single-stock latest data: get_a_share_quote

  • Query historical bars by date range: get_a_share_history

  • Query China index snapshot: get_china_index_snapshot

  • Built-in fallback logic for unstable realtime endpoints

Related MCP server: Stock-MCP

Tool List

  1. get_a_share_quote(symbol)

    • Input example: 000001

    • Output: realtime quote if available, otherwise latest daily fallback

  2. get_a_share_history(symbol, start_date, end_date, period="daily", adjust="", limit=120)

    • Date format: YYYYMMDD

    • period: daily | weekly | monthly

    • adjust: "" | "qfq" | "hfq"

  3. get_china_index_snapshot(limit=20)

    • Snapshot source: Sina

    • Fallback: recent bar from index daily endpoint

Install

python3 -m venv .venv
./.venv/bin/pip install -r requirements.txt

Run Server

./.venv/bin/python server.py

Server runs via stdio transport and is ready for MCP clients.

OpenCode Configuration

Add this block to your ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "akshare-finance": {
      "type": "local",
      "enabled": true,
      "command": [
        "/ABSOLUTE/PATH/TO/.venv/bin/python",
        "/ABSOLUTE/PATH/TO/akshare_mcp_server/server.py"
      ]
    }
  }
}

Then verify:

opencode mcp list

Expected: akshare-finance shows connected.

Claude Desktop Configuration

{
  "mcpServers": {
    "akshare-finance": {
      "command": "/ABSOLUTE/PATH/TO/.venv/bin/python",
      "args": ["/ABSOLUTE/PATH/TO/akshare_mcp_server/server.py"]
    }
  }
}

Example Prompts

  • "用 akshare-finance 查 000001 最近 30 个交易日"

  • "用 akshare-finance 查中国主要指数快照"

  • "用 akshare-finance 查 600519 从 20240101 到 20240301 的日线"

Notes

  • get_a_share_quote and get_a_share_history include fallback to Sina daily when Eastmoney realtime/history endpoints are unstable.

  • If your network is unstable, retry once before concluding endpoint failure.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Provides comprehensive access to Chinese stock market data including real-time quotes, historical prices, financial statements, technical indicators, news, and macroeconomic data for A/B/H shares through multiple data sources.
    Last updated
    30
    43
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides real-time A-share (Chinese stock market) data through AKShare integration, enabling access to market overviews, company information, real-time quotes, and historical price data for Shanghai and Shenzhen stock exchanges.
    Last updated
    1
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    Provides comprehensive data for A-shares, Hong Kong, and US stocks alongside cryptocurrency markets, supporting technical indicators, news, and financial statements. It features automatic failover across multiple data sources to ensure reliable access to real-time and historical market information.
    Last updated
    47
    31
    MIT
  • A
    license
    -
    quality
    F
    maintenance
    Provides access to Chinese mainland financial data including A-stock quotes, financial statements, industry analysis, and macroeconomics through 42 MCP tools, with automatic data source fallback and no API key required.
    Last updated
    25
    Apache 2.0

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tianzongbo/akshare-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server