p445ccm4/Google-Search-MCP-server-with-Streamable-HTTP
If you are the rightful owner of Google-Search-MCP-server-with-Streamable-HTTP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server built with mcp-framework.
google-search-mcp-server-with-Streamable-HTTP
A Model Context Protocol (MCP) HTTP server built with the mcp-framework
that allows a model to use Google Search.
āļø Prerequisites & Setup
Before launching the server, you must get Google API credentials and configure your local environment.
1. Get Google API Credentials
This tool requires a Google Custom Search API Key and a Search Engine ID.
-
Get the API Key:
- Go to the Google Cloud Console and create or select a project.
- Navigate to the API Library and enable the Custom Search API.
- Go to the Credentials page, click + CREATE CREDENTIALS, and select API key. Copy the generated key.
-
Get the Search Engine ID:
- Go to the Programmable Search Engine control panel.
- Click Add to create a new search engine. You can configure it to search the entire web.
- After creation, go to the Setup page and copy the Search engine ID.
2. Configure Environment Variables
You'll store your secret credentials in a local .env
file.
-
Make a copy of the example environment file. This command works for macOS and Linux.
cp .env.example .env
(For Windows Command Prompt, use
copy .env.example .env
) -
Open the new
.env
file and paste the credentials you just obtained. It should look like this:# .env API_KEY="YOUR_API_KEY_HERE" SEARCH_ENGINE_ID="YOUR_SEARCH_ENGINE_ID_HERE" PORT=3020
š Quick Start
Once your .env
file is configured, you can start the server.
# Install dependencies
npm install
# Build the project (compiles TypeScript to JavaScript)
npm run build
# Start the server
npm run start
š Project Structure
The .env
file you created will be located in the root of the project.
google-search-mcp-server/
āāā .env # Your local environment variables (created from .env.example)
āāā .env.example # Example environment file
āāā src/
ā āāā tools/ # MCP Tools
ā ā āāā ReadWebpageTool.ts
ā ā āāā SearchTool.ts
ā āāā index.ts # Server entry point
āāā package.json
āāā tsconfig.json
š„ļø Using with Claude Desktop
Local Development
To connect this server to your Claude Desktop app, add the following configuration to your config file.
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"google-search-mcp-server": {
"command": "node",
"args":["/absolute/path/to/google-search-mcp-server/dist/index.js"]
}
}
}
Note: Remember to replace /absolute/path/to/
with the actual full path to your project directory.
š ļø Building and Testing
- Make changes to your tools in the
src/tools/
directory. - Run
npm run build
to compile your changes. - Restart the server (
npm run start
) to load your updated tools.