开源项目 GitHub Topic ai-agent 2026-09-14T12:01 正文 ok 900 words

AIHawk:开源 MCP 隐身浏览与 AI 网页自动化 Agent

英文标题:📦 feder-cr/AIHawk

AIHawk 是一个开源 MCP 服务器与网页浏览 Agent,主打低检测浏览、AI 网页抓取及计算机操作自动化,可通过 Claude Code、Codex、Gemini CLI 等客户端接入。项目提供独立 Web UI,需要用户自备 OpenRouter API Key,并支持代理、持久化浏览器配置文件、固定浏览器身份种子和本地浏览器二进制文件等选项。其底层组件包括兼容 Playwright API 的 invisible_playwright,以及用于浏览器指纹、代理和地理位置配置的 invisible_core。项目强调所有会话、配置文件和截图均保存在本地,但网页内容及对话信息会按使用方式发送至模型提供商。
打开原文相关 5.6 · 机会 8
media41.9 KB media41.9 KB media53.2 KB

中文


使用这个浏览器 Agent 的两种方式

1. 通过 MCP 从你的助手中使用

Windows,在 PowerShell 中:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "$env:USERPROFILE\.local\bin;$env:Path"
uvx invisible-playwright fetch

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uvx invisible-playwright fetch

然后告诉你的助手它已经存在。

Claude Code:

claude mcp add --scope user stealth -- uvx aihawk

Codex:

codex mcp add stealth -- uvx aihawk

Gemini CLI:

gemini mcp add --scope user stealth uvx aihawk

2. 独立使用:Web UI

我们提供界面,你提供一个 OpenRouter Key。左侧聊天,右侧实时浏览器。

Windows,在 PowerShell 中:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "$env:USERPROFILE\.local\bin;$env:Path"
uvx invisible-playwright fetch
uvx aihawk ui --openrouter-key sk-or-...

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uvx invisible-playwright fetch
uvx aihawk ui --openrouter-key sk-or-...

然后打开 http://127.0.0.1:8765,输入相同的内容。


可以让网页浏览 Agent 做什么

任何需要真实网页自动化的任务:需要浏览器而不是 API,并且需要人的判断来理解页面上的内容。

前往 <粘贴 URL>。单程,米兰至里斯本,经济舱,1 件托运行李,1 名成人。逐个查询下个月 12 日至 16 日的每一天,并读取每天的最低票价。日期字段是日历控件,因此请点击日期,而非手动输入。如果某个日期没有可用航班,请说明。不要猜测数字。

它会像人一样操作页面:移动指针、按下按键。

选项:代理、配置文件、种子

  • --openrouter-key 你的 Key,或者 OPENROUTER_API_KEY 变量。
  • --model OpenRouter 模型 ID,或者 AIHAWK_MODEL。默认为 z-ai/glm-5.3-flash。
  • --proxy 可选。http://user:pass@proxy.example.com:8080 或 socks5://proxy.example.com:1080。必须同时提供主机和端口。时区、语言区域和出口网络均会随之匹配。
  • --binary 你已有的引擎二进制文件。它必须是 seal 固定的构建版本,否则启动会被拒绝:这会跳过下载,但不会跳过版本检查。
  • --seed 一个整数。相同的种子,每次运行都会得到相同的浏览器身份。
  • --profile-dir 用于保存浏览器配置文件的目录,使登录状态和 Cookie 在重启后仍可保留。
  • --headed 显示浏览器窗口。界面本身仍会向你展示页面。
  • --host、--port 默认为 127.0.0.1 和 8765。更改 host 会暴露一个没有身份验证的界面。

命令旁的 .env

无需反复输入 Key 和二进制文件路径;可将它们放在执行命令所在目录的 .env 文件中:

OPENROUTER_API_KEY=sk-or-...
STEALTHFOX_BINARY=/path/to/firefox

它会在启动时读取,并且在读取过程中绝不会覆盖已设置的值,因此优先级为:--flag > 环境变量 > .env > 默认值。只会读取你当前所在目录,不会向上搜索;因此,从子目录运行时不会在不知情的情况下使用其他 Key。启动日志会列出已应用的变量名称,但绝不会打印它们的值。

传递 --openrouter-key 会将 Key 写入 Shell 历史记录;在 Linux 上,它还会出现在进程列表中。通过环境变量或 .env 设置 OPENROUTER_API_KEY 可以避免这两种情况。

Wiki:AI 浏览器 Agent 指南

围绕该 Agent 的资料库位于 wiki:其中包括 AI 浏览器 Agent 生态:browser-use、Operator 风格与 computer-use Agent 对比、当 Agent 被拦截时该检查什么,以及 OpenAI Operator 发生了什么 等内容。完整示例、操作记录及其输出位于 articles/。

其他组件:引擎、核心库

选项 1 中的 MCP 服务器已包含在此软件包内:不带子命令的 aihawk 即为服务器,aihawk ui 则为界面。针对使用配置文件的客户端,其配置块、设置和工具均可在 Wiki 页面 MCP server 中查看。

  • invisible_playwright 引擎,以 Python 库形式提供,适合通过编写代码而非 Prompt 来使用。其 API 与 Playwright 一致。
  • invisible_core 从种子到指纹、偏好设置、代理和地理位置的核心组件。

这会自动化操作由你控制的浏览器。请阅读你所访问网站的服务条款,遵守其速率限制,不要提交任何未经人工阅读的内容。

AIHawk 在你的本机运行,没有自己的服务器。哪些信息会离开你的计算机,以及发送给谁:

  • 你访问的网站。 它们会看到浏览器,就像看到任何 Firefox 浏览器一样。
  • 你的模型提供商。 Web UI 会通过你的 Key,将对话内容以及 Agent 从页面读取的内容发送给 OpenRouter。通过 MCP 使用时,你接入的客户端会将相同内容发送给它所使用的模型。
  • GitHub。 引擎由 uvx invisible-playwright fetch 从 GitHub Release 下载;设置代理时还会下载 GeoIP 数据库。每次浏览器启动时,也会从 GitHub Release 获取一个单行计数器文件,以此统计启动次数:该请求不携带标识符,也不包含你的任何信息;GitHub 只能看到任何 HTTPS 请求都会暴露的信息,即你的 IP 地址。

不会收集其他任何信息,也不会向作者发送任何内容。会话、配置文件和截图均存储在本地:如果设置了 AIHAWK_HOME,则存储于该位置;否则存储在系统的应用数据目录中。它们可由你自行删除,其他任何地方均不会保留。问题请提交至 issues。

MIT。2026 年 9 月 2 日之前发布的所有内容均采用 AGPL-3.0 许可,并继续遵循该许可。

English / 原文


Two ways to use this browser agent

1. From your assistant, over MCP

Windows, in PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "$env:USERPROFILE\.local\bin;$env:Path"
uvx invisible-playwright fetch

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uvx invisible-playwright fetch

Then tell your assistant it exists.

Claude Code:

claude mcp add --scope user stealth -- uvx aihawk

Codex:

codex mcp add stealth -- uvx aihawk

Gemini CLI:

gemini mcp add --scope user stealth uvx aihawk

2. Standalone: the web UI

We bring the interface, you bring an OpenRouter key. Chat on the left, the live browser on the right.

Windows, in PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "$env:USERPROFILE\.local\bin;$env:Path"
uvx invisible-playwright fetch
uvx aihawk ui --openrouter-key sk-or-...

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uvx invisible-playwright fetch
uvx aihawk ui --openrouter-key sk-or-...

Then open http://127.0.0.1:8765 and type the same thing.


What to ask a web browsing agent

Anything that needs real web automation: a browser rather than an API, and a person's judgement about what is on the page.

Go to <paste the URL>. One way, Milan to Lisbon, economy, one checked bag, one adult. Check every date from the 12th to the 16th of next month, one at a time, and read the cheapest fare for each day. The date field is a calendar widget, so click the days rather than typing them. If a date has no availability, say so. Do not guess a number.

It drives the page the way a person would: the pointer moves, keys are pressed.

Options: proxy, profile, seed

  • --openrouter-key Your key, or the OPENROUTER_API_KEY variable.
  • --model An OpenRouter model id, or AIHAWK_MODEL. Defaults to z-ai/glm-5.3-flash.
  • --proxy Optional. http://user:pass@proxy.example.com:8080 or socks5://proxy.example.com:1080. Host and port are both required. The timezone, locale and egress follow it.
  • --binary An engine binary you already have. It must be the build the seal pins, or startup refuses: this skips the download, not the version check.
  • --seed An integer. Same seed, same browser identity, every run.
  • --profile-dir A directory to keep the profile in, so logins and cookies survive restarts.
  • --headed Show the browser window. The interface shows you the page anyway.
  • --host, --port 127.0.0.1 and 8765. Changing the host exposes an interface that has no authentication.

A .env beside the command

Rather than retyping the key and the binary path, put them in a .env in the directory you run from:

OPENROUTER_API_KEY=sk-or-...
STEALTHFOX_BINARY=/path/to/firefox

It is read at startup, and on the way in it never overrides something already set, so the order is --flag > the environment > .env > the default. Only the directory you are in is read - there is no search upwards, so running from a subfolder cannot silently pick up a different key. The startup line names the variables it applied and never prints their values.

Passing --openrouter-key puts the key in your shell history, and on Linux in the process list. OPENROUTER_API_KEY in the environment or in a .env avoids both.

The wiki: AI browser-agent guides

The reading room around the agent lives in the wiki: the AI browser-agent landscape: browser-use, Operator-style and computer-use agents compared, what to check when an agent gets blocked, and what happened to OpenAI Operator, among others. Worked examples, transcripts and their outputs live in articles/.

The rest of the family: engine, core

The MCP server from option 1 ships inside this package: aihawk with no subcommand is the server, aihawk ui the interface. Its config blocks for clients that take a file, its settings and its tools are on the wiki page The MCP server.

  • invisible_playwright The engine, as a Python library, for writing code instead of prompts. The API is Playwright's.
  • invisible_core Seed to fingerprint to preferences, proxy and geolocation.

This automates a browser under your control. Read the terms of the sites you point it at, respect their rate limits, and do not submit anything a human has not read.

AIHawk runs on your machine and has no server of its own. What leaves your computer, and to whom:

  • The sites you visit see the browser, as they would any Firefox.
  • Your model provider. The web UI sends the conversation and what the agent reads on the page to OpenRouter under your key. Over MCP, the client you plugged it into does the same with whichever model it uses.
  • GitHub. The engine is downloaded from a GitHub release by uvx invisible-playwright fetch, and a GeoIP database is when a proxy is set. Each browser launch also fetches a one-line counter file from a GitHub release, which is how launches are counted: the request carries no identifier and nothing of yours, and GitHub sees what any HTTPS request shows, your IP address.

Nothing else is collected and nothing is sent to the author. Sessions, profiles and screenshots are stored locally, under AIHAWK_HOME if set and otherwise in the application-data directory of your system, and are yours to delete; nothing is retained anywhere else. Questions go to the issues.

MIT. Everything distributed before 2 September 2026 was released under AGPL-3.0 and stays under it.