Mantis

io.github.perzianhq由 GitHub 帳號 perzianhq 發布v0.1.13更新於 Nov 6, 2026

The web as short, numbered text for AI agents: a lean browser interface over Playwright.

概覽

AI 產生的概覽

Mantis 是本地執行的 Playwright 瀏覽器 MCP 伺服器,讓助理以簡短編號文字而非截圖的方式瀏覽網頁。

可以做什麼
  • 開啟網址並以編號文字讀取頁面,再依編號操作元素
  • 搜尋頁面文字,點擊、輸入、選擇選項、填寫表單、按鍵、捲動、懸停與上一頁
  • 等待文字或元素狀態,管理分頁,並將本機檔案上傳到檔案輸入欄位
  • 從圖片、SVG 與畫布擷取文字、表格列與圖表數值,必要時使用 OCR 與最後手段的截圖檢視
  • 遇到驗證碼、兩步驗證、付款或登入時交由真人處理,頁面變動後繼續
適用情境
適合助理需要閱讀與操作真實網站的場合:瀏覽頁面、填寫表單、擷取表格或圖表資料,或完成多步驟網頁任務,並希望以精簡文字檢視比無障礙樹或截圖更節省 token。
執行需求
以本機 stdio 程序從 npm 套件 mantis-browser 安裝執行(透過 npx 使用 Node.js);未宣告需要帳號、API 金鑰或環境變數。登入與機器人阻擋依賴真人接手,需要顯示環境。
安裝前請注意
頁面文字屬於不可信資料,伺服器要求助理不要執行其中的指令。工具會點擊、輸入、填寫、上傳本機檔案並送出表單,會改變遠端狀態;上傳會把本機檔案路徑送到頁面。它不破解驗證碼,而是交由真人處理。目前是小型 v0.1.x 測試版,不支援畫布輸入。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mantis,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[mantis]

Lets AI agents browse the web as short, numbered text instead of screenshots.

perzian.dev/mantis · by Perzian

It works with Claude Code, Codex, Cursor or your own agent as an MCP server. Install in two commands.

bash
npx -y -p mantis-browser mantis installclaude mcp add mantis -- npx -y -p mantis-browser mantis-mcpnpx -y -p mantis-browser mantis read https://example.com   # try it without an agent

Windows, Linux servers and other agents: SETUP.

[Side-by-side replay of the same task with Mantis and Playwright MCP: Mantis finishes in 11 calls and about 238k input tokens, Playwright MCP in 25 calls and about 887k]

One real task (Luna, each tool’s median run of 5 by input tokens, replayed): about half the time, over 3.5x fewer input tokens, less than half the calls. Across all 5 runs: 3-5x fewer tokens, about half the time, 11-12 calls vs 21-29. This is a selected example from 16 long tasks; medians across all 16 are in Results. Full video.

Security and threat model: SECURITY.md.

How it works

[Agent sends open/click to Mantis; Mantis reads the page in Chromium, numbers each control and returns only what changed; CAPTCHA, 2FA and payment go to you]

What the agent sees

