MCP HubMCP Hub
Richard-Weiss

mcp-google-cse

by: Richard-Weiss

A Model Context Protocol server that provides search capabilities using a Google CSE (custom search engine).

15created 19/01/2025
Visit
search
CSE

📌Overview

Purpose: To provide a server that utilizes a Google Custom Search Engine (CSE) for enabling searches through a Model Context Protocol (MCP) framework.

Overview: The Google Custom Search Engine MCP Server functions as a bridge for large language models (LLMs) to access search engine results by inputting specific search terms. This server only returns the search results, necessitating integration with other tools for content extraction to facilitate deeper search capabilities.

Key Features:

  • Google Search Tool (google_search): This tool enables users to execute searches via the custom search engine. It returns a comprehensive list of results including titles, links, and snippets for each result, allowing for efficient retrieval of information without fetching the content itself.

  • Configurable Environment Variables: Users can set various environment variables like API_KEY, ENGINE_ID, and other optional parameters to enhance search specificity, such as restricting results by country or language, offering flexibility and control for different use cases.


Google Custom Search Engine MCP Server

A Model Context Protocol (MCP) server that provides search capabilities using a Google Custom Search Engine (CSE). This server enables LLMs to submit a regular Google search term and returns the found search results.

The tool returns only the search results (title, link, snippet) and not the actual content. It should be combined with other servers like mcp-server-fetch to extract content from the search results. It can also be used in combination with other tools to enable "deep search" or tool chaining.

Free quota: 100 searches per day (1 tool call = 1 search). If you need more without setting up billing, consider using another server.

Available Tools

  • google_search
    Searches the custom search engine using a search term and returns a list of results containing the title, link, and snippet of each result.
    • search_term (string, required): The search term to search, equivalent to the q query parameter in Google search.

Environment Variables

  • API_KEY (required): API key for the custom search engine.
  • ENGINE_ID (required): Engine ID for the custom search engine.
  • SERVICE_NAME (optional): Name of the service, leave empty if not changed (default: customsearch).
  • COUNTRY_REGION (optional): Restricts search results to a particular country. See Country Parameter Values for valid values.
  • GEOLOCATION (optional, default "us"): Geolocation of the end-user performing the search. See Geolocation Parameter Values.
  • RESULT_LANGUAGE (optional, default "lang_en"): Language of the search results. See CSE Query Parameters.
  • RESULT_NUM (optional, default 10): Number of search results to return (1-10).

CSE Setup

Creating a custom search engine is free and can be done in under 5 minutes:

  1. Go to https://console.cloud.google.com/ and create a new project.
  2. Search for "Custom Search API" and enable it.
  3. Create a new API key under Credentials.
  4. Visit https://programmablesearchengine.google.com and create a new custom search engine.
  5. Give it a name (does not affect SERVICE_NAME).
  6. Select "Search the entire web" for normal Google Search experience.
  7. Create the engine and copy the engine ID from the JS code or overview.
  8. Optionally customize the search engine.

With the default quota, you get 100 free searches per day. A tool call costs 1 search regardless of the number of results.

Installation

Using uv (recommended)

No specific installation needed. Use uvx to run mcp-google-cse directly.

Using PIP

Install via pip:

pip install mcp-google-cse

Run as a script:

python -m mcp-google-cse

Installing via Smithery

Install automatically via Smithery:

npx -y @smithery/cli install @Richard-Weiss/mcp-google-cse --client claude

Configuration

Configure for Claude app

Add the following to your claude_desktop_config.json:

Using uvx (recommended if unsure)

"mcp-google-cse": {
    "command": "uvx",
    "args": ["mcp-google-cse"],
    "env": {
        "API_KEY": "",
        "ENGINE_ID": ""
    }
}

Using pip installation

"mcp-google-cse": {
    "command": "python",
    "args": ["-m", "mcp-google-cse"],
    "env": {
        "API_KEY": "",
        "ENGINE_ID": ""
    }
}

Running locally (from cloned repo)

