📰 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
Metadata
Release files for mcp-finance-news 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_finance_news-0.1.1.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_finance_news-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / mcp_finance_news-0.1.1.tar.gz
| Download URL | mcp_finance_news-0.1.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0e4cbf6cd98f75ddd9fb2436ae80f3abc780be74a23e74cd54ecda6b53fc2f8
|
|
BLAKE2b-256 checksum How to use checksums |
d4801fc34f4d6a5e34cf12931972c8dde589b74033eb2aec3f1806b169332c9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / mcp_finance_news-0.1.1-py3-none-any.whl
| Download URL | mcp_finance_news-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
519bf62fed8b115c2c48e4e7504aeff94b13fa700fbfc372e10c068c27d23404
|
|
BLAKE2b-256 checksum How to use checksums |
bccda5b2e92617d41aa21ed39fe85b52e692b3799fd00976700eef0616240dde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for mcp-finance-news 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.