Serper Google Search MCP Server
A Model Context Protocol server that provides Google search capabilities through the Serper API. This server enables easy integration of Google search functionality into your MCP-enabled applications.
β¨ Features
- π Powerful Google search integration through Serper API
- π Rich response data including:
- Knowledge Graph information
- Organic search results
- βPeople Also Askβ questions
- Related searches
- π Configurable search parameters:
- Country targeting
- Language selection
- Result count customization
- Autocorrect options
- π Secure API key handling
- β‘οΈ Rate limiting and caching support
- π TypeScript support with full type definitions
π Installation
- Clone the repository:
git clone https://github.com/yourusername/serper-search-server.git
cd serper-search-server
- Install dependencies:
pnpm install
- Build the server:
pnpm run build
βοΈ Configuration
-
Get your Serper API key from Serper.devβ
-
Create a
.env
file in the root directory:
SERPER_API_KEY=your_api_key_here
π Integration
Claude Desktop
Add the server config to your Claude Desktop configuration:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"serper-search-server": {
"command": "/path/to/serper-search-server/build/index.js",
"env": {
"SERPER_API_KEY": "your_api_key_here"
}
}
}
}
π Usage
The server provides a powerful search tool with the following parameters:
{
"query": string, // Search query
"numResults"?: number, // Number of results (default: 10, max: 100)
"gl"?: string, // Country code (e.g., "us", "uk")
"hl"?: string, // Language code (e.g., "en", "es")
"autocorrect"?: boolean, // Enable autocorrect (default: true)
"type"?: "search" // Search type (more types coming soon)
}
Example Response
The search results include rich data:
{
"searchParameters": {
"q": "apple inc",
"gl": "us",
"hl": "en",
"autocorrect": true,
"type": "search"
},
"knowledgeGraph": {
"title": "Apple",
"type": "Technology company",
"website": "http://www.apple.com/",
"description": "Apple Inc. is an American multinational technology company...",
"attributes": {
"Headquarters": "Cupertino, CA",
"CEO": "Tim Cook (Aug 24, 2011β)",
"Founded": "April 1, 1976, Los Altos, CA"
}
},
"organic": [
{
"title": "Apple",
"link": "https://www.apple.com/",
"snippet": "Discover the innovative world of Apple...",
"position": 1
}
],
"peopleAlsoAsk": [
{
"question": "What does Apple Inc mean?",
"snippet": "Apple Inc., formerly Apple Computer, Inc....",
"link": "https://www.britannica.com/topic/Apple-Inc"
}
],
"relatedSearches": [
{
"query": "Who invented the iPhone"
}
]
}
π Response Types
Knowledge Graph
Contains entity information when available:
- Title and type
- Website URL
- Description
- Key attributes
Organic Results
List of search results including:
- Title and URL
- Snippet (description)
- Position in results
- Sitelinks when available
People Also Ask
Common questions related to the search:
- Question text
- Answer snippet
- Source link
Related Searches
List of related search queries users often make.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Serper APIβ for providing the Google search capabilities
- Model Context Protocolβ for the MCP framework