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.

Values you need

VariableWhat it is
GOOGLE_CUSTOM_SEARCH_API_KEYrequired secret Google Cloud API key with the Custom Search API enabled. Treat it as a secret.
GOOGLE_CUSTOM_SEARCH_ENGINE_IDoptional Default Programmable Search Engine id (cx). Tools accept a per-call engine_id override.
GOOGLE_CUSTOM_SEARCH_API_BASEoptional API root override. Default: https://customsearch.googleapis.com
GOOGLE_CUSTOM_SEARCH_TIMEOUT_MSoptional Per-request timeout in milliseconds. Default: 30000
GOOGLE_CUSTOM_SEARCH_MAX_RETRIESoptional Retries on transient errors (429, and 5xx/network — the API is idempotent GETs only). Default: 3

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add mcp-google-custom-search -e 'GOOGLE_CUSTOM_SEARCH_API_KEY=<GOOGLE_CUSTOM_SEARCH_API_KEY>' -- npx -y mcp-google-custom-search@1.1.1
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mcp-google-custom-search": {
      "args": [
        "-y",
        "mcp-google-custom-search@1.1.1"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_CUSTOM_SEARCH_API_KEY": "<GOOGLE_CUSTOM_SEARCH_API_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-google-custom-search": {
      "args": [
        "-y",
        "mcp-google-custom-search@1.1.1"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_CUSTOM_SEARCH_API_KEY": "<GOOGLE_CUSTOM_SEARCH_API_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "GOOGLE_CUSTOM_SEARCH_API_KEY",
      "id": "google-custom-search-api-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "mcp-google-custom-search": {
      "args": [
        "-y",
        "mcp-google-custom-search@1.1.1"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_CUSTOM_SEARCH_API_KEY": "${input:google-custom-search-api-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mcp-google-custom-search]
command = "npx"
args = ["-y", "mcp-google-custom-search@1.1.1"]
env = { "GOOGLE_CUSTOM_SEARCH_API_KEY" = "<GOOGLE_CUSTOM_SEARCH_API_KEY>" }

For AI agents

  1. Ask the user for: GOOGLE_CUSTOM_SEARCH_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: search, search_images, raw_request.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json