@elchika-inc/open-custom-search-api-mcp-server
v0.1.0
Published
MCP server for Google Custom Search API
Maintainers
Readme
Open Custom Search API MCP Server
A Model Context Protocol (MCP) server that provides access to Google's Custom Search API for web search functionality.
Features
- Google Custom Search Integration: Leverage Google's powerful search capabilities
- Configurable Result Limits: Customize the number of results (1-10) per search
- Environment Variable Configuration: Secure API credential management
- Comprehensive Error Handling: Robust error management for API failures
- Structured Response Format: Well-formatted search results with metadata
- Rate Limiting: Built-in protection against API quota exhaustion
MCP Client Configuration
Add this server to your MCP client configuration:
{
"mcpServers": {
"custom-search": {
"command": "npx",
"args": ["@elchika-inc/open-custom-search-api-mcp-server"],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
}
}
}
}Available Tools
google_search
Searches the web using Google Custom Search API with configurable result limits.
Parameters:
query(required): The search query stringlimit(optional): Maximum number of results to return (1-10, default: 10)
Examples:
Basic search:
{
"name": "google_search",
"arguments": {
"query": "MCP server development"
}
}Limited results search:
{
"name": "google_search",
"arguments": {
"query": "TypeScript best practices",
"limit": 5
}
}Response Format:
{
"query": "MCP server development",
"totalResults": "1000000",
"searchTime": 0.123,
"results": [
{
"title": "Example Result",
"link": "https://example.com",
"snippet": "This is an example search result...",
"displayLink": "example.com"
}
]
}Prerequisites
Google API Key: Obtain from Google Cloud Console
- Enable the Custom Search API in your Google Cloud project
- Create credentials (API key) for your application
Custom Search Engine ID: Create at Google Custom Search
- Set up a custom search engine
- Configure search settings and domains
- Copy the Search Engine ID
Environment Variables
The server requires the following environment variables:
GOOGLE_API_KEY: Your Google API key from Google Cloud ConsoleGOOGLE_SEARCH_ENGINE_ID: Your Custom Search Engine ID from Google Custom Search
Error Handling
Common error scenarios:
- Invalid or missing API credentials
- API quota exceeded or rate limits
- Network connection issues
- Invalid search parameters
- Custom Search Engine configuration errors
License
MIT
