mcp-google-search

1.0.0 • Public • Published

Google Search MCP Server for Claude Desktop

This MCP (Machine Communication Protocol) server enables Claude Desktop to perform Google searches using the Google Custom Search API.

Prerequisites

  1. Google API Key
  2. Google Custom Search Engine ID (cx)

Setup

  1. Clone this repository

  2. Install dependencies:

    npm install
  3. 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"
          }
        }
      }
    }

API Endpoints

POST /search

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"
}

GET /health

Health check endpoint.

Response:

{
  "status": "healthy"
}

Error Handling

The server will return appropriate HTTP status codes:

  • 400: Bad Request (missing query)
  • 500: Server Error (API errors)

Environment Variables

  • GOOGLE_API_KEY: Your Google API key for Custom Search
  • GOOGLE_SEARCH_ENGINE_ID: Your Custom Search Engine ID
  • PORT: Server port (default: 3000)

Development

To run the server locally:

npm start

Deployment

  1. Package the application:

    npm pack
  2. Install globally:

    npm install -g claude-google-search-mcp-1.0.0.tgz

License

MIT

Package Sidebar

Install

npm i mcp-google-search

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.23 kB

Total Files

3

Last publish

Collaborators

  • webniko