Skip to main content

金融资讯 MCP Server — 市场脉搏/个股新闻/资金流向/22+垂直领域新闻, 数据源TianAPI+Tushare

Project description

📰 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

Project details


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.0.tar.gz (8.2 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.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_finance_news-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 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.0.tar.gz
Algorithm Hash digest
SHA256 132f05daaeb75196c34b334cb27ce9287ec0b822c5d79c8b9b40f6f32298d257
MD5 88922d00f74780f93dc1afbd0cc4210f
BLAKE2b-256 a60e2e04aaa3346257555f7eff95e3dd3d29eb5caf0eea023596218fadc680c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_finance_news-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e4f9d6b779f7d3d730fbc7af5cee07f0aba493800f7721857013df76117f321
MD5 6de84867c8847182788c6ff620aff798
BLAKE2b-256 72523f346d0da65195a00460dbd563c77ce9a1f3d2b269af4898cfede4560f6f

See more details on using hashes here.

Supported by

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