Metadata-Version: 2.4
Name: data-wise-akshare-mcp-server
Version: 1.1.0
Summary: AkShare MCP Server - 提供 AkShare 金融数据接口的 MCP 服务
Project-URL: Homepage, https://github.com/datawisecenter/akshare-mcp-server
Project-URL: Repository, https://github.com/datawisecenter/akshare-mcp-server
Project-URL: Documentation, https://github.com/datawisecenter/akshare-mcp-server#readme
Author-email: DataWiseCenter <contact@datawisecenter.com>
License: MIT
License-File: LICENSE
Keywords: akshare,fastmcp,finance,fund,futures,mcp,stock
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: akshare
Requires-Dist: fastmcp>=2.14.1
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# AkShare MCP Server

提供 AkShare 金融数据接口的 MCP 服务。

## 版本更新

### v1.1.0 (2025-01-02)
- 🎉 **重构工具接口**：从 3 个工具简化为 2 个核心工具
- ✨ **智能搜索**：`search_functions` 支持多关键词组合搜索
- 📋 **参数规范化**：清晰展示参数类型、默认值、描述
- 🔧 **一步到位**：可选 `include_detail` 直接获取完整函数信息
- 🐛 **修复日期序列化**：自动处理 date/datetime 对象
- 📚 **改进文档**：更详细的使用说明和示例

## 功能特性

- 🔍 智能搜索 AkShare 函数（支持多关键词）
- 📖 查看函数详细信息（参数类型、默认值、文档）
- 🚀 执行函数获取金融数据
- 💰 支持股票、基金、期货、宏观经济等 1000+ 数据接口

## 安装

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

## 使用方法

### 作为 MCP 服务器运行

```bash
uvx data-wise-akshare-mcp-server
```

### 在 Kiro 中配置

在 `.kiro/settings/mcp.json` 中添加：

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

## 可用工具

### 1. search_functions - 智能搜索函数

搜索 AkShare 函数，支持多关键词组合搜索，可选返回详细信息。

**参数：**
- `keyword` (可选): 搜索关键词，支持空格分隔多个关键词
  - 例如：`"stock zh hist"` 搜索 A股历史数据
- `limit` (可选): 返回数量限制，默认 10
- `include_detail` (可选): 是否返回详细信息，默认 False
  - `False`: 返回函数名和简短描述
  - `True`: 返回完整参数信息（类型、默认值、描述）

**示例：**

快速浏览：
```json
{
  "keyword": "stock",
  "limit": 5,
  "include_detail": false
}
```

获取详细信息：
```json
{
  "keyword": "stock zh hist",
  "limit": 3,
  "include_detail": true
}
```

**搜索技巧：**
- 函数名中的下划线会被当作空格，所以 `"stock hist"` 可以匹配 `stock_zh_a_hist`
- 多个关键词用空格分隔，会匹配同时包含所有关键词的函数
- 常用搜索：
  - `"stock zh spot"` - A股实时行情
  - `"fund etf"` - ETF基金
  - `"futures main"` - 期货主力合约
  - `"macro china gdp"` - 中国GDP数据

### 2. execute_function - 执行函数

执行指定的 AkShare 函数并返回数据。

**参数：**
- `function_name` (必需): 函数名（通过 search_functions 查找）
- `params` (可选): 函数参数字典

**示例：**

无参数函数：
```json
{
  "function_name": "macro_china_gdp",
  "params": {}
}
```

带参数函数：
```json
{
  "function_name": "stock_zh_a_hist",
  "params": {
    "symbol": "000001",
    "period": "daily",
    "start_date": "20240101",
    "end_date": "20241231"
  }
}
```

## 使用流程

**推荐流程（2步）：**

1. 使用 `search_functions` 搜索并获取函数详情
   ```json
   {
     "keyword": "stock zh hist",
     "include_detail": true
   }
   ```

2. 使用 `execute_function` 执行函数获取数据
   ```json
   {
     "function_name": "stock_zh_a_hist",
     "params": {"symbol": "000001"}
   }
   ```

## 常用函数示例

### 股票数据
- `stock_zh_a_spot_em`: A股实时行情
- `stock_zh_a_hist`: A股历史行情
- `stock_zh_a_daily`: A股日线数据

### 基金数据
- `fund_open_fund_info_em`: 开放式基金信息
- `fund_etf_spot_em`: ETF实时行情

### 期货数据
- `futures_main_sina`: 期货主力合约
- `futures_zh_spot`: 期货实时行情

### 宏观经济
- `macro_china_cpi`: 中国CPI数据
- `macro_china_ppi`: 中国PPI数据
- `macro_china_gdp`: 中国GDP数据

## 依赖

- fastmcp >= 2.14.1
- akshare >= 1.14.0

## 许可证

MIT License
