browser39のロゴ

browser39

コミュニティ
alejandroqh

A headless browser for AI agents that fetches modern web pages, runs JavaScript, manages sessions, and returns token-efficient Markdown.

公開者alejandroqh
リポジトリbrowser39
言語Rust
フォーク
11
スター
86
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    browser39は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには86件のスターと11件のフォークがあります。

browser39

A headless browser for AI agents that fetches modern web pages, runs JavaScript, manages sessions, and returns token-efficient Markdown.

  • Handles modern sites. Executes JavaScript, fills forms, queries the DOM, persists cookies and sessions across runs.
  • LLM-usable output. Compact Markdown with content preselection, so the agent reads the section it needs, not the whole page.
  • Local-only. No data sent to third-party services.
  • Single binary. No Chrome, no Puppeteer. ~52MB. macOS, Linux, Windows.

Comparison

browser39Playwright / PuppeteerRaw HTTP (requests, ureq)
External browserNone (single binary)Requires Chrome/ChromiumNone
Binary size~52MB~280MB with browserN/A (library)
PlatformsmacOS, Linux, WindowsmacOS, Linux, WindowsAny
JavaScriptYes (V8 via deno_core)Yes (full V8)No
HTML to MarkdownBuilt-in, token-optimizedNo (raw HTML or screenshots)DIY
Token preselectionContent sections, agent picks what to readNoNo
Cookies & sessionsAutomatic, persisted, encryptedManualManual
DOM queriesCSS selectors + full JS DOM APIFull DOM APINo
Formsfill + submitFull interactionManual POST
Auth & secretsProfiles, redaction, opaque handlesManualManual
TransportsMCP (stdio + HTTP), JSONL, CLILibrary APILibrary API

Token savings in practice

Real test: extracting the "Optical communications" section from Artemis II on Wikipedia (full page: ~14,600 tokens).

Raw HTTPWebFetch (Claude Code built-in)Mistral Web Searchbrowser39
How it worksFetch full page, truncate to ~1,000 tokensSend full page (~14,600 tokens) to intermediate model with extraction promptCloud API: search + page processing by Mistral modelFetch → content selectors list → targeted section fetch
Tokens consumed~1,000 (truncated)~14,600 (processed by intermediate model)Cloud processed, not disclosed196
Found the section?No. Section is at token ~6,320, truncated awayYes, but returns a lossy summaryDepends on search rankingYes. Exact original content
Content qualityNav menus, infobox, article introParaphrased, no links, no referencesSummary with citationsLossless markdown with links and citations
Session stateNoneNoneNoneCookies, history, follow-up queries free
Data processingLocalProcessed remotelyProcessed remotelyLocal
Cost per callFreeBundled$30 / 1,000 callsFree
Retries neededPagination to find itNone, but no control over outputMay not find specific sectionNone. Agent sees structure first

browser39 returns the exact section in 196 tokens at zero cost. The raw approach misses it entirely, WebFetch burns 75x more tokens through an intermediate model, and cloud tools like Mistral's charge $0.03 per call.

Install

bash
npm install @aquintanar/browser39

Or via Cargo:

bash
cargo install browser39

Install for any AI CLI / IDE

Installs the binary and auto-configures it for every MCP client detected: Claude Code, Claude Desktop, Codex, OpenCode, OpenClaw.

sh
curl -fsSL https://raw.githubusercontent.com/alejandroqh/marketplace/main/h39.sh | bash

Pre-built binaries available on the releases page.

Quick Start

MCP config

Add to your MCP client config:

json
{
  "mcpServers": {
    "browser39": {
      "command": "browser39",
      "args": ["mcp"]
    }
  }
}

29 tools available instantly: browser39_fetch, browser39_click, browser39_links, browser39_dom_query, browser39_fill, browser39_submit, browser39_search, cookies, storage, history, config management, and more.

CLI: one-shot fetch

bash
browser39 fetch https://example.com
# Example Domain
This domain is for use in documentation examples without needing permission.

[Learn more](https://iana.org/domains/example)

CLI: one-shot search

Search the web using the configured search engine:

bash
browser39 search "rust async traits"

Add --output json for structured results suitable for piping into other tools.

CLI: agent integration (watch mode)

Long-running subprocess that any language can talk to via JSONL files:

bash
touch commands.jsonl
browser39 watch commands.jsonl --output results.jsonl
bash
# From your agent (Python, Node, Rust, shell, anything):
echo '{"id":"1","action":"fetch","v":1,"seq":1,"url":"https://example.com"}' >> commands.jsonl

Drop-in web_search and visit_website tool examples: Python | TypeScript | Rust

See docs/install-cli.md for the full integration guide.

Rust library

Embed browser39 directly in a Rust application — no subprocess, no IPC.

toml
[dependencies]
browser39 = "1.8"
tokio = { version = "1", features = ["full"] }
anyhow = "1"
rust
use std::collections::HashMap;

use browser39::{BrowserService, Config, HttpMethod, InMemoryStore, SessionStore};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let store: Box<dyn SessionStore> = Box::new(InMemoryStore);
    let mut service = BrowserService::new(Config::default(), store).await?;

    let options = service.default_fetch_options();
    let page = service
        .fetch(
            "https://example.com",
            &HttpMethod::Get,
            &HashMap::new(),
            None,
            None,
            &options,
        )
        .await?;

    println!("{}", page.markdown);
    Ok(())
}

The crate root re-exports the common types: BrowserService, Config, PersistenceMode, FetchOptions, HttpMethod, SessionStore, InMemoryStore, create_session_store. Lower-level modules (browser39::core, browser39::cli, browser39::mcp) are also public if you need direct access to the HTML→Markdown engine, JSONL runner, or MCP server.

Features

Token optimization

