my-google-search-mcp
v1.0.2
Published
MCP server that searches Google via Chrome extension and filters any URL's content using an LLM. No bot detection. Works with Claude, VS Code Copilot, and any MCP client.
Downloads
242
Maintainers
Readme
My Google Search MCP
Real Google search for AI agents, powered by your own Chrome session
What this is
my-google-search-mcp is a Model Context Protocol server that gives AI clients two useful tools:
google_searchfor real Google results through your actual Chrome browserfetch_and_filterfor pulling only the useful parts of a web page
Instead of fighting bot detection with scraping tricks, this project uses your real Chrome session through a lightweight extension.
Why it is useful
| Feature | Benefit |
|---|---|
| Real browser search | Results come from your own Chrome session |
| Better agent output | Search results are returned as clean Markdown |
| Focused page extraction | Optional LLM filtering removes page bloat |
| Easy MCP setup | Works with Claude Desktop, Cursor, VS Code, Copilot, and other MCP clients |
| Local bridge | The extension talks to a loopback server on 127.0.0.1 |
Quick Start
To use
google_search, you need both the Chrome extension and the MCP server config.
Requirements
- Node.js and npm
- Google Chrome
- An MCP-compatible client
- The bundled Chrome extension from
chrome-extension/
Optional:
OPENROUTER_API_KEYif you want tighter filtering fromfetch_and_filter
1. Install the Chrome extension
- Download the project from the GitHub release or clone this repo
- Open
chrome://extensions - Turn on Developer mode
- Click Load unpacked
- Select the
chrome-extension/folder
2. Add the MCP server to your client
{
"mcpServers": {
"my-google-search-mcp": {
"command": "npx",
"args": ["-y", "my-google-search-mcp"]
}
}
}You do not need to install the npm package first. npx will download and run it automatically.
3. Start the server once
Run:
npx my-google-search-mcpOn first run, the CLI will:
- start the local MCP server
- start the local bridge on
127.0.0.1:3777 - generate a bridge token
- save that token to
~/.mcp-google-search.json - print the token for you
4. Put the token in the extension
Open chrome-extension/background.js and update:
const BRIDGE_TOKEN = "your-token-here";Then reload the extension in chrome://extensions.
5. Use it
After setup:
- restart your MCP client if needed
- keep Chrome open
- use
google_searchfrom your AI client
That is the full setup.
How it works
Search flow
+-----------+
| AI Client |
+-----------+
|
v
+----------------------+
| my-google-search-mcp |
+----------------------+
|
v
+--------------+
| Local Bridge |
+--------------+
|
v
+------------------+
| Chrome Extension |
+------------------+
|
v
+---------------+
| Google Search |
+---------------+Page extraction flow
URL
|
v
Fetch page
|
v
Clean HTML -> Markdown
|
v
Optional LLM filteringTools
google_search
Searches Google and returns structured Markdown that may include:
- AI Overview
- Featured Snippet
- Knowledge Panel
- Top organic results
- People Also Ask
Requirement:
- Chrome must be open
- the extension must be installed
- the extension token and server token must match
fetch_and_filter
Fetches a URL and returns only the relevant content.
Without OPENROUTER_API_KEY:
- returns cleaned Markdown from the page
With OPENROUTER_API_KEY:
- uses an LLM to extract only the parts that match the query
- can follow relevant sub-links if the root page does not contain the answer
Client Examples
Claude Desktop
{
"mcpServers": {
"my-google-search-mcp": {
"command": "npx",
"args": ["-y", "my-google-search-mcp"]
}
}
}VS Code / Copilot / Cursor
{
"mcpServers": {
"my-google-search-mcp": {
"command": "npx",
"args": ["-y", "my-google-search-mcp"]
}
}
}With environment variables
{
"mcpServers": {
"my-google-search-mcp": {
"command": "npx",
"args": ["-y", "my-google-search-mcp"],
"env": {
"BRIDGE_TOKEN": "your-secret-token",
"OPENROUTER_API_KEY": "sk-or-v1-..."
}
}
}
}Environment Variables
You can use .env.example or provide env vars through your MCP client:
OPENROUTER_API_KEY=sk-or-v1-...
OPENROUTER_MODEL=google/gemini-2.0-flash-001
BRIDGE_TOKEN=your-secret-tokenTroubleshooting
Extension not connected
- Make sure Chrome is open
- Make sure the extension is loaded
- Make sure the token in
background.jsmatches the server token
fetch_and_filter returns full page content
That means OPENROUTER_API_KEY is not set. The tool still works, but it skips LLM filtering.
Google results stop parsing correctly
Google changes its DOM often. If that happens, update the selectors in chrome-extension/background.js.
Security Notes
- Bridge requests require a shared token
- The bridge only listens on
127.0.0.1 - Search requests are rate-limited
fetch_and_filterblocks localhost and private/internal IP ranges- Prompt injection is treated as untrusted page content during LLM extraction
- Error messages are sanitized before being returned to clients
Local Development
git clone https://github.com/dev-tahir/my-google-search-mcp
cd my-google-search-mcp
npm install
npm run build
npm startFor development mode:
npm run devRepo Structure
src/
bin.ts CLI entrypoint
index.ts MCP server and tool registration
bridge.ts local bridge between MCP server and Chrome extension
fetcher.ts HTML fetching, cleanup, and Markdown conversion
llm.ts OpenRouter integration
site-search.ts query-driven extraction and link-following
chrome-extension/
background.js Chrome extension service worker
manifest.json extension manifestPublishing Notes
- npm package name:
my-google-search-mcp - binary entrypoint:
my-google-search-mcp - license: MIT
License
MIT
