Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Sfc Data

FreeNot checked

MCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, new

GitHubEmbed

About

MCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, news, themes, financials, charts, research reports, and watchlists.

README

南财财经 (SFC) 金融数据终端 MCP 服务,将 SFC 金融数据 API 封装为 MCP 工具,提供 A 股全面的数据查询能力。

功能模块

模块 工具数量 功能说明
📊 实时行情 3 股票报价、分时数据、K线数据
🏆 排行榜 4 个股/ETF/基金/板块涨幅榜、跌幅榜
🚀 涨停统计 4 连板情况、涨停列表、大涨主题、大涨股票
📰 资讯快讯 5 最新文章、7*24快讯、股票资讯、公司公告、搜索资讯
🏷️ 主题概念 7 主题列表、详情、成分股、产业链、主题基金、搜索、推荐
🌍 宏观经济 1 GDP、CPI、PPI、PMI 等宏观数据
💰 财务数据 4 资产负债表、利润表、现金流量表、财务指标
💸 资金流向 1 个股主力资金、散户资金流向
🔍 深度分析 1 个股综合分析(行情+财务+资金+资讯)
🖼️ 行情图片 1 市场指数图、涨跌分布、板块排行、分时图、K线图
📑 研报查询 1 券商研究报告
⭐ 自选股 1 自选股分组及行情

共计 32 个 MCP 工具

快速开始

1. 安装依赖

pip install -r requirements.txt

2. 配置 Token

复制 .env.example.env,填入你的 SFC Token:

cp .env.example .env

或者设置环境变量:

# Linux/macOS
export SFC_TOKEN=your-token-here

# Windows PowerShell
$env:SFC_TOKEN = "your-token-here"

3. 运行服务

python server.py

MCP 服务配置

在 MCP 客户端配置文件中添加:

{
  "mcpServers": {
    "sfc-data": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "/path/to/sfc-data-mcp",
      "env": {
        "SFC_TOKEN": "your-token-here"
      }
    }
  }
}

工具列表

1. 实时行情

工具名 说明 参数
get_realtime_quote 获取A股股票实时行情 code (股票代码)
get_minute_data 获取股票分时数据 code, date (可选)
get_kline_data 获取股票K线数据 code, period (可选), count (可选)

2. 排行榜

工具名 说明 参数
get_stock_ranking 获取个股排行榜 rank_type (gain/loss/volume/amount), count
get_etf_ranking 获取ETF排行榜 rank_type, count
get_fund_ranking 获取基金排行榜 rank_type, count
get_sector_ranking 获取板块排行榜 sector_type (industry/concept)

3. 涨停统计

工具名 说明 参数
get_limit_up_count 获取涨停统计(连板情况) date (可选)
get_limit_up_list 获取涨停股票列表 date, flag, page, size
get_limit_surge_themes 获取大涨主题库 date (可选)
get_limit_surge_stocks 获取主题大涨股票 theme_id, date, is_limit_up

4. 资讯快讯

工具名 说明 参数
get_recent_news 获取最新文章 count
get_flash_news 获取7*24快讯 keyword (可选), count
get_stock_news 获取股票资讯 code, count
get_company_notice 获取公司公告 code, count
search_news 搜索资讯 keyword, count

5. 主题概念

工具名 说明 参数
get_theme_list 获取主题列表 page, size
get_theme_detail 获取主题详情 theme_idtheme_name
get_theme_stocks 获取主题成分股 theme_id, page, size
get_theme_industry_chain 获取主题产业链 theme_id
get_theme_funds 获取主题基金 theme_id, page, size
search_theme 搜索主题 keyword, size
get_recommended_themes 获取推荐主题 theme_type (2/3/4), size

6. 宏观经济

工具名 说明 参数
get_macro_data 获取宏观经济数据 indicator_code (可选), category (可选)

7. 财务数据

工具名 说明 参数
get_balance_sheet 获取资产负债表 code, count
get_income_statement 获取利润表 code, count
get_cash_flow 获取现金流量表 code, count
get_financial_indicators 获取主要财务指标 code

8. 资金流向

工具名 说明 参数
get_capital_flow 获取个股资金流向 code, count

9. 深度分析

工具名 说明 参数
get_stock_analysis 获取个股综合分析 code

10. 行情图片

工具名 说明 参数
generate_chart 生成行情图片 widget_type, code, chart_type, period

widget_type 说明

  • 1: 市场指数图
  • 2: 市场涨跌分布图
  • 3: 板块涨跌幅榜图
  • 4: 股票分时图
  • 5: K线图
  • 6: 当日涨幅榜图
  • 7: 全球指数图

11. 研报查询

工具名 说明 参数
get_research_reports 获取研究报告 keyword (可选), count

12. 自选股

工具名 说明 参数
get_watchlist_groups 获取自选股分组

使用示例

查询实时行情

{
  "name": "get_realtime_quote",
  "arguments": {
    "code": "300724"
  }
}

查询涨停统计

{
  "name": "get_limit_up_count",
  "arguments": {}
}

查询大涨主题

{
  "name": "get_limit_surge_themes",
  "arguments": {}
}

查询主题成分股

{
  "name": "get_theme_stocks",
  "arguments": {
    "theme_id": "11060009"
  }
}

查询财务指标

{
  "name": "get_financial_indicators",
  "arguments": {
    "code": "300724"
  }
}

生成K线图

{
  "name": "generate_chart",
  "arguments": {
    "widget_type": 5,
    "code": "300724"
  }
}

Docker 部署

# 构建镜像
docker build -t sfc-data-mcp .

# 运行容器
docker run -d \
  --name sfc-data-mcp \
  -e SFC_TOKEN=your-token-here \
  sfc-data-mcp

获取 API Token

  1. 访问 https://www.sfconnect.cn
  2. 注册账号并登录
  3. 在个人中心获取 API Token
  4. 将 Token 配置到环境变量或 .env 文件

技术栈

  • Python 3.11+
  • MCP (Model Context Protocol)
  • httpx (HTTP 客户端)
  • python-dotenv (环境变量管理)

数据来源

所有数据来源于南方财经 (SFC) 金融数据终端。

南方财经(南方财经全媒体集团)是经中央批准的全国首家全媒体集团,由南方报业传媒集团和广东广播电视台联合发起成立。

License

MIT

from github.com/yangxinagfeng123/sfc-data-mcp

Installing Sfc Data

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/yangxinagfeng123/sfc-data-mcp

FAQ

Is Sfc Data MCP free?

Yes, Sfc Data MCP is free — one-click install via Unyly at no cost.

Does Sfc Data need an API key?

No, Sfc Data runs without API keys or environment variables.

Is Sfc Data hosted or self-hosted?

A hosted option is available: Unyly runs the server in the cloud, no local setup required.

How do I install Sfc Data in Claude Desktop, Claude Code or Cursor?

Open Sfc Data on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Sfc Data with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs