Skip to main content
Glama

Google Search MCP Server

2.0 版本来了!!

新闻 - 我的新“KiCAD MCP 服务器”就在这里,与这个“Google 搜索 MCP 服务器”一起,它们是强大的组合!

https://github.com/mixelpixx/KiCAD-MCP-Server

Google 搜索 MCP 服务器

一个 MCP(模型上下文协议)服务器,提供 Google 搜索功能和网页内容分析工具。该服务器使 AI 模型能够以编程方式执行 Google 搜索并分析网页内容。

特征

  • Google 自定义搜索集成
  • 高级搜索功能(过滤、排序、分页、分类)
  • 多种格式的网页内容分析(markdown、HTML、纯文本)
  • 批量网页分析
  • 结果分类和分级
  • 内容摘要
  • 优化的、人性化且易读的响应
  • MCP 兼容接口

先决条件

  • Node.js(v16 或更高版本)
  • Google 云端平台帐户
  • 自定义搜索引擎 ID
  • Google API 密钥

安装

  1. 克隆存储库
  2. 安装 Node.js 依赖项:
npm install
  1. 构建 TypeScript 代码:
npm run build

配置

  1. 为您的 Google API 凭证设置环境变量:

您可以将它们设置为系统环境变量,也可以在 MCP 设置文件中配置它们。

所需的环境变量:

  • GOOGLE_API_KEY :您的 Google API 密钥
  • GOOGLE_SEARCH_ENGINE_ID :您的自定义搜索引擎 ID
  1. 将服务器配置添加到您的 MCP 设置文件(通常位于%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json ):
{ "mcpServers": { "google-search": { "autoApprove": [ "google_search", "extract_webpage_content", "extract_multiple_webpages" ], "disabled": false, "timeout": 60, "command": "node", "args": [ "/path/to/google-search-mcp-server/dist/google-search.js" ], "env": { "GOOGLE_API_KEY": "your-google-api-key", "GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id" }, "transportType": "stdio" } } }

跑步

启动 MCP 服务器:

npm run start

可用工具

在 Google 上搜索并返回相关网页结果。此工具使用 Google 搜索引擎查找特定主题的网页、文章和信息。

{ "name": "google_search", "arguments": { "query": "your search query", "num_results": 5, // optional, default: 5 "site": "example.com", // optional, limit results to specific website "language": "en", // optional, filter by language (ISO 639-1 code) "dateRestrict": "m6", // optional, filter by date (e.g., "m6" for last 6 months) "exactTerms": "exact phrase", // optional, search for exact phrase "resultType": "news", // optional, specify type (news, images, videos) "page": 2, // optional, page number for pagination (starts at 1) "resultsPerPage": 10, // optional, results per page (max: 10) "sort": "date" // optional, sort by "date" or "relevance" (default) } }

响应包括:

  • 搜索结果包含可读格式的标题、链接和摘要
  • 分页信息(当前页、总结果等)
  • 结果类别(自动检测)
  • 分页导航提示

2. 提取网页内容

提取并分析网页内容,将其转换为可读文本。此工具可提取主要内容,同时移除广告、导航元素和其他杂乱内容。

{ "name": "extract_webpage_content", "arguments": { "url": "https://example.com", "format": "markdown" // optional, format options: "markdown" (default), "html", or "text" } }

响应包括:

  • 网页的标题和描述
  • 内容统计(字数、字符数)
  • 内容摘要
  • 内容预览(前 500 个字符)

3. extract_multiple_webpages

通过单个请求提取并分析多个网页内容。非常适合比较不同来源的信息或收集某个主题的综合信息。

{ "name": "extract_multiple_webpages", "arguments": { "urls": [ "https://example1.com", "https://example2.com" ], "format": "html" // optional, format options: "markdown" (default), "html", or "text" } }

响应包括:

  • 每个网页的标题和描述
  • 每个网页的内容统计
  • 每个网页的内容摘要
  • 每个网页的内容预览(前 150 个字符)

获取 Google API 凭证

  1. 前往Google Cloud Console
  2. 创建新项目或选择现有项目
  3. 启用自定义搜索 API
  4. 创建 API 凭证(API 密钥)
  5. 前往自定义搜索引擎页面
  6. 创建新的搜索引擎并获取您的搜索引擎 ID
  7. 将这些凭据添加到您的 MCP 设置文件或将其设置为环境变量

错误处理

服务器提供以下详细的错误消息:

  • API 凭证缺失或无效
  • 失败的搜索请求
  • 网页网址无效
  • 网络连接问题

建筑学

该服务器使用 TypeScript 构建,并使用 MCP SDK 为 AI 模型提供与 Google 搜索和网页内容分析工具交互的标准化接口。它包含两项主要服务:

  1. GoogleSearchService :处理 Google API 交互以实现搜索功能
  2. ContentExtractor :管理网页内容分析和提取

服务器使用缓存机制来提高性能并减少API调用。

分发构建版本

如果您希望仅分发此工具的构建版本而不是源代码,则可以按照以下步骤操作:

  1. 构建 TypeScript 代码:
npm run build
  1. 创建仅包含必要文件的分发包:
# Create a distribution directory mkdir -p dist-package # Copy the compiled JavaScript files cp -r dist dist-package/ # Copy package files (without dev dependencies) cp package.json dist-package/ cp README.md dist-package/ # Create a simplified package.json for distribution node -e "const pkg = require('./package.json'); delete pkg.devDependencies; delete pkg.scripts.build; delete pkg.scripts.dev; pkg.scripts.start = 'node dist/google-search.js'; require('fs').writeFileSync('dist-package/package.json', JSON.stringify(pkg, null, 2));"
  1. 然后用户可以安装并运行构建的版本:
# Install production dependencies only npm install --production # Start the server npm start

这种方法允许您分发已编译的 JavaScript 文件,而无需公开 TypeScript 源代码。用户仍然需要:

  1. 将其 Google API 凭据配置为环境变量
  2. 将服务器配置添加到其 MCP 设置文件中
  3. 安装生产依赖项

请注意,分发中的 package.json 将仅包含生产依赖项和一组简化的脚本。

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

一个 MCP(模型上下文协议)服务器,提供 Google 搜索功能和网页内容分析工具。该服务器使 AI 模型能够以编程方式执行 Google 搜索并分析网页内容。

  1. 新闻 - 我的新“KiCAD MCP 服务器”就在这里,与这个“Google 搜索 MCP 服务器”一起,它们是强大的组合!
    1. Google 搜索 MCP 服务器
      1. 特征
      2. 先决条件
      3. 安装
      4. 配置
      5. 跑步
      6. 可用工具
      7. 获取 Google API 凭证
      8. 错误处理
      9. 建筑学
      10. 分发构建版本
      11. 执照

    Related MCP Servers

    • A
      security
      A
      license
      A
      quality
      A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
      Last updated -
      1
      1,930
      1,674
      TypeScript
      MIT License
      • Apple
    • A
      security
      A
      license
      A
      quality
      A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.
      Last updated -
      2
      26
      Python
      MIT License
      • Apple
    • A
      security
      F
      license
      A
      quality
      Built as a Model Context Protocol (MCP) server that provides advanced web search, content extraction, web crawling, and scraping capabilities using the Firecrawl API.
      Last updated -
      4
      1
      Python
      • Apple
      • Linux
    • A
      security
      F
      license
      A
      quality
      An MCP protocol server that enables web search functionality using the Tavily API, allowing AI assistants to perform internet searches in real-time.
      Last updated -
      4
      2
      Python

    View all related MCP servers

    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/mixelpixx/Google-Search-MCP-Server'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server