This server implements the Model Context Protocol (MCP) for Google Programmable Search Engine (PSE), allowing you to search the web using Google Custom Search from MCP-compatible clients like VSCode, Copilot, and Claude Desktop.
To use this MCP server, you'll need:
No manual installation is required. Your MCP client will automatically install and launch the server once you've added the proper configuration.
Open Command Palette → Preferences: Open Settings (JSON), then add:
{
"mcp": {
"servers": {
"google-pse-mcp": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>",
"<siteRestricted>"
]
}
}
}
}
If you're using Cline, add this to your 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>"
],
"transportType": "stdio"
}
}
}
Be sure to replace the following in your configuration:
<api_key>
: Your Google API key<cx>
: Your custom search engine ID<siteRestricted>
: Optional flag (true/false) that controls which Google Custom Search endpoint is used (defaults to true if omitted)The MCP server provides a single tool named search
with these parameters:
q
(string, required): Your search querypage
(integer, optional): Page number for paginationsize
(integer, optional): Number of results per page (1-10)sort
(string, optional): Sort expression (only 'date' is supported)safe
(boolean, optional): Enable safe search filteringlr
(string, optional): Restrict results to a specific language (e.g., lang_en)siteRestricted
(boolean, optional): Override the default siteRestricted setting# 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
}
)
For more information about Google Programmable Search Engine, visit:
For more about Model Context Protocol servers:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google-pse-mcp" '{"command":"npx","args":["-y","google-pse-mcp","https://www.googleapis.com/customsearch","<api_key>","<cx>"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"google-pse-mcp": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"google-pse-mcp": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect