Skip to main content

📰 mcp-finance-news

金融资讯 MCP Server — 市场脉搏、个股新闻、北向资金流向、22+垂直领域新闻,一个 Server 全搞定。

合并自 2 个扣子技能:投资要闻追踪 / 新闻资讯。

数据源:TianAPI(22+分类新闻 + 财经要闻)+ Tushare(北向资金,可选)。


🛠 工具列表

工具 功能 典型场景
market_pulse 市场脉搏:财经要闻 + 北向资金 "今天市场有什么消息" "财经要闻"
stock_news 个股动态:按股票代码/名称查新闻 "茅台最近有什么新闻" "600519消息"
fund_flow 资金流向:北向资金近N日净买入 "北向资金最近5天流入多少"
news_query 垂直领域新闻:22+分类精准查询 "AI最近有什么新闻" "科技+财经"

📦 安装

pip install mcp-finance-news

或从源码安装:

git clone https://github.com/yourname/mcp-finance-news.git
cd mcp-finance-news
pip install -e .

⚙️ 配置

必需

TianAPI API 密钥(免费注册即得):

export TIANAPI_KEY="your_api_key_here"

可选

Tushare Pro Token(用于北向资金数据,2000积分起):

export TUSHARE_TOKEN="your_tushare_token_here"

不设置 TUSHARE_TOKEN 时,market_pulse 仍可返回财经要闻(跳过北向资金),fund_flow 会提示需要 Token。

🚀 使用

命令行

# STDIO 模式 (默认)
mcp-finance-news

# 或
python -m mcp_finance_news

MCP 客户端配置

在 Claude Desktop / Cherry Studio / ChatBox 等 MCP 客户端中添加:

{
  "mcpServers": {
    "finance-news": {
      "command": "mcp-finance-news",
      "env": {
        "TIANAPI_KEY": "your_tianapi_key",
        "TUSHARE_TOKEN": "your_tushare_token"
      }
    }
  }
}

开发测试

# 安装 FastMCP CLI
pip install "mcp[cli]"

# 交互式测试
mcp dev src/mcp_finance_news/server.py

💡 工具详细说明

market_pulse — 市场脉搏

# 今日财经要闻
market_pulse()

# 过滤关键词
market_pulse(keyword="降息")

# 指定条数
market_pulse(num=20)

返回:财经新闻列表 + 北向资金最新5日数据(需TUSHARE_TOKEN)

stock_news — 个股新闻

# 按股票代码
stock_news(symbol="600519")

# 按股票名称
stock_news(symbol="比亚迪")

返回:该股票相关新闻列表

fund_flow — 北向资金流向

# 最近5日
fund_flow()

# 最近10日
fund_flow(days=10)

返回:近N个交易日沪股通/深股通/北向/南向资金净买入(百万元),含趋势判断

news_query — 垂直领域新闻

# 单分类
news_query(category="AI")

# 多分类组合
news_query(category="AI,科技,财经")

# 带关键词
news_query(category="财经", keyword="降息")

# 指定条数
news_query(category="体育", num=20)

支持的分类:AI、财经、科技、IT、互联网、游戏、动漫、影视、体育、NBA、足球、CBA、健康、旅游、汽车、环保、军事、科学探索、VR、社会、国内、国际、娱乐、电竞、女性、综合


📋 环境变量

变量 必需 说明
TIANAPI_KEY 天聚数行API密钥,新闻查询必需
TUSHARE_TOKEN Tushare Pro Token,北向资金查询需要(2000积分起)

📄 License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_finance_news-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_finance_news-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_finance_news-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_finance_news-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mcp_finance_news-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d0e4cbf6cd98f75ddd9fb2436ae80f3abc780be74a23e74cd54ecda6b53fc2f8
MD5 5cb97e6cc0a30fee788e4ec6843769ea
BLAKE2b-256 d4801fc34f4d6a5e34cf12931972c8dde589b74033eb2aec3f1806b169332c9e

See more details on using hashes here.

File details

Details for the file mcp_finance_news-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_finance_news-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 519bf62fed8b115c2c48e4e7504aeff94b13fa700fbfc372e10c068c27d23404
MD5 42c75565a62d79ddbe2ecc75dd113c9f
BLAKE2b-256 bccda5b2e92617d41aa21ed39fe85b52e692b3799fd00976700eef0616240dde

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page