Google Search MCP Server

by mixelpixx
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides Google search capabilities to AI models through an MCP server interface, allowing for advanced search queries with filtering options for date, language, country, and safe search

  • Integrates with Google Cloud Platform for API credentials and Custom Search capabilities needed to power the Google search functionality

Cline + VS Code와 함께 사용하도록 제작되었습니다!

Google 검색 MCP 서버

Google 검색 기능과 웹페이지 콘텐츠 분석 도구를 제공하는 MCP(Model Context Protocol) 서버입니다. 이 서버를 통해 AI 모델은 Google 검색을 수행하고 웹페이지 콘텐츠를 프로그래밍 방식으로 분석할 수 있습니다.

특징

  • 필터링 옵션(날짜, 언어, 국가, 안전 검색)을 갖춘 고급 Google 검색
  • 자세한 웹페이지 콘텐츠 추출 및 분석
  • 여러 소스를 비교하기 위한 일괄 웹페이지 분석
  • API 자격 증명에 대한 환경 변수 지원
  • 포괄적인 오류 처리 및 사용자 피드백
  • AI 어시스턴트와의 원활한 통합을 위한 MCP 호환 인터페이스

필수 조건

  • Node.js(v16 이상)
  • Python(v3.8 이상)
  • Google Cloud Platform 계정
  • 사용자 정의 검색 엔진 ID
  • 구글 API 키

설치

  1. 저장소를 복제합니다.지엑스피1
  2. Node.js 종속성을 설치하세요.
    npm install
  3. Python 종속성 설치:
    pip install flask google-api-python-client flask-cors beautifulsoup4 trafilatura markdownify
  4. TypeScript 코드를 작성합니다.
    npm run build
  5. Python 서버를 시작하기 위한 도우미 스크립트를 만듭니다(Windows 예시):
    # Create start-python-servers.cmd @echo off echo Starting Python servers for Google Search MCP... REM Start Python search server start "Google Search API" cmd /k "python google_search.py" REM Start Python link viewer start "Link Viewer" cmd /k "python link_view.py" echo Python servers started. You can close this window.

구성

API 자격 증명

Google API 자격 증명은 두 가지 방법으로 제공할 수 있습니다.

  1. 환경 변수 (권장):
    • 환경에서 GOOGLE_API_KEYGOOGLE_SEARCH_ENGINE_ID 설정하세요.
    • 서버는 자동으로 이 값을 사용합니다.
  2. 구성 파일 :
    • 루트 디렉토리에 api-keys.json 파일을 만듭니다: GXP6

MCP 설정 구성

MCP 설정 파일에 서버 구성을 추가합니다.

Cline(VS 코드 확장)의 경우

파일 위치: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

{ "mcpServers": { "google-search": { "command": "C:\\Program Files\\nodejs\\node.exe", "args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"], "cwd": "C:\\path\\to\\google-search-mcp", "env": { "GOOGLE_API_KEY": "your-google-api-key", "GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id" }, "disabled": false, "autoApprove": [] } } }

Claude 데스크톱 앱용

파일 위치: %APPDATA%\Claude\claude_desktop_config.json

{ "mcpServers": { "google-search": { "command": "C:\\Program Files\\nodejs\\node.exe", "args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"], "cwd": "C:\\path\\to\\google-search-mcp", "env": { "GOOGLE_API_KEY": "your-google-api-key", "GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id" }, "disabled": false, "autoApprove": [] } } }

서버 실행

방법 1: Python 서버를 별도로 시작(권장)

  1. 먼저, 도우미 스크립트를 사용하여 Python 서버를 시작합니다.
    start-python-servers.cmd
  2. Node.js 서버만 실행하도록 MCP 설정을 구성합니다.
    { "command": "C:\\Program Files\\nodejs\\node.exe", "args": ["C:\\path\\to\\google-search-mcp\\dist\\google-search.js"] }