browser39 minimizes token usage when feeding web content to LLMs:

  • Content preselection: on first fetch, returns available content sections with token estimates instead of dumping the full page. The agent picks the relevant section and re-fetches with a targeted selector.
  • Heading auto-expand: selector: "#Astronauts" returns the full section until the next same-level heading, not just the heading text.
  • HTML to Markdown: strips scripts, styles, and non-content elements.
  • Compact link references (JSON mode): [text][N] instead of inline URLs, with full URLs in the links array.
  • Same-origin URL shortening: links on the same domain show path-only.
  • Link deduplication: same-URL links (image + headline cards) emitted once.

JavaScript execution

V8 (via deno_core) runs JavaScript against a full DOM environment:

  • Traversal: parentElement, children, firstChild, lastChild, nextSibling, previousSibling, closest(), matches(), contains()
  • Lookup: getElementById, getElementsByClassName, getElementsByTagName, getElementsByName
  • Mutation: createElement, createTextNode, appendChild, removeChild, insertBefore, setAttribute, removeAttribute, textContent/innerHTML setters
  • Events: addEventListener, removeEventListener, dispatchEvent, new Event/CustomEvent/MouseEvent/KeyboardEvent/InputEvent
  • Web APIs: localStorage, document.cookie, console.log (captured), setTimeout, atob/btoa, getComputedStyle, MutationObserver
  • Forms: element.value get/set, element.click(), form.submit()
json
{"action": "dom_query", "script": "document.querySelectorAll('a').length"}
{"action": "dom_query", "script": "document.getElementById('content').closest('section').textContent"}
{"action": "dom_query", "script": "document.querySelector('h1').setAttribute('class', 'modified')"}

Session persistence

Cookies, localStorage, and browsing history are persisted to disk by default (~/.local/share/browser39/session.enc, AES-256-GCM encrypted). An agent can log in once and stay authenticated across restarts.

Disable with --no-persist or config:

toml
[session]
persistence = "memory"

Forms

Fill fields by CSS selector and submit. browser39 handles enctype, builds the HTTP request, and returns the response page:

json
{"action": "fill", "fields": [{"selector": "#user", "value": "agent"}, {"selector": "#pass", "value": "secret", "sensitive": true}]}
{"action": "submit", "selector": "form#login"}

Security

Auth profiles keep credentials out of the LLM conversation. The agent references a profile name and never sees the token:

toml
[auth.github]
header = "Authorization"
value_env = "GITHUB_TOKEN"
value_prefix = "Bearer "
domains = ["api.github.com"]
json
{"action": "fetch", "url": "https://api.github.com/repos", "auth_profile": "github"}

Config management via MCP

Agents can manage browser39's configuration directly through MCP tools: change the search engine, store credentials, manage auth profiles, cookies, storage, and headers. Sensitive values are stored securely on disk but never returned via MCP; config_show masks them with ••••••.

> browser39_config_set key="search.engine" value="https://www.google.com/search?q={}"
Set search.engine = https://www.google.com/search?q={}

> browser39_config_auth_set name="github" header="Authorization" value="Bearer ghp_..." domains=["api.github.com"]
Auth profile 'github' saved

> browser39_config_show section="auth"
{"auth": {"github": {"header": "Authorization", "value": "••••••", ...}}}

10 config tools: config_show, config_set, config_auth_set/delete, config_cookie_set/delete, config_storage_set/delete, config_header_set/delete.

All transports

TransportCommandUse case
MCP (stdio)browser39 mcpLocal MCP clients
MCP (HTTP)browser39 mcp --transport sse --port 8039Remote agents, cloud deployments
JSONL watchbrowser39 watch commands.jsonlAny language, long-running agent IPC
JSONL batchbrowser39 batch commands.jsonlOne-shot scripted operations
CLI fetchbrowser39 fetch <url>Quick page retrieval, shell scripts
CLI searchbrowser39 search <query>Quick web search from shell scripts
Rust librarycargo add browser39Embed in Rust apps, no subprocess

Configuration

bash
browser39 --config path/to/config.toml fetch https://example.com

Precedence: --config flag > BROWSER39_CONFIG env > ~/.config/browser39/config.toml

See docs/config.md for the full reference.

Documentation

DocDescription
install-cli.mdCLI integration guide with Rust, Python, TypeScript examples
jsonl-protocol.mdFull JSONL protocol specification
config.mdConfiguration reference

Development

bash
cargo build              # Build
cargo run                # Run
cargo test               # Run all tests
cargo clippy             # Lint
cargo fmt                # Format

Contributors

@nathan-widjaja

@janpauldahlke

License

Apache-2.0

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "alejandroqh-browser39": {
      "command": "",
      "args": []
    }
  }
}

browser39のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度browser39に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

browser39をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. browser39のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "alejandroqh-browser39": {
      "command": "npx",
      "args": [
        "-y",
        "browser39"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてbrowser39のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. browser39のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
browser39を使ってこのタスクを手伝ってもらえますか?
browser39
はい、読みました。
browser39で調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

browser39がすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックします。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にお使いのサーバーURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にお使いのサーバーURLを貼り付けてください。
  2. browser39の接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックします。
  2. MCPコネクタの一覧に戻ってください。
  3. browser39の接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でbrowser39のツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でbrowser39のツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
browser39を使ってこのタスクを手伝ってもらえますか?
browser39
はい、読みました。
browser39で調べた結果をお伝えします。

よくある質問

browser39 MCPサーバーは何に使いますか?

browser39は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでbrowser39 MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでbrowser39を利用できます。

TypingMindでbrowser39 MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。browser39を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

browser39 MCPをTypingMindに接続するにはどうすればよいですか?

browser39は、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでbrowser39 MCPのどのようなツールを利用できますか?

browser39はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

browser39 MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。browser39で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