MCP Google Custom Search Server
The MCP Google Custom Search Server enables web searches via Google's Custom Search API through a standardized Model Context Protocol (MCP) interface. Key capabilities include:
Perform web searches using Google Custom Search API
Specify search queries with input validation
Control the number of results returned (default 5, maximum 10)
Access formatted search results including titles, URLs, and descriptions
Integrate with MCP-compatible clients like Claude Desktop
Handle errors and provide validation feedback
Ensure type safety through TypeScript implementation
Enables web search capabilities through Google's Custom Search API, allowing users to retrieve search results with titles, URLs, and descriptions.
Uses Google Cloud's Custom Search API to perform web searches with configurable results (up to 10 per query).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Google Custom Search Serversearch for the latest advancements in quantum computing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Google Custom Search Server
A Model Context Protocol (MCP) server that provides web search capabilities through Google's Custom Search API. This server enables Language Learning Models (LLMs) to perform web searches using a standardized interface.
š Features
Seamless integration with Google Custom Search API
Model Context Protocol (MCP) compliant server implementation
Type-safe implementation using TypeScript
Environment variable configuration
Input validation using Zod
Configurable search results (up to 10 per query)
Formatted search results including titles, URLs, and descriptions
Error handling and validation
Compatible with Claude Desktop and other MCP clients
Related MCP server: MCP Server for Google Search
š Prerequisites
Before you begin, ensure you have:
A Google Cloud Project with Custom Search API enabled
Visit Google Cloud Console
Enable the Custom Search API
Create API credentials
A Custom Search Engine ID
Create a new search engine
Get your Search Engine ID
Local development requirements:
Node.js (v18 or higher)
npm (comes with Node.js)
š Quick Start
Clone the repository:
git clone https://github.com/limklister/mcp-google-custom-search-server.git cd mcp-google-custom-search-serverInstall dependencies:
npm installCreate a .env file:
GOOGLE_API_KEY=your-api-key GOOGLE_SEARCH_ENGINE_ID=your-search-engine-idBuild the server:
npm run buildStart the server:
npm start
š§ Configuration
Environment Variables
Variable | Description | Required |
GOOGLE_API_KEY | Your Google Custom Search API key | Yes |
GOOGLE_SEARCH_ENGINE_ID | Your Custom Search Engine ID | Yes |
Claude Desktop Integration
Add this configuration to your Claude Desktop config file (typically located at ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"google-search": {
"command": "node",
"args": [
"/absolute/path/to/mcp-google-custom-search-server/build/index.js"
],
"env": {
"GOOGLE_API_KEY": "your-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-search-engine-id"
}
}
}
}š API Reference
Available Tools
search
Performs a web search using Google Custom Search API.
Parameters:
query(string, required): The search query to executenumResults(number, optional): Number of results to returnDefault: 5
Maximum: 10
Example Response:
Result 1:
Title: Example Search Result
URL: https://example.com
Description: This is an example search result description
---
Result 2:
...š ļø Development
Project Structure
mcp-google-custom-search-server/
āāā src/
ā āāā index.ts # Main server implementation
āāā build/ # Compiled JavaScript output
āāā .env # Environment variables
āāā package.json # Project dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā README.md # Project documentationAvailable Scripts
npm run build: Compile TypeScript to JavaScriptnpm start: Start the MCP servernpm run dev: Watch mode for development
Testing
Using MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.jsManual testing with example queries:
# After starting the server {"jsonrpc":"2.0","id":1,"method":"callTool","params":{"name":"search","arguments":{"query":"example search"}}}
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
Built with Model Context Protocol (MCP)
Uses Google's Custom Search API
Inspired by the need for better search capabilities in LLM applications
Available Tools
1 toolsearchC
Search the web using Google Custom Search API
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query | |
| numResults | No | Number of results to return (max 10) | |
| country | No | Region for localized results. Use 2-letter ISO 3166-1 country codes (e.g., 'us' for United States, 'gb' for United Kingdom, 'au' for Australia) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions using the Google Custom Search API, it doesn't disclose important behavioral traits such as rate limits, authentication requirements, error handling, or what format the results will be returned in. The description is minimal and doesn't provide sufficient context about how the tool behaves beyond its basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise - a single sentence that directly states the tool's purpose without any unnecessary words or fluff. It's appropriately sized for a simple search tool and front-loads the essential information. Every word earns its place in this minimal description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there's no output schema and no annotations, the description is insufficiently complete. For a search tool with 3 parameters, the description should provide more context about what kind of results to expect, any limitations of the Google Custom Search API, or typical use cases. The current description leaves too many questions unanswered for effective tool selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with all three parameters well-documented in the schema itself. The description doesn't add any meaningful parameter information beyond what's already in the schema descriptions. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Search the web using Google Custom Search API'. It specifies the action (search) and resource (web via Google Custom Search API), making the function unambiguous. However, since there are no sibling tools mentioned, it doesn't need to differentiate from alternatives, which prevents a perfect score of 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives or in what contexts it's appropriate. It lacks any mention of prerequisites, limitations, or scenarios where this search tool should be selected over other potential search methods. This absence of usage context leaves the agent without operational guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
search
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is singular and clearly defined, eliminating any ambiguity in tool selection.
A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The tool name 'search' is straightforward and follows a simple verb pattern appropriate for its function.
A single tool is too few for a server with a purpose like web search, which could benefit from additional tools such as filtering, pagination, or advanced search options. This minimal set feels thin and limits functionality.
The tool surface is severely incomplete for a web search domain. While the basic search function is covered, there are obvious gaps such as no tools for result refinement, handling multiple pages, or accessing search metadata, which could lead to agent failures in complex tasks.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Google search results via SERP API
A Model Context Protocol server for Wix AI tools
Serper MCP ā wraps the Serper Google Search API (serper.dev)
Related MCP Servers
- FlicenseCqualityBmaintenanceA Model Context Protocol server that enables LLMs to perform Google searches via the Serper API, allowing models to retrieve current information from the web.1338-
- FlicenseAqualityCmaintenanceA Model Context Protocol server that provides web search capabilities using Google Custom Search API and webpage content extraction functionality.262-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to perform web searches using Google Search API, returning up to 20 search results in JSON format.2Apache 2.0
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides web search capabilities using Google Custom Search API and webpage content extraction functionality.2MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/limklister/mcp-google-custom-search-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server