这是一个从Google新闻和Google趋势RSS端点抓取数据的MCP服务器,可选地使用LLM/NLP进行数据提炼,并输出结构化结果。
当使用uv时,不需要特定的安装。我们将使用uvx直接运行google-news-trends-mcp。
pip install google-news-trends-mcp
安装后,您可以使用以下命令作为脚本运行它:
python -m google_news_trends_mcp
在您的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>
{
"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