Google Custom Search MCP server

Integrates with Google Custom Search Engine to enable automated web crawling, content extraction, and search result parsing for data collection and analysis at scale.
Back to servers
Provider
WeiDwonder
Release date
Feb 08, 2025
Language
Python
Stats
87 stars

The Crawl4AI MCP Server is a powerful intelligent information retrieval service built on the Model Context Protocol. It equips AI assistant systems with robust search capabilities and LLM-optimized web content understanding features, efficiently transforming web content into formats that are ideal for language models to process.

Installation Options

Standard Installation

  1. Ensure your system meets these requirements:

    • Python >= 3.9
    • A dedicated virtual environment (recommended)
  2. Clone the repository:

    git clone https://github.com/yourusername/crawl4ai-mcp-server.git
    cd crawl4ai-mcp-server
    
  3. Create and activate a virtual environment:

    python -m venv crawl4ai_env
    source crawl4ai_env/bin/activate  # Linux/Mac
    # or
    .\crawl4ai_env\Scripts\activate  # Windows
    
  4. Install dependencies:

    pip install -r requirements.txt
    
  5. Install Playwright browsers:

    playwright install
    

Claude Desktop Integration via Smithery

Install and configure the Crawl4AI MCP service to your local Claude desktop:

npx -y @smithery/cli install @weidwonder/crawl4ai-mcp-server --client claude

Using the Server

The server provides the following tools:

Search Tool

The search tool supports multiple search engines:

  • DuckDuckGo (default): No API key required
  • Google: Requires API key configuration
  • Option to use multiple engines simultaneously

Parameters:

  • query: Your search query string
  • num_results: Number of results to return (default: 10)
  • engine: Search engine selection
    • "duckduckgo": DuckDuckGo search (default)
    • "google": Google search (requires API key)
    • "all": Use all available search engines

Examples:

# DuckDuckGo search (default)
{
    "query": "python programming",
    "num_results": 5
}

# Using all available engines
{
    "query": "python programming",
    "num_results": 5,
    "engine": "all"
}

Web Content Reader

The read_url tool provides LLM-optimized web content extraction:

  • markdown_with_citations: Markdown with inline citations (default)
  • fit_markdown: LLM-optimized content with redundancies removed
  • raw_markdown: Basic HTML-to-Markdown conversion
  • references_markdown: Separate references/citations section
  • fit_html: Filtered HTML that generates fit_markdown
  • markdown: Default Markdown format

Example:

{
    "url": "https://example.com",
    "format": "markdown_with_citations"
}

Configuration

  1. Copy the configuration example file:

    cp config_demo.json config.json
    
  2. To use Google search, configure API keys in config.json:

    {
        "google": {
            "api_key": "your-google-api-key",
            "cse_id": "your-google-cse-id"
        }
    }
    

LLM Content Optimization

The server employs several content optimization strategies for LLMs:

  • Intelligent content identification: Automatically identifies and retains article bodies and key information
  • Noise filtering: Removes navigation bars, ads, footers, and other non-essential content
  • Information integrity: Preserves URL references for source tracking
  • Length optimization: Uses minimum word thresholds to filter ineffective fragments
  • Format optimization: Outputs markdown_with_citations by default for better LLM understanding

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later