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 分