返回市场
谷歌新闻趋势分析

谷歌新闻趋势分析

作者:jmanek61 星标更新:2025-08-01

项目介绍

Google News Trends MCP

这是一个从Google新闻和Google趋势RSS端点抓取数据的MCP服务器,可选地使用LLM/NLP进行数据提炼,并输出结构化结果。

功能

  • 根据关键词、地点或主题抓取Google新闻RSS源中的文章
  • 获取来自Google新闻的头条新闻
  • 根据地理输入获取Google趋势中的热门搜索词
  • 插入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设置中添加:

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

配置VS Code

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

工具

以下MCP工具可用:

工具名称描述
get_news_by_keyword使用特定关键词搜索新闻。
get_news_by_location获取与特定地点相关的新闻。
get_news_by_topic根据选定的主题获取新闻。
get_top_news从Google新闻获取头条新闻故事。
get_trending_keywords返回指定位置的Google趋势中的热门关键词。

所有与新闻相关的工具都有一个选项,可以使用LLM采样(如果支持)或NLP来总结文章文本。

命令行接口

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

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

  使用Google新闻查找并下载新闻文章。

选项:
  --help  显示此消息并退出。

命令:
  keyword   使用Google新闻按关键词查找文章。
  location  使用Google新闻按地点查找文章。
  top       从Google新闻获取头条新闻故事。
  topic     使用Google新闻按主题查找文章。
  trending  返回特定地理位置的Google趋势。

调试

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