Skip to main content

MCP Server AkShare

一个基于 Model Context Protocol (MCP) 的 AkShare 金融数据接口服务器。

安装

方式 1: 使用 uvx (推荐)

uvx mcp-server-akshare

方式 2: 使用 pip

pip install mcp-server-akshare
mcp-server-akshare

方式 3: 从源码安装

git clone <repository-url>
cd mcp-server-akshare
pip install -e .

MCP 客户端配置

Claude Desktop

将以下配置添加到你的 Claude Desktop 配置文件中:

{
  "mcpServers": {
    "akshare": {
      "command": "uvx",
      "args": ["mcp-server-akshare"]
    }
  }
}

其他 MCP 客户端

{
  "command": "mcp-server-akshare",
  "args": [],
  "timeout": 30,
  "transportType": "stdio"
}

可用工具

核心工具

  • akshare_list_functions: 列出所有可用的 AkShare 函数
  • akshare_get_categories: 获取所有函数分类
  • akshare_call_function: 调用任意 AkShare 函数
  • akshare_get_function_info: 获取函数详细信息

常用函数快捷工具

  • akshare_stock_zh_a_hist: 获取A股历史数据
  • akshare_stock_info_a_code_name: 获取股票基本信息
  • akshare_macro_china_gdp: 获取GDP数据
  • akshare_futures_main_sina: 获取期货数据
  • akshare_bond_zh_hs_cov_daily: 获取债券数据

使用示例

获取股票历史数据

{
  "tool": "akshare_stock_zh_a_hist",
  "arguments": {
    "symbol": "000001",
    "period": "daily",
    "start_date": "20240101",
    "end_date": "20241231"
  }
}

列出股票相关函数

{
  "tool": "akshare_list_functions",
  "arguments": {
    "category": "stock"
  }
}

调用任意函数

{
  "tool": "akshare_call_function",
  "arguments": {
    "function_name": "stock_zh_a_hist",
    "parameters": {
      "symbol": "000001",
      "period": "daily"
    }
  }
}

支持的数据类别

  • stock: 股票数据
  • futures: 期货数据
  • bond: 债券数据
  • macro: 宏观经济数据
  • energy: 能源数据
  • crypto: 加密货币数据
  • forex: 外汇数据
  • commodity: 商品数据
  • real_estate: 房地产数据
  • news: 新闻数据
  • other: 其他数据

开发说明

项目结构:

akshare_mcp/
├── src/akshare_mcp/
│   ├── __init__.py
│   ├── server.py      # MCP服务器主程序
│   └── wrapper.py     # AkShare接口包装器
├── main.py            # 启动脚本
├── requirements.txt   # 依赖列表
└── README.md         # 说明文档

核心组件:

  • AkShareWrapper: 自动发现和包装AkShare函数
  • AkShareMCPServer: MCP协议服务器实现

Metadata

Release files for mcp-server-akshare 1.0.0

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

Source distribution (sdist)

Source distribution for mcp-server-akshare 1.0.0
File Size Uploaded Provenance
mcp_server_akshare-1.0.0.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-akshare 1.0.0
File Interpreter ABI Platform
mcp_server_akshare-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / mcp_server_akshare-1.0.0.tar.gz

Download URL mcp_server_akshare-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6823608cf2f82c7ca6d646f3556d05dc05605a4e4707170a76b013b5ec046121
BLAKE2b-256 checksum
How to use checksums
e7623c10919237ee2a0e059ca3d1c9b16a56eb9fd230441ba4a54e1d60287919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / mcp_server_akshare-1.0.0-py3-none-any.whl

Download URL mcp_server_akshare-1.0.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b553597ce4209b23079fe66edb22b463743f6f4bf1c4fb6d3e0112884911216
BLAKE2b-256 checksum
How to use checksums
6f49a69e0127d7e531273bff35b79f417e4cb0780a6246c8aa725a193cba2deb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for mcp-server-akshare 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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