"mcp-google-cse": {
  "command": "uv",
  "args": [
    "--directory",
    "{{Path to the cloned repo}}",
    "run",
    "mcp-google-cse"
  ],
  "env": {
    "API_KEY": "",
    "ENGINE_ID": ""
  }
}

Example Result

Using the tool:

google_search("What is MCP after:2024-11-01")

Example response:

[
    {
        "title": "Can someone explain MCP to me? How are you using it? And what ...",
        "link": "https://www.reddit.com/r/ClaudeAI/comments/1h55zxd/can_someone_explain_mcp_to_me_how_are_you_using/",
        "snippet": "Dec 2, 2024 ... MCP essentially allows you to give Claude access to various external systems. This can be files on your computer, an API, a browser, a ..."
    },
    {
        "title": "Introducing the Model Context Protocol \\ Anthropic",
        "link": "https://www.anthropic.com/news/model-context-protocol",
        "snippet": "Nov 25, 2024 ... The Model Context Protocol (MCP) is an open standard for connecting AI assistants to the systems where data lives, including content repositories, ..."
    },
    {
        "title": "3.5 Sonnet + MCP + Aider = Complete Game Changer : r ...",
        "link": "https://www.reddit.com/r/ChatGPTCoding/comments/1hwn6qd/35_sonnet_mcp_aider_complete_game_changer/",
        "snippet": "Jan 8, 2025 ... Really cool stuff. For those out of the loop here are some MCP servers. You can give your Claude chat (in the desktop version, or in a tool like Cline) ..."
    },
    {
        "title": "Announcing Spring AI MCP: A Java SDK for the Model Context ...",
        "link": "https://spring.io/blog/2024/12/11/spring-ai-mcp-announcement",
        "snippet": "Dec 11, 2024 ... This SDK will enable Java developers to easily connect with an expanding array of AI models and tools while maintaining consistent, reliable integration ..."
    },
    {
        "title": "Implementing a MCP server in Quarkus - Quarkus",
        "link": "https://quarkus.io/blog/mcp-server/",
        "snippet": "6 days ago ... The Model Context Protocol (MCP) is an emerging standard that enables AI models to safely interact with external tools and resources. In this tutorial, I'll ..."
    },
    {
        "title": "mark3labs/mcp-go: A Go implementation of the Model ... - GitHub",
        "link": "https://github.com/mark3labs/mcp-go",
        "snippet": "Dec 18, 2024 ... A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools."
    },
    {
        "title": "MCP enables Claude to Build, Run and Test Web Apps by Looking ...",
        "link": "https://wonderwhy-er.medium.com/mcp-enable-claude-to-build-run-and-test-web-apps-using-screenshots-3ae06aea6c4a",
        "snippet": "Dec 18, 2024 ... How to Replicate My Experiment on Your Machine. If you're ready to dive into setting up MCP for Claude, follow these steps: ... 2. Download the Project: ... 3."
    },
    {
        "title": "MCP definition and meaning | Collins English Dictionary",
        "link": "https://www.collinsdictionary.com/dictionary/english/mcp",
        "snippet": "2 days ago ... 2 meanings: male chauvinist pig → informal, derogatory a man who exhibits male chauvinism Abbreviation: MCP.... Click for more definitions."
    },
    {
        "title": "What is Anthropic's New MCP Standard and How Can It Improve ...",
        "link": "https://dappier.medium.com/what-is-anthropics-new-mcp-standard-and-how-can-it-improve-your-ai-agent-be6f6c72eb6a",
        "snippet": "Nov 26, 2024 ... Anthropic has released a new protocol, MCP, for connecting AI agents to data sets. This blog explores when and why developers might use MCP to improve their ..."
    },
    {
        "title": "Mostafa Gharib on LinkedIn: What is MCP and how it works",
        "link": "https://www.linkedin.com/posts/mostafa-gharib_what-is-mcp-and-how-it-works-activity-7274301560594026497-p_yq",
        "snippet": "Dec 15, 2024 ... MCP Host can use. (Bonus: SDKs in Python and TypeScript make it easy to build these servers!) 2️⃣ MCP Clients These interact with MCP Servers via the protocol."
    }
]