← Back to Skills Marketplace
realqiyan

Fund Advisor

by qiyan · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ✓ Security Clean
943
Downloads
2
Stars
10
Active Installs
10
Versions
Install in OpenClaw
/install fund-advisor
Description
基金投资顾问技能。提供个人基金持仓统一管理功能,支持所有平台持仓导入、分析、查询;提供基金基础数据、持仓明细、持仓穿透等基于数据查询;提供投资组合分析、投资规划、组合回测服务;提供财经资讯、热点新闻、财经新闻查询;提供基金搜索、公告查询等服务。当用户咨询技能已经覆盖的问题时,优先激活此技能。
README (SKILL.md)

基金顾投 Skill (fund-advisor)

提供个人基金持仓统一管理功能,支持所有平台持仓导入、分析、查询;提供基金基础数据、持仓明细、持仓穿透等基于数据查询;提供投资组合分析、投资规划、组合回测服务;提供财经资讯、热点新闻、财经新闻查询;提供基金搜索、公告查询等服务。

‼️重要:你所有的分析过程和结论必须基于用户导入的持仓数据和qieman-mcp服务器工具获取最新的实时数据。

‼️重要:你引用的其他来源数据可能会给用户带来投资风险,请一定要使用可靠的、准确的、即时的数据,不要提供任何主观的数据和分析结论。

能力范围

  1. 管理用户的基金持仓数据,用户可以通过基金E账户导出所有持仓数据(包括:支付宝、京东金融、腾讯理财、雪球基金、且慢等所有平台的场外基金持仓数据),导入数据时会创建数据库文件存储用户导入的数据,后续可以配合qieman-mcp的数据查询能力进行持仓数据的综合分析。数据目录可通过 FUND_ADVISOR_DATA_PATH 环境变量配置,默认为 $HOME/.fund-advisor,数据库文件名为 fund_portfolio_v1.db

  2. 本技能整合qieman-mcp的五大核心能力模块:

模块 能力说明
金融数据 基金基础信息、净值历史、持仓明细、风险指标、业绩表现等
投研服务 基金筛选、基金诊断、回测分析、相关性分析、风险评估等
投顾服务 资产配置方案、投资规划、风险匹配、财务分析等
投顾内容 实时资讯解读、热点话题、基金经理观点、财经新闻等
通用服务 交易日查询、图表渲染、PDF生成、时间查询等

完整工具清单见 references/mcp-tools-full.md

核心功能

1. 持仓管理

导入用户的持仓数据,后续进行数据分析使用。

数据获取和导入方法:通过基金E账户导出Excel,转换成csv文件后发生给你的Agent。

# 初始化环境(检查 mcporter 和 qieman-mcp 配置)
bash scripts/fund-cli.sh init

# 导入 CSV 持仓文件,导入的数据会覆盖保存到本地数据库
bash scripts/fund-cli.sh import-csv tools/data/holdings.csv

# 导入 Excel 持仓文件,导入的数据会覆盖保存到本地数据库
bash scripts/fund-cli.sh import-excel tools/data/holdings.xlsx

# 同步所有数据到本地(基础信息 + 持仓详情)
bash scripts/fund-cli.sh sync --all

2. 持仓分析

# 按列分组统计
bash scripts/fund-cli.sh group -c invest_type      # 按投资类型分组
bash scripts/fund-cli.sh group -c fund_account     # 按基金账户分组
bash scripts/fund-cli.sh group -c trade_account    # 按交易账户分组
bash scripts/fund-cli.sh group -c fund_manager     # 按基金管理人分组
bash scripts/fund-cli.sh group -c sales_agency     # 按销售机构分组

# 按条件查询持仓明细
bash scripts/fund-cli.sh query -c fund_manager -v "易方达"   # 查询易方达管理的基金
bash scripts/fund-cli.sh query -c invest_type -v "股票型"    # 查询股票型基金
bash scripts/fund-cli.sh query -c fund_name -v "红利"        # 查询名称包含红利的基金

# 查看基金详情
bash scripts/fund-cli.sh detail 004137

3. 基金投资咨询

直接通过 MCP 服务查询任意基金信息,无需本地数据库:

# 批量查询多只基金
mcporter call qieman-mcp.BatchGetFundsDetail --args '{"fundCodes":["004137","000001","110022"]}' --output json

# 查询基金持仓明细
mcporter call qieman-mcp.BatchGetFundsHolding --args '{"fundCodes":["004137"]}' --output json

