mcp-server-akshare


Namemcp-server-akshare JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryModel Context Protocol server for AkShare financial data APIs
upload_time2025-08-18 14:24:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords akshare financial-data mcp model-context-protocol
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MCP Server AkShare

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

## 安装

### 方式 1: 使用 uvx (推荐)

```bash
uvx mcp-server-akshare
```

### 方式 2: 使用 pip

```bash
pip install mcp-server-akshare
mcp-server-akshare
```

### 方式 3: 从源码安装

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

## MCP 客户端配置

### Claude Desktop

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

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

### 其他 MCP 客户端

```json
{
  "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`: 获取债券数据

## 使用示例

### 获取股票历史数据

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

### 列出股票相关函数

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

### 调用任意函数

```json
{
  "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协议服务器实现

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-server-akshare",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "akshare, financial-data, mcp, model-context-protocol",
    "author": null,
    "author_email": "AkShare MCP Server <example@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/e7/62/3c10919237ee2a0e059ca3d1c9b16a56eb9fd230441ba4a54e1d60287919/mcp_server_akshare-1.0.0.tar.gz",
    "platform": null,
    "description": "# MCP Server AkShare\n\n\u4e00\u4e2a\u57fa\u4e8e Model Context Protocol (MCP) \u7684 AkShare \u91d1\u878d\u6570\u636e\u63a5\u53e3\u670d\u52a1\u5668\u3002\n\n## \u5b89\u88c5\n\n### \u65b9\u5f0f 1: \u4f7f\u7528 uvx (\u63a8\u8350)\n\n```bash\nuvx mcp-server-akshare\n```\n\n### \u65b9\u5f0f 2: \u4f7f\u7528 pip\n\n```bash\npip install mcp-server-akshare\nmcp-server-akshare\n```\n\n### \u65b9\u5f0f 3: \u4ece\u6e90\u7801\u5b89\u88c5\n\n```bash\ngit clone <repository-url>\ncd mcp-server-akshare\npip install -e .\n```\n\n## MCP \u5ba2\u6237\u7aef\u914d\u7f6e\n\n### Claude Desktop\n\n\u5c06\u4ee5\u4e0b\u914d\u7f6e\u6dfb\u52a0\u5230\u4f60\u7684 Claude Desktop \u914d\u7f6e\u6587\u4ef6\u4e2d\uff1a\n\n```json\n{\n  \"mcpServers\": {\n    \"akshare\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-akshare\"]\n    }\n  }\n}\n```\n\n### \u5176\u4ed6 MCP \u5ba2\u6237\u7aef\n\n```json\n{\n  \"command\": \"mcp-server-akshare\",\n  \"args\": [],\n  \"timeout\": 30,\n  \"transportType\": \"stdio\"\n}\n```\n\n## \u53ef\u7528\u5de5\u5177\n\n### \u6838\u5fc3\u5de5\u5177\n\n- `akshare_list_functions`: \u5217\u51fa\u6240\u6709\u53ef\u7528\u7684 AkShare \u51fd\u6570\n- `akshare_get_categories`: \u83b7\u53d6\u6240\u6709\u51fd\u6570\u5206\u7c7b\n- `akshare_call_function`: \u8c03\u7528\u4efb\u610f AkShare \u51fd\u6570\n- `akshare_get_function_info`: \u83b7\u53d6\u51fd\u6570\u8be6\u7ec6\u4fe1\u606f\n\n### \u5e38\u7528\u51fd\u6570\u5feb\u6377\u5de5\u5177\n\n- `akshare_stock_zh_a_hist`: \u83b7\u53d6A\u80a1\u5386\u53f2\u6570\u636e\n- `akshare_stock_info_a_code_name`: \u83b7\u53d6\u80a1\u7968\u57fa\u672c\u4fe1\u606f\n- `akshare_macro_china_gdp`: \u83b7\u53d6GDP\u6570\u636e\n- `akshare_futures_main_sina`: \u83b7\u53d6\u671f\u8d27\u6570\u636e\n- `akshare_bond_zh_hs_cov_daily`: \u83b7\u53d6\u503a\u5238\u6570\u636e\n\n## \u4f7f\u7528\u793a\u4f8b\n\n### \u83b7\u53d6\u80a1\u7968\u5386\u53f2\u6570\u636e\n\n```json\n{\n  \"tool\": \"akshare_stock_zh_a_hist\",\n  \"arguments\": {\n    \"symbol\": \"000001\",\n    \"period\": \"daily\",\n    \"start_date\": \"20240101\",\n    \"end_date\": \"20241231\"\n  }\n}\n```\n\n### \u5217\u51fa\u80a1\u7968\u76f8\u5173\u51fd\u6570\n\n```json\n{\n  \"tool\": \"akshare_list_functions\",\n  \"arguments\": {\n    \"category\": \"stock\"\n  }\n}\n```\n\n### \u8c03\u7528\u4efb\u610f\u51fd\u6570\n\n```json\n{\n  \"tool\": \"akshare_call_function\",\n  \"arguments\": {\n    \"function_name\": \"stock_zh_a_hist\",\n    \"parameters\": {\n      \"symbol\": \"000001\",\n      \"period\": \"daily\"\n    }\n  }\n}\n```\n\n## \u652f\u6301\u7684\u6570\u636e\u7c7b\u522b\n\n- **stock**: \u80a1\u7968\u6570\u636e\n- **futures**: \u671f\u8d27\u6570\u636e  \n- **bond**: \u503a\u5238\u6570\u636e\n- **macro**: \u5b8f\u89c2\u7ecf\u6d4e\u6570\u636e\n- **energy**: \u80fd\u6e90\u6570\u636e\n- **crypto**: \u52a0\u5bc6\u8d27\u5e01\u6570\u636e\n- **forex**: \u5916\u6c47\u6570\u636e\n- **commodity**: \u5546\u54c1\u6570\u636e\n- **real_estate**: \u623f\u5730\u4ea7\u6570\u636e\n- **news**: \u65b0\u95fb\u6570\u636e\n- **other**: \u5176\u4ed6\u6570\u636e\n\n## \u5f00\u53d1\u8bf4\u660e\n\n\u9879\u76ee\u7ed3\u6784\uff1a\n```\nakshare_mcp/\n\u251c\u2500\u2500 src/akshare_mcp/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 server.py      # MCP\u670d\u52a1\u5668\u4e3b\u7a0b\u5e8f\n\u2502   \u2514\u2500\u2500 wrapper.py     # AkShare\u63a5\u53e3\u5305\u88c5\u5668\n\u251c\u2500\u2500 main.py            # \u542f\u52a8\u811a\u672c\n\u251c\u2500\u2500 requirements.txt   # \u4f9d\u8d56\u5217\u8868\n\u2514\u2500\u2500 README.md         # \u8bf4\u660e\u6587\u6863\n```\n\n\u6838\u5fc3\u7ec4\u4ef6\uff1a\n- `AkShareWrapper`: \u81ea\u52a8\u53d1\u73b0\u548c\u5305\u88c5AkShare\u51fd\u6570\n- `AkShareMCPServer`: MCP\u534f\u8bae\u670d\u52a1\u5668\u5b9e\u73b0\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Model Context Protocol server for AkShare financial data APIs",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/mcp-server-akshare",
        "Issues": "https://github.com/yourusername/mcp-server-akshare/issues",
        "Repository": "https://github.com/yourusername/mcp-server-akshare"
    },
    "split_keywords": [
        "akshare",
        " financial-data",
        " mcp",
        " model-context-protocol"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6f49a69e0127d7e531273bff35b79f417e4cb0780a6246c8aa725a193cba2deb",
                "md5": "218b579205fa42cff09cef0512817598",
                "sha256": "1b553597ce4209b23079fe66edb22b463743f6f4bf1c4fb6d3e0112884911216"
            },
            "downloads": -1,
            "filename": "mcp_server_akshare-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "218b579205fa42cff09cef0512817598",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8490,
            "upload_time": "2025-08-18T14:24:16",
            "upload_time_iso_8601": "2025-08-18T14:24:16.384744Z",
            "url": "https://files.pythonhosted.org/packages/6f/49/a69e0127d7e531273bff35b79f417e4cb0780a6246c8aa725a193cba2deb/mcp_server_akshare-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e7623c10919237ee2a0e059ca3d1c9b16a56eb9fd230441ba4a54e1d60287919",
                "md5": "8408d105ec34a26c0d4a124b84dcdbe3",
                "sha256": "6823608cf2f82c7ca6d646f3556d05dc05605a4e4707170a76b013b5ec046121"
            },
            "downloads": -1,
            "filename": "mcp_server_akshare-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8408d105ec34a26c0d4a124b84dcdbe3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6916,
            "upload_time": "2025-08-18T14:24:17",
            "upload_time_iso_8601": "2025-08-18T14:24:17.688471Z",
            "url": "https://files.pythonhosted.org/packages/e7/62/3c10919237ee2a0e059ca3d1c9b16a56eb9fd230441ba4a54e1d60287919/mcp_server_akshare-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-18 14:24:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "mcp-server-akshare",
    "github_not_found": true,
    "lcname": "mcp-server-akshare"
}
        
Elapsed time: 0.72002s