Skip to main content
Glama
hillerliao

index-valuation

by hillerliao

📈 指数估值查询服务

基于雪球 API 的指数估值查询 MCP Server,提供指数估值数据。

✨ 功能特性

  • 🔄 权威数据:调用雪球基金指数估值数据 API,获取估值

  • 🎯 63个指数:覆盖 行业、宽基、策略等类型指数

  • 📊 最新查询:支持模糊匹配、批量查询、估值筛选

  • 📈 历史估值:查询历史数据,分析估值趋势

  • MCP 协议:可集成到 Claude Code、Cursor 等 AI 工具

  • 💾 自动缓存:1小时自动刷新,减少 API 调用

Related MCP server: a-share-mcp

📦 快速开始

1. 安装依赖

cd /YOUR-PATH-TO/index_valuation
uv venv
source .venv/bin/activate
uv pip install mcp requests

2. 测试服务状态

source .venv/bin/activate
python3 tests/test_mcp_server.py

3. 配置 MCP

编辑 Claude Code 配置文件 ~/.claude/settings.json

{
  "mcpServers": {
    "index-valuation": {
      "command": "/YOUR-PATH-TO/index_valuation/.venv/bin/python",
      "args": ["/YOUR-PATH-TO/index_valuation/mcp_server.py"],
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONPATH": "/YOUR-PATH-TO/index_valuation"
      },
      "description": "指数估值查询服务(支持最新+历史查询)"
    }
  }
}

4. 重启 Claude Code

配置完成后,重启 Claude Code。

开始享用

🛠️ 可用工具

工具

描述

使用场景

get_index_valuation

查询单个指数估值(最新)

"沪深300估值如何"

get_batch_indices

批量查询多个指数估值

"查询沪深300、中证红利"

search_indices

搜索指数(支持名称/代码)

"搜索中证银行"

filter_by_valuation

按估值状态筛选指数

"找出低估指数"

fetch_latest_data

刷新最新估值数据

"刷新最新估值"

get_index_history

查询单个指数的历史估值数据

"沪深300最近7天的历史数据"

get_trend_analysis

分析指数估值趋势

"分析沪深300的估值趋势"

get_history_summary

获取历史数据概况

"查看历史数据总量"

示例

在 Claude Code 中直接对话:

示例对话 1: 查询单个指数

帮我查询沪深300的估值

示例对话 2: 找出低估指数

列出所有估值偏低的指数

示例对话 3: 批量查询

查询沪深300、中证红利、中证白酒的估值情况

示例对话 4: 搜索指数

帮我找一下中证银行的估值

示例对话 5: 查询历史数据

帮我查询沪深300最近7天的历史估值数据

示例对话 6: 分析估值趋势

分析一下沪深300的估值趋势

🚀 历史估值查询功能

MCP Server 支持查询历史估值数据和分析趋势:

收集历史数据

收集历史数据

# 1. 抓取今日数据(创建 data/history_data.csv)
source .venv/bin/activate
python3 archive/history_data_manager.py

# 2. 查看数据概况
python3 archive/history_data_manager.py --list

# 3. 配置定时任务(每天自动抓取)
# 参考 HISTORY_README.md

💡 提示:历史数据需要每日手动抓取,建议配置定时任务自动收集。

更多详情:HISTORY_README.md

📈 数据来源

  • 数据源: 雪球基金

  • 更新频率: 1小时缓存 + 手动刷新。数据源实际一天更新一次

  • 数据量: 目前包含 63 个指数

  • 包含字段:

    • 指数名称、代码、类型

    • PE、PE百分位、PB、PB百分位

    • 股息率、ROE、预测PEG

    • 估值状态(偏低/适中/偏高)

    指数估值使用说明书

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables querying financial data including stocks, indices, funds, and futures from Chinese, Hong Kong, and US markets. Provides real-time market information, financial indicators, news, and trading suggestions through Eastmoney and Sina data sources.
    6 npm
    3
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to query Chinese A-share stock data, including stock basics, historical prices, financial reports, and macroeconomic indicators.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying real-time stock data for A-shares, Hong Kong, and US markets, including search, price details, and market indices via natural language.
    86 npm
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables querying Chinese A-share and index financial data, including real-time quotes, historical bars, and index snapshots, with built-in fallback for unstable endpoints.
    MIT