Skip to main content

mcp-server-googlesearch MCP server

A Model Context Protocol (MCP) server that provides Google search functionality to AI assistants. This server allows AI assistants like Claude to perform web searches and receive structured results with titles, URLs, and descriptions.

Features

  • Google Search Tool: Perform web searches using Google's search engine
  • Structured Results: Returns search results with title, URL, and description
  • Configurable Results: Specify the number of results (1-50, default: 10)
  • Error Handling: Comprehensive error handling for network issues, rate limiting, and validation
  • MCP Protocol: Full compliance with Model Context Protocol standards

Components

Tools

The server implements one tool:

  • google_search: Performs a Google search and returns structured results
    • query (required): The search query to execute
    • num_results (optional): Number of search results to return (1-50, default: 10)

Installation

Prerequisites

  • Python 3.11 or higher
  • uv package manager

Install from PyPI (when published)

uvx mcp-server-googlesearch

Install from Source

  1. Clone or download the project
  2. Navigate to the project directory
  3. Build and install:
cd mcp-server-googlesearch
uv sync
uv build
uv tool install dist/mcp_server_googlesearch-0.1.0-py3-none-any.whl

Configuration

Claude Desktop

Add the following to your Claude Desktop configuration file:

Windows: %APPDATA%/Claude/claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

For Published Version

{
  "mcpServers": {
    "google-search": {
      "command": "uvx",
      "args": ["mcp-server-googlesearch"]
    }
  }
}

For Development/Local Installation

{
  "mcpServers": {
    "google-search": {
      "command": "uvx",
      "args": [
        "--directory",
        "C:\\path\\to\\mcp-server-googlesearch",
        "mcp-server-googlesearch"
      ]
    }
  }
}

Other MCP Clients

The server can be used with any MCP-compatible client. Use the appropriate command for your setup:

  • Direct execution: uvx mcp-server-googlesearch
  • From source: uvx --directory /path/to/project mcp-server-googlesearch

Usage Examples

Once configured with your AI assistant, you can use natural language to perform searches:

  • "Search for Python programming tutorials"
  • "Find information about machine learning"
  • "Look up the latest news about artificial intelligence"
  • "Search for 'climate change' and show me 5 results"

The server will return formatted results with:

  • Numbered list of search results
  • Title of each result
  • URL of each result
  • Description/snippet of each result

Dependencies

  • mcp: Model Context Protocol implementation (>=1.12.0)
  • googlesearch-python: Google search functionality (>=1.3.0)
  • requests: HTTP library (automatically installed with googlesearch-python)
  • beautifulsoup4: HTML parsing (automatically installed with googlesearch-python)

Error Handling

The server handles various error conditions gracefully:

  • Network Issues: Connection failures, timeouts
  • Rate Limiting: Google search rate limits
  • Validation Errors: Invalid queries or parameters
  • Service Errors: Google service unavailability

All errors are returned as user-friendly messages through the MCP protocol.

Development

Building and Testing

# Sync dependencies
uv sync

# Build the package
uv build

# Install locally for testing
uv tool install dist/mcp_server_googlesearch-0.1.0-py3-none-any.whl

# Test the installation
uvx mcp-server-googlesearch

Debugging

For debugging, you can use the MCP Inspector:

npx @modelcontextprotocol/inspector uvx --directory /path/to/mcp-server-googlesearch mcp-server-googlesearch

This will launch a web interface where you can test the server's functionality.

Troubleshooting

Common Issues

  1. Import Errors: Ensure all dependencies are installed with uv sync
  2. Network Errors: Check your internet connection and firewall settings
  3. Rate Limiting: If you encounter rate limits, wait a moment before trying again
  4. Configuration Issues: Verify the path in your Claude Desktop configuration

Logging

The server logs important events and errors. Check the console output or your MCP client's logs for detailed error information.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Metadata

Release files for mcp-server-googlesearch 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-googlesearch 0.1.1
File Size Uploaded Provenance
mcp_server_googlesearch-0.1.1.tar.gz 37.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-googlesearch 0.1.1
File Interpreter ABI Platform
mcp_server_googlesearch-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.3 kB

Release files / mcp_server_googlesearch-0.1.1.tar.gz

Download URL mcp_server_googlesearch-0.1.1.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
276f8ed86f1b95702791a0020cb6299f8d80830047e1cfce290885e5c3707f23
BLAKE2b-256 checksum
How to use checksums
05c9c0017212fad91f5c6164492336c1ea23bc0c6bda20a862f05f6e2ab1fa82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Release files / mcp_server_googlesearch-0.1.1-py3-none-any.whl

Download URL mcp_server_googlesearch-0.1.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38409021c2a94bf244de966fe7beeedd36a6c9083389b642a2b114071f06b90b
BLAKE2b-256 checksum
How to use checksums
cf857886b5d554506d1a7649ef6c3bdd6c35efcab71148a03b1aafea74f7ab5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Security for mcp-server-googlesearch 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page