anima-use-google

anima-use-google

MCP server that lets AI agents perform Google AI Mode searches using the user's own browser session, returning synthesized answers with citations.

Category
访问服务器

README

<div align=center>

anima-use-google

MCP server + browser sidecar extension that lets AI agents run Google AI Mode searches using your own logged-in browser session, then return the synthesized answer and citations as an MCP tool result.

<img width="256" height="384" alt="AnimAIOS mascot" src="https://github.com/user-attachments/assets/8df6553c-e975-4ac4-b32c-fc73cdf0eebd" />

No headless browser, no stealth tricks, no CAPTCHA fighting. Your real browser profile does the work.

</div>

Quickest path (5 minutes)

You need three things: the MCP server, the native-messaging host, and either the Firefox or Chromium extension. Then wire the server into your agent.

1. Wire the MCP server into your agent

Claude Code:

claude mcp add google-ai-search -- npx anima-use-google

Other agents - add to your MCP config:

{
  "mcpServers": {
    "google-ai-search": {
      "command": "npx",
      "args": ["anima-use-google"]
    }
  }
}

If you do not want your agent to follow npm's moving latest tag, pin the MCP server to a GitHub commit instead:

claude mcp add google-ai-search -- npm exec --yes --package github:animaios/anima-use-google#<commit-sha> -- anima-use-google

Equivalent MCP config:

{
  "mcpServers": {
    "google-ai-search": {
      "command": "npm",
      "args": [
        "exec",
        "--yes",
        "--package",
        "github:animaios/anima-use-google#<commit-sha>",
        "--",
        "anima-use-google"
      ]
    }
  }
}

Use a full commit SHA for reproducibility. GitHub installs run the package's prepare script, so the TypeScript server is built from source before npm runs the anima-use-google bin.

The MCP server talks to the sidecar over localhost; it does not bundle a browser.

2. Set up a browser sidecar (one-time, non-npm)

The npm tarball ships everything you need. After the first npx anima-use-google, the files live in ~/.npm/_npx/<hash>/node_modules/anima-use-google/ - easiest to clone:

git clone https://github.com/animaios/anima-use-google
cd anima-use-google

Firefox

  1. Register the native-messaging host:

    node native-host/install-host.cjs
    

    This writes the Firefox native-host registration for your OS:

    • Linux: ~/.mozilla/native-messaging-hosts/com.google.ai.search.json
    • macOS: ~/Library/Application Support/Mozilla/NativeMessagingHosts/com.google.ai.search.json
    • Windows: HKCU\Software\Mozilla\NativeMessagingHosts\com.google.ai.search, pointing at %USERPROFILE%\.anima-use-google\com.google.ai.search.json
  2. Load the extension in Firefox:

    • Open about:debugging#/runtime/this-firefox.
    • Click Load Temporary Add-on and pick extension/manifest.json.
    • The host process starts on the first search.
  3. Restart Firefox so the new native-messaging host is picked up.

For permanent install (loads on every FF start):

npx web-ext build --source-dir extension --overwrite-dest
# Then sign or load via about:config xpinstall.signatures.required=false (Dev/Nightly)

Chrome / Chromium / Brave

Chromium-based browsers use the extension-chromium/ sidecar. Their native messaging manifests require allowed_origins, so you need the extension id before installing the native host.

  1. Load the unpacked extension:

    • Chrome: open chrome://extensions.
    • Chromium: open chromium://extensions.
    • Brave: open brave://extensions.
    • Enable Developer mode.
    • Click Load unpacked and choose extension-chromium/.
    • Copy the generated extension id.
  2. Register the native-messaging host:

    # Google Chrome
    node native-host/install-chrome-host.cjs --browser chrome --extension-id <extension-id>
    
    # Chromium
    node native-host/install-chrome-host.cjs --browser chromium --extension-id <extension-id>
    
    # Brave
    node native-host/install-chrome-host.cjs --browser brave --extension-id <extension-id>
    

    The installer writes the manifest or registry entry for your selected browser:

    • Chrome on Linux: ~/.config/google-chrome/NativeMessagingHosts/com.google.ai.search.json
    • Chrome on macOS: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.google.ai.search.json
    • Chrome on Windows: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.google.ai.search
    • Chromium on Linux: ~/.config/chromium/NativeMessagingHosts/com.google.ai.search.json
    • Chromium on macOS: ~/Library/Application Support/Chromium/NativeMessagingHosts/com.google.ai.search.json
    • Chromium on Windows: HKCU\Software\Chromium\NativeMessagingHosts\com.google.ai.search
    • Brave on Linux: ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.google.ai.search.json
    • Brave on macOS: ~/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.google.ai.search.json
    • Brave on Windows: HKCU\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.google.ai.search

    On Windows, the manifest JSON itself is written under %USERPROFILE%\.anima-use-google\<browser>\com.google.ai.search.json, and the registry key points the browser at that file.

  3. Reload the extension so chrome.runtime.connectNative("com.google.ai.search") sees the manifest.

Switching between Firefox and Chromium-based sidecars

The MCP server always connects to the first browser native host listening on 127.0.0.1:51784. When switching browsers during development, make sure the old sidecar is not still owning that port.

  1. Disable or unload the sidecar you are not testing:

    • Firefox: remove or disable the temporary add-on from about:debugging#/runtime/this-firefox.
    • Chrome/Chromium/Brave: disable or remove the unpacked extension from chrome://extensions, chromium://extensions, or brave://extensions.
  2. Stop any stale native host:

    ps -ef | rg '[n]ative-host/host\.js'
    kill <pid>
    
  3. Register the host manifest for the browser you want:

    # Firefox
    node native-host/install-host.cjs
    
    # Google Chrome
    node native-host/install-chrome-host.cjs --browser chrome --extension-id <chrome-extension-id>
    
    # Chromium
    node native-host/install-chrome-host.cjs --browser chromium --extension-id <chrome-extension-id>
    
    # Brave
    node native-host/install-chrome-host.cjs --browser brave --extension-id <brave-extension-id>
    
  4. Reload the chosen browser extension so it reconnects to native messaging.

  5. Confirm which browser owns the host before running an E2E test:

    ps -ef | rg '[n]ative-host/host\.js|[b]rave|[c]hrome|[c]hromium|[f]irefox'
    ss -ltnp 'sport = :51784'
    

    For Chromium-based browsers, the host command should include an origin like chrome-extension://<extension-id>/. For Firefox, it is normally launched without that Chrome extension-origin argument.

3. Use it

Ask your agent normally:

Search Google AI Mode for: Next.js 15 App Router best practices

The agent calls search_google_ai, your browser sidecar opens the udm=50 search in your profile, the extension parses the AI answer with inline [1][2] citations, and the agent gets a grounded markdown response.

How it works

Agent (stdio) <---> MCP server <---> localhost TCP <---> host.js
       <---> browser native port <---> background script
       <---> opens google.com/search?udm=50&q=...
       <---> content.js parses AI answer + sources
       <---> response back along the same chain

Your logged-in Google cookies are reused because the tab is opened in your own browser profile - if you have AI Mode enabled, it works; CAPTCHAs don't trigger (real user profile, no stealth games).

The multilanguage completion detection (SVG thumbs-up → aria-label → text markers → 40s fallback) and SERPO-style citation parsing are ported from the Battle-tested google-ai-mode-mcp.

Developers

Want to hack on the MCP server or build from source:

npm install
npm run build     # tsc -> dist/
npm test          # node:test regression suite
npm link          # then `anima-use-google` on PATH

Project layout:

  • src/ + dist/ - TypeScript MCP server publishing as anima-use-google.
  • native-host/ - host.js bridges browser native messaging <-> localhost TCP; install-host.cjs writes the Firefox manifest; install-chrome-host.cjs writes the Chrome/Chromium/Brave manifest.
  • extension/ - Firefox MV3 sidecar.
  • extension-chromium/ - Chrome/Chromium/Brave MV3 sidecar using a service worker background.
  • Selector constants live in each extension's src/selectors.js - update both if Google's AI Mode DOM shifts.

Tuning

Cutoff markers (end-of-answer disclaimers, language-aware) and citation selectors are in extension/src/selectors.js and extension-chromium/src/selectors.js. If extraction fails on your locale, add your language's markers there.

License

unLICENSE. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选