AKShare

io.github.hangeaiagentPublished by GitHub account hangeaiagentv0.1.1Updated Oct 24, 2026

Let a model explore AKShare's 1000+ China market data functions on its own — search, inspect, call

VerifiedSTDIODesktop onlyFinanceData & Analytics

Overview

AI-generated overview

A local MCP server that lets an assistant search, inspect and call AKShare's 1000+ China market data functions on demand.

What you can do
Search AKShare's function library by keyword to find which functions can fetch a given dataset, such as 龙虎榜 or 北向资金 holdings details. Inspect a function's signature to learn the parameters it expects. Call a chosen function with arguments and get its returned data, with column names left in their original Chinese. Responses are capped by a configurable row limit, and truncated results say so explicitly.
When to use it
Useful when you need China market, macro, futures, fund or company-governance data from AKShare and do not want to enumerate every interface in advance. Best run on a machine inside mainland China, since most upstream interfaces are there.
Requirements
Runs as a local process, installed from the PyPI package with uvx, or built and run as a Docker image (about 1.5G, several minutes to build). Optional environment variables AKSHARE_MCP_HOST, AKSHARE_MCP_PORT and AKSHARE_MAX_ROWS (default 200). Network access to upstream data sites, preferably from within China or via a proxy. No authentication or API key.
Before you install
The service has no authentication, and it sends requests to third-party sites, so do not expose it to the public internet; bind it to an internal network or put an authenticated reverse proxy in front. The call tool is restricted to public callable attributes of the akshare module, but it still performs real outbound requests. Keep AKSHARE_MAX_ROWS modest so large result sets do not crowd out useful context.

Installation

In SourceWeft

  1. Open AKShare in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

AKShare MCP

把 AKShare 变成一个你自己跑的能力,接进 Hunter。


为什么不是「数据源」

数据源的模型是一条记录 = 一个 (市场, 数据类型, 接口地址)。

AKShare 有一千多个函数 —— 龙虎榜、十大股东、券商研报、公司治理、 南向资金、宏观、期货、基金……按数据源建模就得枚举一千多条,做不到。

Hunter 原来只从里面挑了 6 条进目录,而那 6 条是我们用得上的,不是你 用得上的。你想查「北向资金持股明细」而我们没挑,你就没辙。

改成能力之后,模型拿到三个工具,自己去找、自己去调:

akshare_search("龙虎榜")                    → 有哪些函数能查这个?akshare_signature("stock_lhb_detail_em")   → 它要什么参数?akshare_call("stock_lhb_detail_em", {...}) → 调它

不需要我们提前枚举。

为什么要你自己跑

AKShare 是 Python 库不是 HTTP 服务,没法在表单里填一个 URL。而且它多数 接口的上游在国内,从境外容器直连经常打不通。


跑起来

bash
cd tools/akshare-mcpdocker build -t akshare-mcp .docker run -d -p 8931:8931 --name akshare-mcp akshare-mcp

镜像大约 1.5G(AKShare 自己拖着 pandas/lxml/beautifulsoup4 一大串), 首次构建要几分钟。

验证:

bash
curl -N http://localhost:8931/sse# 有 SSE 流出来就是起来了(它不会自己结束,Ctrl-C 退出)

接进 Hunter

能力 → 接入一个工具 → 填:

字段值
传输方式sse
地址http://你的地址:8931/sse
需要 key不勾

Hunter 跑在 Docker 里的话,localhost 指的是 Hunter 自己的容器 —— 要填宿主机地址(Linux 上是 172.17.0.1,Docker Desktop 上是 host.docker.internal),或者把两个服务放进同一个 compose 网络。

⚠️ **不要填 Hunter 官方的任何地址。**这个服务存在的意义就是让你不依赖我们。


环境变量

变量默认说明
AKSHARE_MCP_HOST0.0.0.0监听地址
AKSHARE_MCP_PORT8931端口
AKSHARE_MAX_ROWS200单次返回最大行数

AKSHARE_MAX_ROWS 不要调太大:AKShare 有些接口一次几万行,原样塞进模型 上下文会把真正有用的东西挤掉。被截断时返回里会明确说,不会假装那就是全部。


安全

akshare_call 只能调 akshare 模块里公开的、可调用的属性:

  • 名字带 _ 前缀的拒绝
  • 带 . 的(想访问子模块)拒绝
  • 不存在或不可调用的拒绝
  • 不做 eval / exec / 动态 import

它不是通用代码执行入口。

**但仍然不要暴露到公网。**这个服务没有鉴权,而 AKShare 会向第三方站点发 请求 —— 公网上任何人都能借你的机器发请求。绑内网,或者加一层带鉴权的反代。


常见问题

调用超时 / 连接被拒 多数 AKShare 接口的上游在国内。如果这台机器在境外,大部分接口都会失败 —— 把它跑在国内的机器上,或者给容器配代理。

函数名找不到 AKShare 的命名多是英文缩写,硬猜会一直失败:龙虎榜是 stock_lhb_detail_em 不是 stock_dragon_tiger。先 akshare_search 再 akshare_call。

返回的列名是中文 AKShare 的原样返回,我们不改列名 —— 改了之后你对着它的文档会对不上。

Source: tools/akshare-mcp/README.md at commit 4af6d96

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts