npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

Readme

My Google Search MCP

Real Google search for AI agents, powered by your own Chrome session

npm version license mcp github


What this is

my-google-search-mcp is a Model Context Protocol server that gives AI clients two useful tools:

  • google_search for real Google results through your actual Chrome browser
  • fetch_and_filter for 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_KEY if you want tighter filtering from fetch_and_filter

1. Install the Chrome extension

  1. Download the project from the GitHub release or clone this repo
  2. Open chrome://extensions
  3. Turn on Developer mode
  4. Click Load unpacked
  5. 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-mcp

On 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_search from 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 filtering

Tools

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-token

Troubleshooting

Extension not connected

  • Make sure Chrome is open
  • Make sure the extension is loaded
  • Make sure the token in background.js matches 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_filter blocks 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 start

For development mode:

npm run dev

Repo 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 manifest

Publishing Notes

  • npm package name: my-google-search-mcp
  • binary entrypoint: my-google-search-mcp
  • license: MIT

License

MIT