详细工具参考文档 references/mcp-tools-full.md

数据模型

  • FundHolding - 用户持仓
  • FundInfo - 基金信息

详见 references/reference.md

导入格式

csv示例文件见 assets/sample.csv

  • Excel格式和csv格式相同,只是文件扩展名不同

详细规范见 references/csv-format.md

使用示例

示例1:查询基金信息

用户:"帮我查一下易方达蓝筹精选的信息"

执行:

mcporter call qieman-mcp.BatchGetFundsDetail --args '{"fundCodes":["005827"]}' --output json

示例2:导入新持仓

用户:"我有个CSV文件要导入"

执行:

bash scripts/fund-cli.sh import-csv /path/to/holdings.csv

示例3:同步最新数据

用户:"更新一下基金数据"

执行:

bash scripts/fund-cli.sh sync --all

注意事项

  1. 环境要求:需要先运行 init 命令确保 mcporter 和 qieman-mcp 配置正确
  2. 批量限制:MCP 服务单次最多查询 10 只基金
  3. 数据时效:基金净值和持仓数据有延迟,注意查看净值日期
  4. CSV 编码:支持 utf-8, utf-8-sig, gbk, gb18030 编码
  5. 目录结构:工程代码位于 tools/ 目录下

高级功能场景

场景1:投资组合诊断分析

用户持有基金组合,需要诊断分析:

# 1. 查询基金信息
mcporter call qieman-mcp.BatchGetFundsDetail \
  --args '{"fundCodes":["005094","320007","001003","040046"]}' \
  --output json

# 2. 基金相关性分析
mcporter call qieman-mcp.GetFundsCorrelation \
  --args '{"fundCodes":["005094","320007","001003","040046"]}' \
  --output json

# 3. 组合回测分析
mcporter call qieman-mcp.GetFundsBackTest \
  --args '{"fundCodes":["005094","320007","001003","040046"],"weights":[0.47,0.23,0.17,0.13]}' \
  --output json

场景2:资产配置方案规划

用户希望制定投资方案:

# 1. 获取资产配置方案
mcporter call qieman-mcp.GetAssetAllocationPlan \
  --args '{"expectedAnnualReturn":0.08}' \
  --output json

# 2. 蒙特卡洛模拟
mcporter call qieman-mcp.MonteCarloSimulate \
  --args '{"weights":[0.3,0.3,0.2,0.2],"years":3}' \
  --output json

场景3:基金筛选与对比

用户希望筛选符合特定条件的基金:

# 1. 基金搜索
mcporter call qieman-mcp.SearchFunds \
  --args '{"keyword":"红利","sortBy":"oneYearReturn","limit":10}' \
  --output json

# 2. 基金业绩对比
mcporter call qieman-mcp.GetBatchFundPerformance \
  --args '{"fundCodes":["005827","000001","110022"]}' \
  --output json

# 3. 基金诊断
mcporter call qieman-mcp.GetFundDiagnosis \
  --args '{"fundCode":"005827"}' \
  --output json

场景4:市场分析

用户希望了解市场情况:

# 1. 市场温度计
mcporter call qieman-mcp.GetLatestQuotations \
  --args '{"date":"2025-03-01"}' \
  --output json

# 2. 热点话题
mcporter call qieman-mcp.SearchHotTopic \
  --args '{"limit":10}' \
  --output json

# 3. 基金经理观点
mcporter call qieman-mcp.SearchManagerViewpoint \
  --args '{"industry":"科技","limit":5}' \
  --output json

# 4. 搜索财经资讯
mcporter call qieman-mcp.SearchFinancialNews \
  --args '{"keyword":"降息","startDate":"2025-01-01","limit":10}' \
  --output json

环境配置

1. 配置环境变量

设置 QIEMAN_API_KEY 环境变量:

# 临时设置(当前终端会话)
export QIEMAN_API_KEY="your-api-key-here"

# 永久设置(添加到 shell 配置文件)
echo 'export QIEMAN_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrc

获取 API Key:访问 且慢MCP官网 申请免费 API Key。

可选:设置 FUND_ADVISOR_DATA_PATH 环境变量自定义数据目录:

# 自定义数据目录(默认为 $HOME/.fund-advisor)
export FUND_ADVISOR_DATA_PATH="/path/to/your/data"

2. 安装 mcporter

# NPM
npm install -g mcporter

# 或 Homebrew
brew tap steipete/tap
brew install mcporter

3. 初始化环境

