Google Custom Search MCP

v1.1.1
io.github.A1-x-Tech/mcp-google-custom-search Checked 2 days ago Published 1 month ago

MCP server for Google Custom Search: web and image search via a Programmable Search Engine.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_images Image search

Image search through your Google Programmable Search Engine (searchType=image). Works only when the engine has "Image search" enabled in its control panel — otherwise the API answers 400. Each item's url is the image file itself; image.context_url is the page hosting it, with width/height/byte_size and a thumbnail_url (plus its dimensions) for previews. Everything else matches the search tool: same filters (language/country, safe search, site include/exclude, date_restrict, file_type, rights — use rights for reusable images), same pagination (max 10 per call, 100 per query, paginate via ne…

ParameterTypeDescription
query *stringThe search query, Google syntax included (quotes, site:, filetype:, OR, -exclusions).
color_typestringmono = black & white, trans = transparent background.
countrystringGeolocation bias — rank results as if searching from this country, e.g. "de". Soft signal.
country_restrictstringHard filter — only documents Google attributes to this country, e.g. "DE".
date_restrictstringOnly results from the last N days/weeks/months/years: "d7", "w2", "m6", "y1", ...
dominant_colorstringPrefer images dominated by this color.
engine_idstringProgrammable Search Engine id (cx) to search with, overriding the configured GOOGLE_CUSTOM_SEARCH_ENGINE_ID. Omit to use the configured engine.
exact_termsstringA phrase every result must contain.
exclude_termsstringA word or phrase no result may contain.
file_typestringOnly files of this type, e.g. "pdf", "xlsx", "svg".
filter_duplicatesbooleanGoogle's duplicate-content filter (default on). false returns near-duplicate results too.
include_pagemapbooleanAttach each result's raw pagemap (OpenGraph/metatags/thumbnails and other structured page data). Verbose — leave off unless you need page metadata.
interface_languagestringInterface language used to interpret the query, e.g. "de". Improves non-English relevance.
languagestringOnly results in this language, e.g. "en", "de", "zh-CN".
numintegerResults per page, 1..10 (API maximum 10; default 10).
or_termsstringSpace-separated words — each result must contain at least one of them.
rightsstringLicense filter: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived (combine with |).
safestringSafe search: active filters adult content, off (the API default) does not.
site_searchstringA site or domain to include or exclude, e.g. "example.com" — pair with site_search_filter.
site_search_filterstringinclude = only results from site_search, exclude = everything but it. Default include.
sizestringImage size class, from icon to huge.
sortstringSort expression, e.g. "date" for newest-first. Omit for relevance (usually better).
startinteger1-based index of the first result — use next_start/previous_start from the previous page. The API serves at most 100 results per query, so start + num - 1 must stay <= 100 (enforced: a wider window…
typestringKind of image.

raw_request Raw Custom Search API call

Escape hatch: performs a GET against any Custom Search JSON API path and returns the raw, unnormalized response envelope (queries.request/nextPage, searchInformation, promotions, context, items[] with htmlSnippet/htmlTitle/formattedUrl and the full pagemap). Use it for parameters the typed tools don't expose (lowRange/highRange, c2coff, hq, fields) — e.g. path "customsearch/v1?q=test&num=3&fields=items(title,link)". The API key is added automatically (in a header, never the URL) and the configured engine id is filled in when the path has no cx parameter. The API has GET endpoints only, so no…

ParameterTypeDescription
path *stringAPI path with query string, relative to https://customsearch.googleapis.com — e.g. "customsearch/v1?q=hello&num=3".