返回 MCP 目录
public公开dns本地运行

google-news-trends-mcp

一个从Google新闻和趋势RSS端点获取数据,并可选择通过LLM/NLP处理的MCP服务器项目

article

README

🚀 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
help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端