Skip to main content
Glama
ChanMeng666

Google News MCP Server

by ChanMeng666

模型上下文协议 (MCP) 服务器实现,通过 SerpAPI 集成提供 Google 新闻搜索功能。自动对新闻结果进行分类,并支持多种语言和地区。

👉立即尝试!👈

https://github.com/user-attachments/assets/1cc71c27-f840-4c94-9ab5-460d84ba4779

屏幕截图 2024-12-30 021446

屏幕截图 2024-12-30 021524

屏幕截图 2024-12-30 021914

屏幕截图 2024-12-30 021941

✨ 特点

🔍 灵活的搜索选项

全面的搜索功能,包括基于查询的搜索、主题搜索、出版物过滤和故事报道。

🌐 全球覆盖

通过可配置的语言和国家代码支持多种语言和地区。

📊 智能分类

自动将新闻结果分类为人工智能与技术、商业、科学与研究和医疗保健等主题。

🔀 多种结果类型

处理各种新闻结果类型,包括标题、故事、相关主题和菜单链接。

🛠️ 强大的错误处理

针对 API 故障和无效输入进行全面的错误处理,并提供有用的错误消息。

🌍 语言支持

对于不支持的语言代码,自动恢复为英语,并发出适当的用户通知。

🔑 SERP API 设置指南

开始之前,您需要获取 SERP API 密钥。具体方法如下:

  1. 访问SERP API 网站并创建帐户

  2. 注册后,转到您的仪表板:

    • 找到“API 密钥”部分

    • 复制您的 API 密钥

    • 新用户可获得 100 次免费 API 调用

  3. API 使用详情:

    • 免费套餐:每月 100 次搜索

    • 付费计划起价为每月 50 美元,可进行 5000 次搜索

    • 根据成功的 API 调用计费

    • 多种付款方式:信用卡、PayPal等。

  4. 使用限制:

    • 请求率:每秒 2 个请求

    • IP限制:无

    • 并发请求:5

    • 响应缓存时间:1小时

👩‍🔧 MCP 服务器与 NVM/NPM 连接问题解决方案

点击查看我的配置解决方案👉https: //github.com/modelcontextprotocol/servers/issues/76

🚀 快速入门

  1. 安装依赖项:

npm install
  1. 构建服务器:

npm run build
  1. 配置环境:使用以下内容修改您的claude_desktop_config.json (根据您的系统调整路径):

    "google-news": {
      "command": "D:\\Program\\nvm\\node.exe",
      "args": [
        "D:\\github_repository\\path_to\\dist\\index.js"
      ],
      "env": {
        "SERP_API_KEY": "your-api-key"
      }
    }
  1. 启动服务器:

npm start

故障排除

  1. API 密钥无效

  • 验证claude_desktop_config.json中的 API 密钥配置

  • 确认 API 密钥在 SERP API 仪表板中处于活动状态

  1. 请求失败

  • 检查网络连接

  • 验证 API 调用配额是否未超出

  • 验证请求参数格式

Related MCP server: Google News13 MCP Server

运行评估

evals 包会加载一个 mcp 客户端,然后运行 index.ts 文件,因此测试之间无需重新构建。您可以通过在 npx 命令前添加前缀来加载环境变量。完整文档可在此处找到。

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

📦安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Google 新闻:

npx -y @smithery/cli install @chanmeng666/google-news-server --client claude

铁匠徽章

通过 mcp-get 安装

npx @michaellatman/mcp-get@latest install @chanmeng666/google-news-server

如果您使用的是旧版本的 Windows PowerShell,则可能需要在执行此命令之前运行Set-ExecutionPolicy Bypass -Scope Process 。

手动安装

@chanmeng666/google新闻服务器

# Using npm
npm i @chanmeng666/google-news-server
# or
npm install @chanmeng666/google-news-server

# Using yarn
yarn add @chanmeng666/google-news-server

# Using pnpm
pnpm add @chanmeng666/google-news-server

💻 技术栈

TypeScriptNodeJS微胶囊钙

📖 API 文档

服务器实现了模型上下文协议,并公开了一个具有以下参数的 Google 新闻搜索工具:

  • q :搜索查询字符串

  • gl :国家代码(例如“us”、“uk”)

  • hl :语言代码(例如,'en'、'es')

  • topic_token :特定新闻主题的令牌

  • publication_token :特定发布者的令牌

  • story_token :用于全面报道故事的令牌

  • section_token :特定部分的令牌

🔧 开发

# Run in development mode with hot reload
npm run dev

# Run linting
npm run lint

# Run tests
npm run test

📝 许可证

该项目已获得 MIT 许可。

🙋‍♀ 作者

由Chan Meng创建并维护。 GitHub LinkedIn

Available Tools

1 tool

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.1
    • First observedgoogle_news_search

TDQS

A3.6/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly stated.

Naming Consistency5/5

Single tool follows a clear and conventional naming pattern; no inconsistencies exist.

Tool Count2/5

A single tool for a news search server is too minimal. Users expect additional functionality such as filtering by category or retrieving article details.

Completeness2/5

The tool only provides search capability, missing essential news operations like reading full articles, date filtering, or topic-specific queries.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    This server allows users to perform web searches using Perplexity AI, providing a tool for retrieving search results through a simple API interface.
    1
    59 npm
    3
    Apache 2.0
  • A
    license
    B
    quality
    D
    maintenance
    Provides 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.
    11
    MIT
  • F
    license
    Not graded
    quality
    F
    maintenance
    MCP server providing access to the GNews API for fetching news articles and headlines. Supports search and top headlines with advanced filtering by language, country, category, and date.
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A server that provides tools to search news articles and fetch top headlines using the GNews API.
    -