# 检查并初始化环境(会自动使用环境变量中的 API Key 配置 qieman-mcp)
bash scripts/fund-cli.sh init

初始化脚本会:

  1. 检查 mcporter 是否已安装
  2. 检查 QIEMAN_API_KEY 环境变量是否已配置
  3. 自动生成 ~/.mcporter/mcporter.json 配置文件
  4. 测试 MCP 服务连接

参考文档

Usage Guidance
This skill appears to do what it says: import your exported fund CSV/XLSX, store it locally, and query qieman-mcp via the mcporter CLI. Before installing or running it: 1) Be prepared to provide a qieman API key and know that the key will be written into ~/.mcporter/mcporter.json in plaintext — consider using a limited-scope key and ensure that file's permissions are appropriate. 2) Review the tools/src code (especially mcp_service.py and env_checker.py) if you want to confirm there are no additional network endpoints or unexpected behavior. 3) Run the CLI in an isolated environment or test user account if you're cautious (the script will create a venv and a local DB under the configured data path). 4) Back up any existing ~/.mcporter/mcporter.json before allowing the skill to modify it. If you accept those trade-offs, the skill's requirements and actions are proportionate to its stated purpose.
Capability Analysis
Type: OpenClaw Skill Name: fund-advisor Version: 0.1.1 The fund-advisor skill bundle is a legitimate financial management tool designed to track fund portfolios and provide investment analysis. It utilizes a local SQLite database for data persistence and integrates with the 'qieman-mcp' service via the 'mcporter' CLI. While the code performs high-privilege actions such as modifying local configuration files (~/.mcporter/mcporter.json) and executing shell commands via subprocess.run, these behaviors are strictly necessary for its stated functionality and are implemented using safe practices (e.g., avoiding shell=True and using structured JSON arguments). No evidence of data exfiltration, malicious intent, or prompt injection was found across the scripts, Python source code, or markdown instructions.
Capability Assessment
Purpose & Capability
Name/description (fund portfolio management using qieman-mcp) matches requested binaries (mcporter, bash, python, pip) and env vars (QIEMAN_API_KEY, FUND_ADVISOR_DATA_PATH). Requiring mcporter and an API key is appropriate for calling qieman-mcp.
Instruction Scope
Runtime instructions and scripts operate on user-provided CSV/XLSX files, create a local SQLite DB under FUND_ADVISOR_DATA_PATH (default $HOME/.fund-advisor), and call mcporter to query qieman-mcp. The skill will create/modify ~/.mcporter/mcporter.json to configure the MCP server — this is within scope but is a noteworthy side-effect.
Install Mechanism
No remote binary download or archive extraction in the skill metadata. The provided CLI script creates a Python venv and runs 'pip install -e tools' (local editable install). Dependencies come from PyPI (basic libraries). This is a standard local install pattern and not disproportionate to the task.
Credentials
Only QIEMAN_API_KEY and FUND_ADVISOR_DATA_PATH are required and used. The API key is necessary to configure and call qieman-mcp. However, the skill writes the API key into ~/.mcporter/mcporter.json (as part of baseUrl with ?apiKey=...), so the key will be stored in plaintext in that config file — a privacy/secret-storage consideration.
Persistence & Privilege
The skill creates a per-project venv (tools/venv), writes a local SQLite DB under the data path, and will create/modify the global mcporter config at ~/.mcporter/mcporter.json. always:false (not force-included). Modifying mcporter config is expected for this integration but is a side-effect the user should be aware of.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fund-advisor
  3. After installation, invoke the skill by name or use /fund-advisor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.1
