Google Search MCP Server

by moritalous
Apache 2.0

Integrations

  • Manages environment variables for storing Google API credentials and configuration

  • Enables web search capabilities through Google Search API, allowing retrieval of up to 20 search results in JSON format

  • Provides the interface between AI assistants and the Google Search API functionality

Google Search MCP Server

This project is a Model Context Protocol (MCP) server that provides Google Search API functionality to an AI assistant.

overview

The Google Search MCP Server is a tool that allows your AI Assistant to perform web searches using the Google Search API. It uses Gradio and MCP to provide the interface between your AI Assistant and the Google Search API.

function

  • Search the web with the Google Search API
  • Returning search results in JSON format
  • Get up to 20 search results

Prerequisites

  • Python 3.12 or higher
  • Google Custom Search Engine ID
  • Google API Key

install

  1. Clone the repository:
git clone https://github.com/yourusername/google-search-mcp-server.git cd google-search-mcp-server
  1. Install the dependencies:
pip install -e .
  1. Set the environment variables:

Copy the .env.sample file to .env and add the necessary API keys:

cp .env.sample .env

Edit the .env file and set the following values:

GOOGLE_CSE_ID=あなたのGoogleカスタム検索エンジンID GOOGLE_API_KEY=あなたのGoogleAPIキー

How to use

To start the server:

python app.py

This will start the Gradio interface and act as an MCP server.

Integration with MCP

This server is integrated with your AI assistant using the Model Context Protocol (MCP), and allows your AI assistant to access Google search functionality through the server.

API Reference

perform_web_search(query: str, num_results: int = 10)

Parameters :

  • query (str): The search query (max 400 characters, 50 words)
  • num_results (int): Number of results (1-20, default 10).

Returns :

  • str : Search results in JSON format
-
security - not tested
A
license - permissive license
-
quality - not tested

A Model Context Protocol server that enables AI assistants to perform web searches using Google Search API, returning up to 20 search results in JSON format.

  1. overview
    1. function
      1. Prerequisites
        1. install
          1. How to use
            1. Integration with MCP
              1. API Reference
                1. perform_web_search

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.
                Last updated -
                2,806
                • Apple
              • A
                security
                F
                license
                A
                quality
                A Model Context Protocol server that enables AI assistants to perform real-time web searches, retrieving up-to-date information from the internet via a Crawler API.
                Last updated -
                1
                44
                8
                JavaScript
                • Apple
                • Linux
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that provides real-time web search capabilities to AI assistants through pluggable search providers, currently integrated with the Brave Search API.
                Last updated -
                3
                TypeScript
                MIT License
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server implementation that enables AI assistants like Claude to perform Google searches and retrieve web data directly through natural language requests.
                Last updated -
                1
                75
                3
                TypeScript
                MIT License

              View all related MCP servers

              ID: pqwszp1v9d