新闻获取MCP工具
这是一个基于Model Context Protocol (MCP)的新闻获取工具,它可以与支持MCP的AI助手(如Claude for Desktop)集成,为AI提供获取当前新闻的能力。
功能特点
- 从多个新闻源获取最新新闻
- 支持多种新闻类别:中国、全球、科技、财经
- 自动提取文章完整内容
- 与支持MCP的AI助手无缝集成
安装方式
方式1: 通过uvx直接从仓库运行(推荐)
- 确保已安装 uv 包管理工具
- 使用 uvx 直接运行:
# 从 GitHub 仓库运行
uvx --from git+https://github.com/Zmingfeng/news_mcp.git news-mcp --transport stdio
方式2: 本地安装
- 确保安装了Python 3.10或更高版本
- 克隆或下载此项目到本地
- 安装项目:
# 安装开发模式
pip install -e .
# 运行
news-mcp --transport stdio
与Claude for Desktop集成
- 确保你已安装最新版本的Claude for Desktop
- 打开Claude for Desktop的配置文件
- 添加以下配置:
{
"mcpServers": {
"news_summarizer": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/Zmingfeng/news_mcp.git",
"news-mcp",
"--transport",
"stdio"
]
}
}
}
或者使用本地安装方式:
{
"mcpServers": {
"news_summarizer": {
"command": "news-mcp",
"args": ["--transport", "stdio"]
}
}
}
可用工具
-
get_latest_news - 获取指定类别的最新新闻完整内容
- 参数:
- category (默认:"中国"):新闻类别,可选值:中国、全球、科技、财经
- count (默认:5):要返回的新闻数量
- 参数:
-
get_news_titles - 仅获取指定类别的最新新闻标题列表
- 参数:
- category (默认:"中国"):新闻类别,可选值:中国、全球、科技、财经
- count (默认:10):要返回的新闻标题数量
- 参数:
如何触发工具
在与Claude for Desktop对话时,使用以下词条可能会触发工具:
- "今天有什么新闻?"
- "最新的科技新闻是什么?"
- "有什么重要的全球新闻?"
注意事项
- 该工具依赖于各新闻网站的HTML结构,如果网站更改布局,可能需要更新爬取逻辑
- 请合理使用,避免频繁请求导致被新闻网站封禁
Recommend MCP Servers 💡
axiom-mcp
A Model Context Protocol server implementation for Axiom that enables AI agents to query your data using Axiom Processing Language (APL). Note: This repository is deprecated and no longer maintained. Please use the official Axiom MCP Server at https://mcp.axiom.co instead.
vision-tools-mcp
VisionAgent MCP is a lightweight, side-car MCP server that runs locally on STDIN/STDOUT, translating tool calls from an MCP-compatible client into authenticated HTTPS requests to Landing AI’s VisionAgent REST APIs for computer vision and document analysis.
voice-mode
Natural voice conversations with Claude Code
devrev-mcp
A Model Context Protocol server for DevRev, providing comprehensive access to DevRev's APIs for managing work items, parts, meetings, workflows, and search across DevRev data.
awslabs.core-mcp-server
A core MCP server by awslabs that provides planning and orchestration capabilities, including prompt understanding and translation to AWS services, and serves as a starting point for other awslabs MCP servers.
gin-mcp
Enable MCP features for any Gin API with a line of code