mcpField
G
Google Programmable Search Engine (PSE) MCP Server

Google Programmable Search Engine (PSE) MCP Server

Local
github.com/rendyfebrySearch12Updated 56w ago

About Google Programmable Search Engine (PSE) MCP Server

Google Programmable Search Engine (PSE) MCP Server makes Google Custom Search available to MCP-compatible clients through a web search tool. It supports query, result count, date sorting, safe search, language, and site restriction options.

Key features

  1. 01Search the web with Google PSE
  2. 02Set result page and result count
  3. 03Sort results by date
  4. 04Apply safe search and language filters
  5. 05Restrict searches to a site

Use cases

  1. 01Search the web from an MCP client
  2. 02Limit results to a chosen language
  3. 03Search within a restricted site

MCP support

Exposes a `search` tool to MCP clients for querying Google Programmable Search Engine. The tool accepts options for pagination, result count, sorting, filtering, and site restriction.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"google-pse": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp"
]
}
}
}
Run commandnpx -y google-pse-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmgoogle-pse-mcp

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
qstringYesSearch query
pageintegerNoPage number
sizeintegerNoNumber of search results to return per page. Valid values are integers between 1 and 10, inclusive.
sortstringNoSort expression (e.g., 'date'). Only 'date' is supported by the API.
safebooleanNoEnable safe search filtering. Default: false.
lrstringNoRestricts the search to documents written in a particular language (e.g., lang_en, lang_ja)
siteRestrictedbooleanNoIf true, use the Site Restricted API endpoint (/v1/siterestrict). If false, use the standard API endpoint (/v1). Default: true.

Details

From the project README

MseeP.ai Security Assessment Badge

Google Programmable Search Engine (PSE) MCP Server

A Model Context Protocol (MCP) server for the Google Programmable Search Engine (PSE) API. This server exposes tools for searching the web with Google Custom Search engine, making them accessible to MCP-compatible clients such as VSCode, Copilot, and Claude Desktop.

Installation Steps

You do NOT need to clone this repository manually or run any installation commands yourself. Simply add the configuration below to your respective MCP client—your client will automatically install and launch the server as needed.

VS Code Copilot Configuration

Open Command Palette → Preferences: Open Settings (JSON), then add:

settings.json

{
  // Other settings...
  "mcp": {
    "servers": {
      "google-pse-mcp": {
        "command": "npx",
        "args": [
          "-y",
          "google-pse-mcp",
          "https://www.googleapis.com/customsearch",
          "<api_key>",
          "<cx>",
          "<siteRestricted>" // optional: true/false, defaults to true
        ]
      }
    }
  }
}
Cline MCP Configuration Example

If you are using Cline, add the following to your cline_mcp_settings.json (usually found in your VSCode global storage or Cline config directory):

  • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{
  "mcpServers": {
    "google-pse-mcp": {
      "disabled": false,
      "timeout": 60,
      "command": "npx",
      "args": [
        "-y",
        "google-pse-mcp",
        "https://www.googleapis.com/customsearch",
        "<api_key>",
        "<cx>",
        "<siteRestricted>" // optional flag, true/false, defaults to true
      ],
      "transportType": "stdio"
    }
  }
}
Important Notes

Don't forget to replace <api_key> and <cx> with your credentials in the configuration above. You can also provide an optional <siteRestricted> flag (true or false) as the last argument to control which Google Custom Search endpoint is used. If omitted, it defaults to true.

Available Tools

This MCP server provides the following tool:

  1. search: Search the web with Google Programmable Search Engine

    • Parameters:
      • q (string, required): Search query
      • page (integer, optional): Page number
      • size (integer, optional): Number of search results to return per page (1-10)
      • sort (string, optional): Sort expression (only 'date' is supported)
      • safe (boolean, optional): Enable safe search filtering
      • lr (string, optional): Restrict search to a particular language (e.g., lang_en)
      • siteRestricted (boolean, optional): Use the Site Restricted API endpoint; defaults to true unless overridden via CLI flag

Example Usage

# Search for "artificial intelligence"
result = await use_mcp_tool(
    server_name="google-pse-mcp",
    tool_name="search",
    arguments={
        "q": "artificial intelligence",
        "size": 5,
        "safe": True
    }
)

Useful Links

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.