[A shop page with a cookie popup becomes 8 numbered lines; after click #3 only the changes come back]

Results

Mantis vs the accessibility tree (Playwright MCP) on public sites, gpt-6-luna and claude-haiku-5-5. Every cell is a per-run median; time is end-to-end wall time per run:

0.1.11: headline numbers are 0.1.9's; later builds checked on Dickens (Luna, Haiku) and the capability-v1 local set.

Long tasks (correct: 14 keyed tasks, 42 runs per cell; medians: all 16 tasks, 48 runs per cell; both approaches run in the same session):

Luna MantisLuna treeHaiku MantisHaiku tree
Correct35/4234/4240/4240/42
Input tokens (median)244k345k268k506k
Tool calls (median)17241930
Time (median)42s66s54s85s

Short tasks (30 tasks, 90 runs per cell; tree and screenshot columns are the earlier 20261026 run):

Luna MantisLuna treeLuna screenshotHaiku MantisHaiku treeHaiku screenshot
Correct88/9086/9090/9090/9088/9088/90
Input tokens (median)64k99k104k38k88k33k
Tool calls (median)347356
Time (median)16s31s35s19s30s23s

Versus the accessibility tree:

  • Long tasks: accuracy within one run, 29-47% fewer input tokens, 29-37% fewer calls, about a third less time.
  • Short tasks: accuracy equal or better, 35-57% fewer input tokens.

Versus screenshots:

  • Luna: screenshots score 2 runs higher but use more tokens and time.
  • Haiku: screenshots use fewer tokens.

Caveats:

  • Short-task times compare a newer Mantis build with the earlier tree and screenshot run, so treat that time gap as indicative.
  • Scores come from deterministic answer keys on the final page state. Two long iframe/tab tasks can't be keyed and are left out of the long-task counts.
  • Method and full caveats: bench/RESULTS.md.

Limitations

  • No canvas input: canvas, WebGL, maps and drawing apps are described only as canvas, with no coordinate click or draw tool.
  • Login and bot walls need ask_human, which needs a display.
  • Benchmarked only on read, navigate and form-fill tasks on public sites, with two models. The screenshot baseline is this project's own tool, and a few tasks were swapped after results (disclosed).
  • Page content is untrusted data; see SECURITY.md.
  • Small v0.1.x beta.

Learn more

License

MIT

來源:README.md,提交 74f61b0

工具

20

open

Open URL as numbered page text; act by #number.

輸入參數url必填

read

Numbered text; act by #number. ~"x" names are guesses. "Same as before" retains #numbers; region/full/fresh expands it; full is paged with offset. Verify the entity identity before editing. Before finishing, re-read and visibly verify every task constraint (filters, sort, size, quantity, date range). After an action confirms completion, stop and report it rather than re-inspecting. If #number is stale, read() and retry; if on the wrong page, back() and keep searching. open(url) returns to an earlier results page; back() can lose its query string.

輸入參數fullfreshoffsetregion

find

Case-insensitive whole-page text search, including trimmed content; returns #numbers, actionable row neighbours, and bounded local context. Give a list of up to 6 texts to search them all in one call. Use context_chars to expand just that local context; a matched heading is not a region label. With no match it scrolls virtualized lists and loads more of an infinite feed to look, and says so.

輸入參數text必填context_chars

forget

Clear region memory; next read shows everything.

無需輸入參數。

click

Click element #id.

輸入參數id必填

type

Replace input #id text; submit presses Enter.

輸入參數id必填text必填submit

select

Choose option text in select or combobox #id. A <select multiple> takes a list and its selection becomes exactly that list. Matching ignores case, accents and punctuation.

輸入參數id必填option必填

fill

Prefer one mixed call for related text, dropdown, and checkbox fields; unrelated fields stay unchanged. Verify entity identity before editing. On failure or rerender it stops and reports partial completion; after confirmed completion, report it rather than re-inspecting.

輸入參數fields必填

press

Press a key, e.g. Enter. For bottom-loaded feeds, try End (Control+End if no movement) to load more; a scroll key or scroll reports when the page grew; repeat only while new items appear.

輸入參數key必填

scroll

Scroll up/down/left/right (default down). id alone brings #id into view; id + direction scrolls its containing list/panel/table. For wide tables use right; without id, a scrollable container is used when the page cannot scroll.

輸入參數iddirection

back

Back one page in history.

無需輸入參數。

wait_for

Wait up to 10s: text states are present (or appears) / disappears; #id states are present / enabled. On timeout, inspect the returned current observation.

輸入參數idtextstatetimeout_seconds

hover

Hover element #id and show changes.

輸入參數id必填

upload

Select local file path(s) on #id; this selects files but does not submit a form.

輸入參數id必填pathfilespaths

tabs

List tabs, or switch/close tab #id.

輸入參數idaction

media

Only if read is insufficient: media → data (prefer) → ocr → look (last resort) → ask_human. Numbered images/canvases/charts.

無需輸入參數。

data

Prefer; text only. Extract image/SVG/chart alt, caption, text or Chart.js/ECharts/Highcharts values; a table gives its rows. id from read()/media(), or CSS selector (#N refs work too).

輸入參數idselector

ocr

Text-only OCR for image/canvas. Use if data found nothing. id or CSS selector.

輸入參數idselector

look

LAST RESORT; only image-returning tool (PNG, max 800px). Only after read/data/ocr failed. id or CSS selector.

輸入參數idselector

ask_human

Human handoff for CAPTCHA, 2FA, payment or login; never solves CAPTCHAs. Waits for a page change, then returns the page.

輸入參數untilreason必填timeout_seconds

版本歷史

8
  1. v0.1.13最新Nov 5, 2026
  2. v0.1.11Nov 4, 2026
  3. v0.1.10Oct 29, 2026
  4. v0.1.8Oct 26, 2026
  5. v0.1.7Oct 26, 2026
  6. v0.1.6Oct 25, 2026
  7. v0.1.4Oct 23, 2026
  8. v0.1.2Oct 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分