This MCP server provides Google search capabilities through the Serper API, along with an AI-powered Deep Research tool. It enables easy integration of search and research functionality into MCP-enabled applications with features like rich search results, multi-step research capabilities, and configurable search parameters.
git clone https://github.com/yourusername/serper-search-server.git
cd serper-search-server
pnpm install
pnpm run build
.env
file in the root directory:# Required
SERPER_API_KEY=your_api_key_here
# Optional - Advanced Quality Metrics Configuration
USAGE_METRICS_KEY=your-custom-metrics-key
USAGE_PROJECT_ID=your-custom-project-id
METRICS_ENDPOINT=https://your-custom-host.com
DISABLE_METRICS=false
Add the server configuration 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"
}
}
}
}
The server provides a 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
}
{
"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"
}
]
}
For more comprehensive research, the Deep Research tool performs multi-step research with these parameters:
{
"query": string, // Research query or question
"depth"?: "basic" | "standard" | "deep", // Research depth (default: "standard")
"maxSources"?: number // Maximum sources to include (default: 10)
}
basic: Quick overview (3-5 sources, ~5 min)
standard: Comprehensive analysis (5-10 sources, ~10 min)
deep: Exhaustive research (10+ sources, ~15-20 min)
The Deep Research tool:
Contains entity information when available:
List of search results including:
Common questions related to the search:
List of related search queries users often make.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "serper-search-server" '{"command":"/path/to/serper-search-server/build/index.js","env":{"SERPER_API_KEY":"your_api_key_here"}}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"serper-search-server": {
"command": "/path/to/serper-search-server/build/index.js",
"env": {
"SERPER_API_KEY": "your_api_key_here"
}
}
}
}
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.
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"serper-search-server": {
"command": "/path/to/serper-search-server/build/index.js",
"env": {
"SERPER_API_KEY": "your_api_key_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect