Opencli MCPのロゴ

Opencli MCP

コミュニティ
jackwener

OpenCLI reborn as an MCP-native browser runtime: Chrome-spawned host, object API + code mode, site capabilities, recon

公開者jackwener
リポジトリopencli-mcp
言語TypeScript
フォーク
11
スター
99
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

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

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

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

  • コピーして使える設定

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

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

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

opencli-mcp

A browser service for MCP agents, connected to the Chrome you're already logged into.

opencli-mcp lets MCP clients observe and operate your Chrome tabs through a local extension and host. Optional site adapters package verified workflows as reusable tools.

npm Chrome Web Store Node.js License: Apache-2.0

Quick start · Usage · Documentation · 中文指南

What you can do

  • Work with logged-in websites. Search, read pages, fill forms, and navigate through your existing browser session.
  • Use optional site commands. Discover built-in adapters for Twitter/X, Bilibili, and Reddit when a site-specific command helps.
  • Add site adapters. Inspect a site's requests, verify an API, and define an explicit reusable MCP tool.
  • Keep browser work organized. Agent-created tabs live in named groups and are cleaned up after use. Tabs borrowed from the user are never closed by session cleanup.

Works with MCP clients including Claude Code, Codex, OpenCode, Cursor, Claude Desktop, DeepSeek Harness (dsh), and Pi (with pi-mcp-adapter). Agents use a persistent JavaScript REPL for browser work and structured site tools for verified workflows.

Quick start

You need Node.js 22 or newer, Google Chrome, and an MCP client. The local host also supports Chromium-based browsers such as Edge and Brave; see installation details.

1. Install the Chrome extension

Install opencli-mcp from the Chrome Web Store →

For an extension version ahead of the Web Store, download the manual-install zip from GitHub Releases and follow the manual installation steps.

2. Install the npm package and set up the connection

bash
npm install -g opencli-mcp
opencli-mcp setup

Keep Chrome open. setup connects the extension to the local program, asks which MCP clients to configure, registers only your selection, and checks the browser connection. If you have not installed the extension yet, it opens the Chrome Web Store for you.

For Cursor, Claude Desktop, and other MCP clients, choose manual and copy the configuration printed by setup into your client's MCP settings. It uses absolute paths so desktop apps can find the program.

For OpenCode, run opencli-mcp setup --clients opencode. It adds a global MCP entry while preserving your other settings.

For DeepSeek Harness (dsh), run opencli-mcp setup --clients none, then add the same npm package to your dsh profile:

bash
dsh plugin --profile web add opencli-mcp

Restart dsh web. The package's dsh bundle uses dsh's MCP client to connect to the browser service. See the dsh setup details.

For Pi, install pi-mcp-adapter, then run opencli-mcp setup --clients pi. See the Pi setup steps.

3. Start using it

Restart or reconnect your MCP client, then ask:

Use opencli-mcp to read the top five Hacker News stories and summarize them with links.

You can rerun opencli-mcp setup to repair the browser registration or select newly installed clients to configure. Selected clients have their opencli-mcp entry updated to a stable launcher; other server entries are preserved. The launcher follows Homebrew upgrades within the same formula. If Node or the package moves, rerun setup. For a read-only startup and connection check, run opencli-mcp doctor.

Connection issues? See troubleshooting.

Usage

Tell your agent what you want to do; it discovers and calls the MCP tools. For example:

  • “Open Hacker News, read the newest stories, and keep the most useful page open for me.”
  • “Search for site commands that work with Bilibili.”
  • “Explore this website's search, then create a reusable tool for the same query workflow.”

For integrations and custom workflows, the main tools are:

TaskTools
Browser workspacejs, js_reset
Discover and run site commandssites_search, site_run
Learn the APIdocs_get (quickstart, topics, or an exact API member)
Diagnose connection and executiondoctor
Finish a browser sessionsession_finalize

The browser workflow is observe → act → verify → finalize, expressed in js using the same object model as adapters:

js
let tab = await browser.tabs.new('https://example.com/');
await tab.observe();

Variables, functions, classes and Tab handles persist across calls. After inspecting the result, use await tab.act(...) and await tab.expect(...) or observe again. Keep working data in variables and return only relevant evidence. docs_get {} provides a compact quickstart; {name:"api-reference",member:"Tab.act"} provides exact types. No repository documentation access is required.

Use browser.user.openTabs({query,limit}) and browser.user.claimTab(...) for user tabs. The lookup returns up to 20 recent matches by default. tab.release() leaves a tab open; tab.close() closes it. session_finalize closes agent tabs not kept and releases borrowed tabs. js_reset stops JavaScript and clears bindings while leaving tabs open; already dispatched operations may still complete. All API methods are awaited.

Inside the js tool, you can also call site commands directly:

js
await sites.enable('reddit');
const posts = await sites.reddit.hot({ subreddit: 'programming', limit: 5 });
posts;

See the JavaScript guide, API reference, and tool authoring guide for complete examples.

How it works

text
MCP client → opencli-mcp launcher → local host ⇄ Chrome extension → website
                stdio              Native Messaging             your session

Chrome starts the local host through Native Messaging. The extension operates browser tabs using Chrome's debugger APIs and Playwright's injected locator engine. The host exposes browser operations, site commands, and tool authoring through MCP. Each MCP client connection has its own tab and JavaScript session, so one client's cleanup does not close another client's tabs.

The MCP launcher can start before Chrome. It keeps the client connection open and reconnects when the Chrome-owned host appears or restarts. Browser operations and site adapters use that host; run opencli-mcp doctor if it stays unavailable.

The host also supports Streamable HTTP for remote clients. See remote access and configuration.

Browser access and permissions

The extension requests browser permissions including debugger, cookies, and access to all URLs so it can operate logged-in sites. Connected agents can act with the access available in your browser session.

Site commands execute directly without additional approval prompts. The read/write classification describes their effects. See configuration.

Documentation

GuideContents
Installation and configurationSource installs, browser profiles, remote clients, settings, troubleshooting
中文指南Chinese project overview and detailed usage
Site commandsDiscovering, enabling, and running adapters
JavaScript guidePersistent sessions and the object API
API referenceGenerated reference for browser and tool APIs
Creating toolsDefine and verify reusable site adapters
Tab lifecycleClaiming tabs, grouping, and cleanup
ErrorsError codes and recovery

Development

bash
git clone https://github.com/jackwener/opencli-mcp.git
cd opencli-mcp
npm install
npm run typecheck

npm install builds the project through its prepare script. To connect a development build to Chrome, follow the unpacked-extension instructions.

bash
npm run build:ext        # rebuild the extension
npm test                 # focused regression tests
npm run smoke:setup      # isolated setup and Native Messaging end-to-end check
npm run smoke:browser    # end-to-end check with a connected Chrome extension

Run the tests relevant to your change. npm run check runs typecheck, build, and the full test suite when a broader check is needed. For browser changes, use the browser smoke test. docs/api-reference.md is generated during the build; update its TypeScript source rather than editing the generated file.

Maintainers: use the release workflow to publish the npm package and GitHub Release.

Found a bug or have a feature request? Open an issue. See CHANGELOG.md for release history.

License and credits

Apache-2.0. Some browser helpers and adapters were adapted from OpenCLI; no OpenCLI dependency or compatibility layer is required. Uses Playwright's injected locator engine. Endpoint analysis is inspired by jsluice.

Native browser APIs

The REPL also exposes browser.chrome.call(method, argsArray) for native Chrome APIs, tab.cdp.send(method, params) for an explicit Tab, and writable Main World tab.evaluate(script, {arg, timeoutMs}). Use browser.chrome.describe("tabs.query") for on-demand signatures and runtime availability. Chrome/CDP events and page/extension logs support bounded subscriptions with explicit loss/reset information. Read docs_get {name:"capabilities/chrome"} inside MCP for examples and lifecycle rules, or the native capabilities guide.

For development, npm run smoke:native runs the new flows in a disposable Chromium profile after a build. Set OPENCLI_SMOKE_CHROME to a Chromium executable when it is not available in the local Playwright cache. It does not modify the everyday browser profile or native-host registration.

インストール

TypingMind
{
  "mcpServers": {
    "opencli-mcp": {
      "command": "node",
      "args": [
        "dist/src/main.js",
        "setup"
      ]
    }
  }
}

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

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Opencli MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

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

Opencli MCPをサーバーとして追加

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

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

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

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

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

よくある質問

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

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

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

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

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

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

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

Opencli MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

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

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

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

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

関連するMCPサーバー

すべて見る

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

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