Skip to main content
Glama
TrueNix

agent-browser

by TrueNix

agent-browser

AIエージェント向けの堅牢化されたローカルブラウザ。依存関係ゼロ。 お使いのChromeをDevToolsプロトコル経由で操作し、トークン効率の良いMarkdownを抽出します。自動化ツールとして簡単に検出されることはありません。

サーフェス

インストール方法

用途

MCP サーバー

npx -y @truenix/agent-browser mcp

Claude Code、Cursor、Codex、任意のMCPクライアント

CLI

npx -y @truenix/agent-browser markdown <url>

シェル、スクリプト、CI

ライブラリ

import { withBrowser } from '@truenix/agent-browser'

自作のNodeコード

DSH / Cordis プラグイン

コンポジションの行

DSHハーネスでのネイティブツール

npx -y @truenix/agent-browser markdown https://news.ycombinator.com

すべてローカルで動作します。アカウント不要、APIキー不要、リモートサービス不要、割り当て枠なし。

なぜ

エージェントに生のHTMLを渡すと、トークンの大部分が無駄になります。実際のページで測定した結果:

ページ

html

markdown

テキスト

削減率

en.wikipedia.org/wiki/WebAssembly

835 kB

95 kB

51 kB

8.8×

news.ycombinator.com

34 kB

6 kB

4 kB

5.2×

さらに、自動化として自己申告するブラウザは、検出されたり、異なるコンテンツを配信されたりします。これは、エージェントが受け取るデータを静かに劣化させます。

Related MCP server: Browser-MCP Navigator

インストール

MCPサーバーとして

claude mcp add browser -- npx -y @truenix/agent-browser mcp
{
  "mcpServers": {
    "browser": {
      "command": "npx",
      "args": ["-y", "@truenix/agent-browser", "mcp"]
    }
  }
}
npm install @truenix/agent-browser

ツール: browser_markdownbrowser_htmlbrowser_linksbrowser_screenshotbrowser_pdfbrowser_consolebrowser_probe

ライブラリとして

import { withBrowser } from '@truenix/agent-browser';

const md = await withBrowser({}, async (session) => {
  await session.navigate('https://example.com');
  return session.markdown();
});
npx -y @truenix/agent-browser install          # edits ~/.dsh/profiles/web/cordis.patch.yml + package.json, then pnpm install
# npx -y @truenix/agent-browser install --profile web --dry-run  # preview
# npx -y @truenix/agent-browser uninstall      # remove again

DSH / Cordisプラグインとして

ワンライナー(推奨 — DSH環境では自動で配線されます):

npm i -g @truenix/agent-browser
# or inside the harness checkout: pnpm add @truenix/agent-browser

browser_markdownbrowser_htmlbrowser_linksbrowser_screenshotbrowser_evaluate がDSHのホストにネイティブツールとして表示されます。npx を手動で実行する必要はありません。

手動設定(コンポジションを自分で編集したい場合):

# ~/.dsh/profiles/web/cordis.patch.yml  — persists for every web session
- insert:
  - id: agent-browser
    name: '@truenix/agent-browser/cordis'
    config:
      timeoutMs: 180000   # per-tool call budget; default respects AGENT_BROWSER_BIN / ENDPOINT
      # cli: 'npx -y @truenix/agent-browser'  # override only if needed

Cordisプラグインの設定:

- '@truenix/agent-browser/cordis':
    timeoutMs: 180000

設定キー:

agent-browser <command> [options]

  markdown <url>     Extract the page as Markdown (main content by default)
  text <url>         Visible text only
  html <url>         Full serialized DOM after JavaScript runs
  links <url>        Every anchor as JSON
  screenshot <url>   PNG/JPEG   (-o file, --full)
  pdf <url>          PDF        (-o file)
  a11y <url>         Filtered accessibility tree
  eval <url> <expr>  Evaluate JS in the page
  probe              Browser, GPU and capability report
  mcp                Run as an MCP server on stdio

CLI

agent-browser markdown <url> [options] — ページをMarkdownとして取得します。

agent-browser html <url> [options] — 加工前のHTMLを取得します。

agent-browser links <url> [options] — ページのリンクを抽出します。

GXP11

オプション: --headful--no-stealth--block-images--gpu/--no-gpu--width--height--viewport WxH--main--raw--full--endpoint <url>--timeout <ms>--json-o

--endpoint はブラウザを起動せずに既存のブラウザへ接続します。多くの呼び出しにまたがって1つのブラウザを再利用するのに便利です。

検出回避

通常のヘッドレスChromeとは異なり、navigator.webdriverfalse のままになります。 生のCDPは --enable-automation フラグを追加しないため、navigator.webdriverundefined のままです。ただし、それをさらに強化するための対策がいくつかあります。

シグナル

プレーンなヘッドレス

このプロジェクト

navigator.webdriver

true

false/未定義

ヘッドレスUA

--enable-automation

あり

なし

外部からの視認性

高い

低い

強化された条件で bot.sannysoft.com を実行すると、合格 となります。 bot-detector.rebrowser.net も同様に 合格 です。

検出について

検出は、以下の2つの大きなカテゴリに分けられます。

  1. JavaScript による検出navigator.webdriver、プロパティの欠落、Chrome DevTools Protocol の起動時の痕跡。

  2. ネットワークレベルのフィンガープリンティング — TLS フィンガープリント、IP 評判、HTTP/2 のフレーム順序。

このプロジェクトは カテゴリ1 に対処し、ブラウザをよりクリーンに、より標準的に見せます。カテゴリ2 はユーザー自身のネットワークの評判に依存するため、範囲外です。

CDP 検出

最も永続的な CDP 検出方法の1つは、Runtime.enable が呼び出された後に Error.stack が変更される ことです。Puppeteer と Playwright はどちらも Runtime.enable を呼び出すため、CDP 駆動のブラウザは起動直後に検出されます。

このプロジェクトは 決して Runtime.enable を呼び出しません。 代わりに、Runtime.evaluateawaitPromise 付きで使用して、ページコンテキスト内のプロミスを解決します。これはクリーンな方法で、Runtime.enable の痕跡を残しません。

最新のテスト結果 (npm run test:bot)

検出器

結果

bot.sannysoft.com

31 合格、0 不合格

bot-detector.rebrowser.net

6 グリーン、0 レッド

deviceandbrowserinfo.com

弱いシグナルなし、検出されず

技術的詳細

puppeteer-extra-plugin-stealth は使用していません。これは壊れやすい Function.prototype.toString のパッチに依存しており、多くのパッチ(chrome.runtimepermissionslanguages など)は現代のChromeでは不要であるか、検出可能です。代わりに、オリジナルのChromeバイナリをフラグ付きで起動し、特定のCDPコールのみを使用します。

ゼロ依存関係

dependencies は空です。Nodeのグローバル WebSocket(Node ≥ 22)または組み込みの node:http を使用してCDPに接続します。Chromeの起動と管理には node:child_process、Markdownへの変換には独自のDOMウォーカーを使用します。

環境変数

変数名

説明

AGENT_BROWSER_BIN

Chrome/Chromium バイナリへのパス(自動検出を上書き)

AGENT_BROWSER_ENDPOINT

起動せずに接続するCDPエンドポイントURL

AGENT_BROWSER_HEADLESS

"false" に設定するとヘッドフルモードで起動

AGENT_BROWSER_ARGS

追加のChrome引数(スペース区切り)

AGENT_BROWSER_USER_DATA

Chromeのユーザーデータディレクトリ(指定しない場合は一時ディレクトリ)

GXP12

ライセンス

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    MCP server for browser automation with anti-detection. Scout pages, find elements, interact with websites, and monitor network traffic from any AI client that supports the Model Context Protocol.
    21
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A fault-tolerant, stealth-enabled Model Context Protocol (MCP) server for web searching and content fetching. Built for AI Agents (Cursor, Claude Code, OpenCode), it uses a stealth browser engine to fetch pages, dynamically handles SPAs/React, and converts bloat into token-optimized Markdown.
    2
    319
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server that lets agents drive your real Chrome browser with existing logins and sessions via an outbound-only WebSocket extension. It exposes Playwright-compatible browser tools for navigation, clicking, typing, and snapshots.
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.

  • Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.

  • Headless-browser-as-JSON with memorymarket cache economics. Real Chromium, crypto settlement.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TrueNix/agent-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server