sfc-data-mcp

sfc-data-mcp

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.

Category
Visit Server

README

SFC Data Comprehensive MCP Server

南财财经 (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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured