Google News MCP
Google News MCP
一个 模型上下文协议 (MCP) 服务器,将 Google News RSS 源 作为 MCP 工具公开,允许 AI 助手(Claude、GPT-4 等)通过自动 URL 解码、并发处理和智能缓存访问实时新闻数据。
主要功能
异步与并发 - 所有操作均异步运行,并进行并发 URL 解码,以实现最高性能 智能缓存 - 具有 LRU 缓存(1024 条目),可快速重复进行 URL 解码 批量 URL 解码 - 并行解码多个 Google News URL 简洁摘要 - 从 HTML 摘要中提取纯文本,并附带已解码的文章链接 面向标记的对象表示法 (TOON) - 支持紧凑、节省标记的响应格式(减少 30-60%) 多语言支持 - 可配置任何语言/国家组合 高级搜索 - 完全支持 Google News 搜索运算符(site:、when:、intitle: 等) 页面提取 - 使用 Jina Reader 和 Groq 获取并总结全文内容
工具概览
工具 | 用途 | 参数 |
| 按国家/地区获取最新头条 |
|
| 按类别获取新闻 (TECH, BUSINESS 等) |
|
| 使用高级运算符搜索新闻 |
|
| 特定地点的新闻 |
|
| 按 ID 获取热门话题 |
|
| 解码 Google News URL |
|
| 可用的新闻类别 | (无) |
| 获取并总结页面内容 |
|
总计:8 个工具
Related MCP server: OmniWire-MCP
快速入门
安装
选项 1:使用 uv (推荐)
# Clone the repository
git clone https://github.com/moltrus/google-news-mcp.git
cd google-news-mcp
# Install with uv
uv sync选项 2:使用 pip 和虚拟环境
# Clone the repository
git clone https://github.com/moltrus/google-news-mcp.git
cd google-news-mcp
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e .全局使用(任何方法)
要在任何地方全局使用 google-news-mcp 命令:
pip install -e .这将把命令行入口点安装到系统范围内,允许您从任何目录运行 google-news-mcp。
配置
根据 .env.example 创建一个 .env 文件:
# RSS Preferences
GOOGLE_NEWS_LANGUAGE=en
GOOGLE_NEWS_COUNTRY=US
# Response Optimization
# Options: "json" (standard) or "toon" (token-optimized)
RESPONSE_FORMAT=json
# Fetching & Summarization
JINA_API_KEY=your_jina_key
GROQ_API_KEY=your_groq_key
GROQ_MODEL=qwen/qwen3-32b运行服务器
google-news-mcp或直接运行:
python -m google_news_mcp.server工具文档
get_top_headlines
获取某个国家的最新头条新闻。
参数:
language(字符串,可选):语言代码(例如'en','fr','es')。默认为GOOGLE_NEWS_LANGUAGE环境变量。country(字符串,可选):国家代码(例如'US','GB','JP')。默认为GOOGLE_NEWS_COUNTRY环境变量。
返回:
{
"title": "Google News",
"link": "https://news.google.com",
"description": "Latest news",
"entries": [
{
"title": "Article Title",
"link": "https://source.com/article",
"published": "2026-03-31T10:00:00Z",
"summary": "Article Title (https://source.com/article)\nAnother Article (https://another.com/news)",
"source": "Source Name"
}
]
}注意:
文章按相关性排序(Google News 默认)
URL 会自动从 Google News 重定向中解码
摘要包含纯文本格式的提取链接
get_category_feed
获取特定类别的新闻头条。
参数:
category(字符串,必需):新闻类别。有效值:WORLD- 国际新闻NATION- 国内/本地头条BUSINESS- 商业与金融TECHNOLOGY- 科技与 AIENTERTAINMENT- 娱乐与流行文化SPORTS- 体育SCIENCE- 科学与研究HEALTH- 健康与医学
language(字符串,可选):语言代码。默认为配置值。country(字符串,可选):国家代码。默认为配置值。
返回: 同 get_top_headlines
示例:
get_category_feed(category="TECHNOLOGY")
get_category_feed(category="BUSINESS", country="UK")get_search_feed
使用关键字查询和高级运算符搜索 Google News。
参数:
query(字符串,必需):带有可选运算符的搜索查询language(字符串,可选):语言代码。默认为配置值。country(字符串,可选):国家代码。默认为配置值。
支持的搜索运算符:
精确短语:
"Artificial Intelligence"(必须完全匹配)排除项:
-apple(排除包含 "apple" 的文章)特定站点:
site:techcrunch.com(仅来自该域名)时间范围(相对):
when:1h,when:24h,when:7d,when:30d,when:1y,when:1m时间范围(绝对):
after:2026-01-01,before:2026-03-31标题搜索:
intitle:merger(术语仅出现在标题中)布尔 OR:
Tesla OR SpaceX(任一术语)组合:
"GPT-4" site:openai.com when:7d(组合使用)
返回: 同 get_top_headlines(最多约 100 篇文章)
查询示例:
"OpenAI Sora" # Exact phrase
AI -hype # Include AI, exclude hype
site:arxiv.org quantum computing # From academic site
when:1h breaking # Last hour
when:24h -rumor Bitcoin # Last 24h, exclude rumors
after:2026-03-01 before:2026-03-31 merger # Date range
intitle:IPO tech companies # IPO in headline
SpaceX OR Blue Origin # Either company OR other重要: 日期过滤器按 天 计算(非小时/分钟精度)。
get_geo_feed
获取特定地理位置的新闻。
参数:
location(字符串,必需):城市、州、地区或国家(例如'San Francisco','California','Japan')language(字符串,可选):语言代码。默认为配置值。country(字符串,可选):国家代码。默认为配置值。
返回: 同 get_top_headlines
示例:
get_geo_feed(location="New York")
get_geo_feed(location="London", language="en")
get_geo_feed(location="Tokyo", country="JP")fetch_content
使用 Jina Reader API 从 URL 获取干净的页面内容,并可通过 Groq 进行可选的总结。
参数:
url(字符串,必需):要获取的绝对 URL(必须以 http:// 或 https:// 开头)summarize(布尔值,可选):如果为true,则通过 Groq 返回简洁摘要,并省略完整的原始内容以节省标记。默认为false。
返回:
{
"url": "https://example.com/article",
"reader_url": "https://r.jina.ai/https://example.com/article",
"content": "Full article text...",
"summary": "Concise summary points...",
"summary_model": "qwen/qwen3-32b",
"summary_error": "Error message if summarization fails"
}注意:
标记效率: 当
summarize为true时,响应中会自动删除content字段,以防止上下文窗口过大。环境变量:
JINA_API_KEY:内容提取必需。GROQ_API_KEY:总结必需。GROQ_MODEL:可选。要使用的特定模型(默认为qwen/qwen3-32b)。
decode_google_news_url
并行解码多个 Google News URL 到其实际文章目标地址。
参数:
urls(字符串列表,必需):要解码的 Google News 重定向 URL 数组
返回:
{
"decoded_urls": [
{
"original_url": "https://news.google.com/articles/CBMi8wFAUU...",
"decoded_url": "https://techcrunch.com/2026/03/31/ai-news"
},
{
"original_url": "https://news.google.com/articles/CBMixAFAUU...",
"decoded_url": "https://theverge.com/2026/3/31/10987654"
}
]
}性能:
所有 URL 并发解码(无顺序延迟)
结果缓存以供重复查找(缓存命中时即时返回)
具有 1024 条目限制的 LRU 缓存
示例:
decode_google_news_url(urls=[
"https://news.google.com/articles/CBMi8wFAUU...",
"https://news.google.com/articles/CBMixAFAUU...",
"https://news.google.com/articles/CBMi5gFAUU..."
])get_topic_feed
按主题 ID 获取特定热门话题的新闻。
Google News 将热门话题跟踪为哈希值(例如公司、事件、重复出现的主题)。
参数:
topic_id(字符串,必需):Google News 主题哈希标识符language(字符串,可选):语言代码。默认为配置值。country(字符串,可选):国家代码。默认为配置值。
返回: 同 get_top_headlines
常见主题 ID:
CAAqKAgKIiJDQkFTRXdvS0wyMHZNSFp3YWpSZlloSUZaVzR0UjBJb0FBUAE- 加密货币通过浏览 Google News 并检查 URL 中的主题参数来查找更多信息
示例:
get_topic_feed(topic_id="CAAqKAgKIiJDQkFTRXdvS0wyMHZNSFp3YWpSZlloSUZaVzR0UjBJb0FBUAE")list_categories
获取可用新闻类别的列表。
参数: 无
返回:
{
"categories": [
"WORLD",
"NATION",
"BUSINESS",
"TECHNOLOGY",
"ENTERTAINMENT",
"SPORTS",
"SCIENCE",
"HEALTH"
]
}架构
性能优化
Async/Await - 所有 I/O 操作(HTTP、解码)均为非阻塞
并发处理 - 通过
asyncio.gather()并行处理多个 URL 和条目LRU 缓存 (1024 条目) - 在函数级别缓存已解码的 URL
内存字典缓存 - 为已解码 URL 提供额外的快速查找缓存
批量操作 -
decode_google_news_url并发处理 URL 列表
摘要格式
文章摘要从 HTML 中提取,并以 纯文本 形式返回,附带已解码的链接:
Article Title 1 (https://original-source.com/article1)
Image caption link (https://image-source.com/photo)
Article Title 2 (https://original-source.com/article2)HTML 标签、CDATA 包装器和实体被剥离,以获得干净、可读的文本。
使用示例
1. 获取过去一小时的突发新闻
get_search_feed(query="when:1h breaking", country="US")2. 一次解码多个文章 URL
decode_google_news_url(urls=[
"https://news.google.com/articles/CBMi8wFAUU...",
"https://news.google.com/articles/CBMixAFAUU..."
])3. 来自特定来源的科技新闻
get_search_feed(query="site:techcrunch.com AI")4. 城市本地新闻
get_geo_feed(location="San Francisco")5. 按日期范围搜索
get_search_feed(query="SpaceX after:2026-03-01 before:2026-03-31")6. 获取健康新闻
get_category_feed(category="HEALTH")7. 热门加密货币新闻
get_topic_feed(topic_id="CAAqJggKIiBDQkFTRWdvSUwyMHZNR3d5YldFeVpYVXVhVzV6U0FpQkFQAQ")8. 获取并总结全文文章
fetch_content(url="https://techcrunch.com/article-url", summarize=true)标记效率与 TOON
此服务器支持 面向标记的对象表示法 (TOON),这是一种专为 LLM 设计的紧凑数据格式。
为什么要使用 TOON?
由于重复的键和标点符号,标准 JSON 对 LLM 来说可能过于冗长。TOON 通过以下方式减少了 30-60% 的标记使用量:
为对象数组定义一次键(表格格式)。
删除不必要的大括号、方括号和引号。
使用缩进和简单的分隔符。
配置
要在全局范围内为所有工具响应启用 TOON,请在您的 .env 中设置以下内容:
RESPONSE_FORMAT=toon对比
JSON (冗长) | TOON (紧凑) |
|
|
限制
结果限制: Google News RSS 每次请求最多返回约 100 篇文章
排序: 默认为相关性。使用
when:过滤器进行时间排序日期精度: 过滤器按 天 计算,而非小时/分钟
速率限制: RSS 不需要 API 密钥,但 Jina Reader 和 Groq 有其自身的限制/配额
内容提取:
fetch_content取决于 Jina Reader 解析目标站点的能力主题 ID: 必须从 Google News URL 中发现;没有查找 API
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides tools to search and retrieve news across various categories including business, technology, science, and sports via the Google News API. It supports keyword searches, autocomplete suggestions, and region-specific news across multiple languages.11MIT
- AlicenseCqualityCmaintenanceEnables AI models to fetch and aggregate news from RSS, Atom, JSON, and HTML feeds with fault-tolerant circuit breaker protection.4196MIT
- FlicenseNot gradedqualityCmaintenanceProvides access to the latest AI trends by querying Google News RSS and Hacker News API, enabling AI assistants to retrieve real-time trending topics.
- AlicenseAqualityDmaintenanceEnables AI agents to fetch and search news from multiple sources including RSS/Atom feeds, HackerNews, and GDELT global news intelligence without requiring an API key.113MIT
Related MCP Connectors
Real-time financial news for AI agents: search by ticker and source, with sentiment and entities.
Real-time corroborated news events + 5-year archive, for agents. Free tier, no key.
Web search, news, page retrieval, sitemaps, and trending topics through Search1API.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moltrus/google-news-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server