Google Custom Search Engine MCP Server
Google Custom Search Engine MCP Server
A Model Context Protocol server that provides search capabilities using a CSE (custom search engine). This server enables LLMs to provide a regular google search term and returns the found search results.
The tool only returns the results itself and not the content, the tool should be combined with other servers like mcp-server-fetch to extract the content from the search results. You may also combine it with other tools to enable some kind of "deep search" or tool chaining in general.
The free quota is 100 searches (1 tool call == 1 search) per day, if you don't want to set up billing and this is insufficient for your use case, you should consider using another server.
<a href="https://glama.ai/mcp/servers/mieczol4lv"><img width="380" height="200" src="https://glama.ai/mcp/servers/mieczol4lv/badge" alt="Google Custom Search Engine Server MCP server" /></a>
Available Tools
google_search
- Searches the custom search engine using the 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 for, equaling the query parameterq
in the usual Google search.
Environment variables
API_KEY
(required): The API key for the custom search engine.ENGINE_ID
(required): The engine ID for the custom search engine.SERVICE_NAME
(required/optional): The name of the service, leave empty if you haven't changed the name (customsearch).COUNTRY_REGION
(optional): Restricts search results to documents originating in a particular country. See Country Parameter Values for valid values.GEOLOCATION
(optional, default "us"): The geolocation of the end-user performing the search. See Geolocation Parameter Values for valid values.RESULT_LANGUAGE
(optional, default "lang_en"): The language of the search results. See CSE Query parameters, lr for valid values.RESULT_NUM
(optional, default 10): The number of search results to return. Range from 1-10.
CSE Setup
Creating a custom search engine is comparatively easy, completely free and can be done in under 5 minutes.
- Go to https://console.cloud.google.com/ and create a new project. Call it "Claude CSE" for example.
- Select the project and search for "Custom Search API" in the search bar.
- Click on the search result and click on "Enable".
- Click on the Credentials tab and create a new API key.
- Go to https://programmablesearchengine.google.com to create a new custom search engine.
- Create a new search engine and give it any name, the name doesn't correlate to SERVICE_NAME.
- Select "Search the entire web" if you want a normal Google Search experience.
- Click on "Create" and copy the engine id from the js code, or hit customize and get it from the overview.
- You can optionally customize the search engine to your liking.
With the default quota, you will get 100 searches per day for free. A tool call only costs 1 search, even if you get 10 results for example.
Installation
Using uv (recommended)
When using uv
no specific installation is needed. We will
use uvx
to directly run mcp-google-cse.
Using PIP
Alternatively you can install mcp-google-cse
via pip:
After installation, you can run it as a script using:
Installing via Smithery
To install Google Custom Search Engine for Claude Desktop automatically via Smithery:
Configuration
Configure for Claude app
Add to your claude_desktop_config.json
:
Using uvx (use this if you don't know which one to choose)
Using pip installation
Running locally
Example result
google_search("What is MCP after:2024-11-01") Result:
You must be authenticated.
Enables search capabilities using a Google Custom Search Engine, allowing users to input a search term and retrieve search result titles, links, and snippets, while facilitating integration with other tools for content extraction and advanced search strategies.