Searches the web through the Google Programmable Search Engine (Custom Search) API.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add google-pse --env API_KEY='<API_KEY>' --env CX='<CX>' -- npx -y google-pse-mcp https://www.googleapis.com/customsearch '<api_key>' '<cx>'~/.codex/config.toml
[mcp_servers.google-pse]
command = "npx"
args = ["-y", "google-pse-mcp", "https://www.googleapis.com/customsearch", "<api_key>", "<cx>"]
env = { API_KEY = "<API_KEY>", CX = "<CX>" }
# codex mcp add google-pse --env API_KEY='<API_KEY>' --env CX='<CX>' -- npx -y google-pse-mcp https://www.googleapis.com/customsearch '<api_key>' '<cx>'~/.cursor/mcp.json
{
"mcpServers": {
"google-pse": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
],
"env": {
"API_KEY": "<API_KEY>",
"CX": "<CX>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"google-pse": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
],
"env": {
"API_KEY": "<API_KEY>",
"CX": "<CX>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"google-pse": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
],
"env": {
"API_KEY": "<API_KEY>",
"CX": "<CX>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"google-pse": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
],
"env": {
"API_KEY": "<API_KEY>",
"CX": "<CX>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"google-pse": {
"command": "npx",
"args": [
"-y",
"google-pse-mcp",
"https://www.googleapis.com/customsearch",
"<api_key>",
"<cx>"
],
"env": {
"API_KEY": "<API_KEY>",
"CX": "<CX>"
}
}
}
}需要的环境变量
API_KEYCX
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。