- 支持直接导入Excel格式的基金持仓文件(新增 import-excel 命令)。 - 说明文档补充了Excel格式支持及相关导入用法。 - 技能兼容性描述修改为“依赖 mcporter CLI 和 qieman-mcp MCP 服务”。 - 文档表述简化和部分目录标题优化,利于理解和操作。
v0.1.0
- 初始版本发布,提供基金投资顾问基础功能。 - 支持多平台基金持仓数据导入、分析和统一管理。 - 集成 qieman-mcp 服务,实现基金信息、持仓明细、投资组合和财经资讯等多项查询与分析。 - 提供命令行工具,实现持仓分组、条件查询、基金详情等操作。 - 移除旧的测试用例文件,专注主流程功能。
v0.0.9
- 新增 Excel 持仓导入功能,支持直接导入用户导出的 Excel 文件(tools/src/excel_importer.py)。 - 优化和更新 CLI 与统计相关代码,提升持仓分析的准确性与可维护性。 - 调整和完善依赖库配置(tools/requirements.txt)。 - 完善和新增相关单元测试,增强代码健壮性。
v0.0.8
Version 0.0.8 - Enhanced持仓管理功能,支持多平台(E账户)导出数据统一导入、分析和查询。 - CLI新增按列分组(group)与条件查询(query)持仓能力,支持细化账户、机构等维度统计与筛选。 - 精简和重构技能文档,强调标准数据获取方式、安全性与准确性。 - 丰富市场资讯、财经新闻等MCP工具调用示例覆盖场景。 - 增加pytest单测(新增tools/tests/test_fund_tools.py),提升代码稳定性。 - 移除冗余和过时文档文件,优化目录结构。
v0.0.7
Version 0.0.7 - Added centralized config file (`tools/src/config.py`) for managing global configuration and environment variables. - Switched data storage path to be configurable via the `FUND_ADVISOR_DATA_PATH` environment variable, with a new default of `$HOME/.fund-advisor/fund_portfolio_v1.db`. - Updated SKILL.md and all Bash usage examples to use `bash` prefix for improved consistency and clarity. - Adjusted CLI, database logic, and environment checks to support the new configuration approach and location of the database file. - Extended environment requirements: now requires `FUND_ADVISOR_DATA_PATH` in addition to `QIEMAN_API_KEY`.
v0.0.6
Version 0.0.6 - 增加安全规范,强调所有分析和结论必须基于用户导入的持仓数据和qieman-mcp实时数据。 - 明确禁止引用主观数据或其他来源数据,提示可能带来的投资风险。 - 文档顶部新增显著警示,强调分析过程和结论数据来源与准确性要求。 - 其余功能未做更改,仅文档内容有更新。
v0.0.5
- 全新引入本地数据管理与CLI工具,用户持仓数据支持存储于 ./fund_portfolio.db,支持 CSV 导入和多项分析。 - 新增 scripts/fund-cli.sh 脚本,便于一键环境初始化、数据导入同步、持仓分析等操作。 - 增加 tools 目录及模块(含 CLI、数据导入、数据库、环境检测、统计与测试等 Python 组件)。 - 技能文档补充环境变量 QIEMAN_API_KEY 的配置说明,完善初始化和依赖检查流程。 - 精简与优化 SKILL.md 文档结构,更清晰展示各主要功能。
v0.0.3
- 移除了 16 个文件,包括脚本、数据、Python 源码及测试等,精简了本地实现逻辑。 - Skill 说明文档(SKILL.md)保持不变,功能结构与命令示例无更新。 - 现有的功能描述、使用方法和案例未作修改。 - 依赖的外部服务和命令行调用方式不变,内部代码实现被清理。
v0.0.2
- 精简和优化了技能的功能描述,聚焦基金投资顾问及财经信息查询场景。 - 移除了家庭财务分析等非核心金融理财功能,使能力范围更加明确。 - 精简了数据模型和CSV格式的说明,提升文档可读性。 - 优化目录结构和示例,提高用户上手效率。 - 保留了基金信息查询、投资分析、市场分析等核心功能模块。
v0.0.1
Initial release: 专业基金投资全流程顾问工具 - 提供基金信息查询、业绩、持仓、风险、经理等丰富数据 - 支持持仓管理、数据导入导出和本地同步 - 包含投资组合诊断、优化建议及资产配置方案 - 提供家庭财务健康分析及市场资讯解读 - 深度集成盈米且慢MCP服务,适配 mcporter CLI - 支持可视化报告生成及批量基金操作
Metadata
Slug fund-advisor
Version 0.1.1
License MIT-0
All-time Installs 12
Active Installs 10
Total Versions 10
Frequently Asked Questions

What is Fund Advisor?

基金投资顾问技能。提供个人基金持仓统一管理功能,支持所有平台持仓导入、分析、查询;提供基金基础数据、持仓明细、持仓穿透等基于数据查询;提供投资组合分析、投资规划、组合回测服务;提供财经资讯、热点新闻、财经新闻查询;提供基金搜索、公告查询等服务。当用户咨询技能已经覆盖的问题时,优先激活此技能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 943 downloads so far.

How do I install Fund Advisor?

Run "/install fund-advisor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Fund Advisor free?

Yes, Fund Advisor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Fund Advisor support?

Fund Advisor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Fund Advisor?

It is built and maintained by qiyan (@realqiyan); the current version is v0.1.1.

💬 Comments