This MCP (Machine Communication Protocol) server enables Claude Desktop to perform Google searches using the Google Custom Search API.
- Google API Key
- Google Custom Search Engine ID (cx)
-
Clone this repository
-
Install dependencies:
npm install
-
Configure environment variables in your Claude Desktop config file (
claude_desktop_config.json
):{ "mcps": { "google-search": { "command": "npx claude-google-search-mcp", "env": { "GOOGLE_API_KEY": "your-google-api-key", "GOOGLE_SEARCH_ENGINE_ID": "your-search-engine-id" } } } }
Performs a Google search.
Request body:
{
"query": "search query string",
"num": 10 // optional, number of results (max 10)
}
Response:
{
"results": [
{
"title": "Result title",
"link": "https://result.url",
"snippet": "Result description",
"displayLink": "result.url"
}
],
"totalResults": "1234567"
}
Health check endpoint.
Response:
{
"status": "healthy"
}
The server will return appropriate HTTP status codes:
- 400: Bad Request (missing query)
- 500: Server Error (API errors)
-
GOOGLE_API_KEY
: Your Google API key for Custom Search -
GOOGLE_SEARCH_ENGINE_ID
: Your Custom Search Engine ID -
PORT
: Server port (default: 3000)
To run the server locally:
npm start
-
Package the application:
npm pack
-
Install globally:
npm install -g claude-google-search-mcp-1.0.0.tgz
MIT