Content
# Google Search MCP Server
This project is a Model Context Protocol (MCP) server that provides Google Search API functionality to AI assistants.
## Overview
The Google Search MCP Server is a tool that enables AI assistants to perform web searches using the Google Search API. It provides an interface between the AI assistant and the Google Search API using Gradio and MCP.
## Features
- Web search using the Google Search API
- Return search results in JSON format
- Retrieve up to 20 search results
## Requirements
- Python 3.12 or higher
- Google Custom Search Engine ID
- Google API Key
## Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/google-search-mcp-server.git
cd google-search-mcp-server
```
2. Install the dependencies:
```bash
pip install -e .
```
3. Set up the environment variables:
Copy the `.env.sample` file to `.env` and add the required API keys:
```bash
cp .env.sample .env
```
Edit the `.env` file to set the following values:
```
GOOGLE_CSE_ID=your Google Custom Search Engine ID
GOOGLE_API_KEY=your Google API Key
```
## Usage
To start the server:
```bash
python app.py
```
This will launch the Gradio interface, functioning as the MCP server.
## Integration with MCP
This server integrates with AI assistants using the Model Context Protocol (MCP). The AI assistant can access Google search functionality through this server.
## API Reference
### perform_web_search
```python
perform_web_search(query: str, num_results: int = 10)
```
**Parameters**:
- `query` (str): The search query (up to 400 characters, 50 words)
- `num_results` (int): The number of results (1 to 20, default is 10)
**Returns**:
- `str`: Search results in JSON format
Connection Info
You Might Also Like
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
airbyte-agent-connectors
Airbyte Agent Connectors for seamless data integration.
airbyte-ai-connectors
Airbyte AI Connectors for seamless data integration and publishing.
alibabacloud-ack-mcp-server
Alibaba Cloud ACK MCP Server integrates resource management and...