Google News Trends Mcp

Google News Trends Mcp

🚀 Google News Trends MCP

这是一个MCP服务器,它可以从Google News和Google Trends的RSS端点获取数据,还能选择使用大语言模型(LLM)或自然语言处理(NLP)对数据进行提炼,最后输出结构化的结果。

✨ 主要特性

  • 依据关键词、地点和主题,从Google News的RSS源中筛选文章。
  • 从Google News获取热门新闻报道。
  • 根据地理输入,从Google Trends获取热门搜索词。
  • 接入LLM/NLP管道,浓缩文章内容并提取关键概念。

📦 安装指南

使用uv/uvx(推荐)

使用 uv 时,无需进行特定安装。我们将使用 uvx 直接运行 google-news-trends-mcp

使用PIP

pip install google-news-trends-mcp

安装完成后,你可以使用以下命令将其作为脚本运行:

python -m google_news_trends_mcp

📚 详细文档

为Claude.app进行配置

在你的Claude设置中添加以下内容:

使用uvx
{
"mcpServers": {
"google-news-trends": {
"command": "uvx",
"args": ["google-news-trends-mcp@latest"]
}
}
}
使用pip安装
{
"mcpServers": {
"google-news-trends": {
"command": "python",
"args": ["-m", "google_news_trends_mcp"]
}
}
}

为VS Code进行配置

使用uvx
{
"mcp": {
"servers": {
"google-news-trends": {
"command": "uvx",
"args": ["google-news-trends-mcp@latest"]
}
}
}
}
使用pip安装
{
"mcp": {
"servers": {
"google-news-trends": {
"command": "python",
"args": ["-m", "google_news_trends_mcp"]
}
}
}
}

可用工具

以下是可用的MCP工具:

工具名称 描述
get_news_by_keyword 使用特定关键词搜索新闻。
get_news_by_location 获取与特定地点相关的新闻。
get_news_by_topic 根据选定的主题获取新闻。
get_top_news 从Google News获取热门新闻报道。
get_trending_keywords 返回指定地点的Google Trends热门关键词。

所有与新闻相关的工具都可以选择使用LLM采样(如果支持)或NLP对文章文本进行总结。

命令行界面(CLI)

所有工具都可以通过 uv 从命令行访问:

uv run google-news-trends
Usage: google-news-trends [OPTIONS] COMMAND [ARGS]...

Find and download news articles using Google News.

Options:
--help  Show this message and exit.

Commands:
keyword   Find articles by keyword using Google News.
location  Find articles by location using Google News.
top       Get top news stories from Google News.
topic     Find articles by topic using Google News.
trending  Returns google trends for a specific geo location.

调试

npx @modelcontextprotocol/inspector uvx google-news-trends-mcp

若要在本地安装的项目中运行:

cd path/to/google/news/tends/mcp
npx @modelcontextprotocol/inspector uv run google-news-trends-mcp

测试

cd path/to/google/news/tends/mcp
python -m pytest
  • 0 关注
  • 0 收藏,17 浏览
  • system 提出于 2025-09-21 04:42

相似服务问题

相关AI产品