방법 2: 올인원 스크립트

단일 명령으로 TypeScript와 Python 서버를 모두 시작합니다.

npm run start:all

사용 가능한 도구

1. 구글 검색

Google에서 검색하면 웹에서 관련 결과를 보여줍니다. 이 도구는 Google 검색 엔진을 사용하여 특정 주제에 대한 웹 페이지, 기사 및 정보를 찾아줍니다.

{ "name": "google_search", "arguments": { "query": "your search query", "num_results": 5, // optional, default: 5, max: 10 "date_restrict": "w1", // optional, restrict to past day (d1), week (w1), month (m1), year (y1) "language": "en", // optional, ISO 639-1 language code (en, es, fr, de, ja, etc.) "country": "us", // optional, ISO 3166-1 alpha-2 country code (us, uk, ca, au, etc.) "safe_search": "medium" // optional, safe search level: "off", "medium", "high" } }

2. 웹페이지 콘텐츠 추출

웹페이지에서 콘텐츠를 추출하고 분석하여 읽을 수 있는 텍스트로 변환합니다. 이 도구는 광고, 탐색 요소 및 기타 불필요한 요소를 제거하면서 주요 콘텐츠를 가져옵니다.

{ "name": "extract_webpage_content", "arguments": { "url": "https://example.com" } }

3. 여러 웹페이지 추출

한 번의 요청으로 여러 웹페이지의 콘텐츠를 추출하고 분석합니다. 다양한 출처의 정보를 비교하거나 특정 주제에 대한 포괄적인 정보를 수집하는 데 적합합니다.

{ "name": "extract_multiple_webpages", "arguments": { "urls": [ "https://example1.com", "https://example2.com" ] } }

사용 예

다음은 Google 검색 MCP 도구를 사용하는 방법에 대한 몇 가지 예입니다.

기본 검색

Search for information about artificial intelligence

필터를 사용한 고급 검색

Search for recent news about climate change from the past week in Spanish

콘텐츠 추출

Extract the content from https://example.com/article

여러 콘텐츠 비교

Compare information from these websites: - https://site1.com/topic - https://site2.com/topic - https://site3.com/topic

Google API 자격 증명 얻기

  1. Google Cloud Console 로 이동
  2. 새 프로젝트를 만들거나 기존 프로젝트를 선택하세요
  3. 사용자 정의 검색 API 활성화
  4. API 자격 증명(API 키) 생성
  5. 사용자 정의 검색 엔진 페이지로 이동
  6. 새로운 검색 엔진을 만들고 검색 엔진 ID를 얻으세요
  7. 이 자격 증명을 api-keys.json 파일에 추가하세요.

오류 처리

서버는 다음에 대한 자세한 오류 메시지를 제공합니다.

  • API 자격 증명이 누락되었거나 잘못되었습니다.
  • 실패한 검색 요청
  • 잘못된 웹페이지 URL
  • 네트워크 연결 문제

건축학

서버는 두 가지 주요 구성 요소로 구성됩니다.

  1. TypeScript MCP 서버: MCP 프로토콜 통신을 처리하고 도구 인터페이스를 제공합니다.
  2. Python Flask Server: Google API 상호작용 및 웹페이지 콘텐츠 분석을 관리합니다.

특허

MIT

You must be authenticated.

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

Google 검색 기능과 웹페이지 콘텐츠 분석 도구를 제공하는 MCP(Model Context Protocol) 서버입니다. 이 서버를 통해 AI 모델은 Google 검색을 수행하고 웹페이지 콘텐츠를 프로그래밍 방식으로 분석할 수 있습니다.

  1. Google Search MCP Server
    1. Features
    2. Prerequisites
    3. Installation
    4. Configuration
    5. Running the Server
    6. Available Tools
    7. Example Usage
    8. Getting Google API Credentials
    9. Error Handling
    10. Architecture
    11. License
ID: 8m8reyzrcd