Plasmate 标志

Plasmate

组织
plasmate-labs

Browser engine for agents. HTML in, structured Semantic Object Model out. Native MCP and AWP with a supported CDP subset. Apache-2.0.

发布者plasmate-labs
代码仓库plasmate
语言Rust
复刻数
5
星标数
37
可用工具
0
传输类型stdio, streamable-http
分类
许可协议Apache-2.0
链接
  • 将工具接入 AI 工作流

    Plasmate 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 37 个 Star 和 5 个 Fork。


Dependency and CI trust policy, local audit commands, and scorecard promotion rules are documented in Supply-chain policy.

Plasmate compiles HTML into a Semantic Object Model (SOM), a structured representation that LLMs can reason about directly. It runs JavaScript via V8 and implements a documented CDP subset for supported Puppeteer workflows. SOM output removes presentation and runtime markup; output size and tokenization are page-, configuration-, serialization-, and tokenizer-dependent.

PlasmateLightpandaChrome
Primary outputStructured SOM JSONRaw HTML / DOMRaw HTML / DOM
JavaScriptEmbedded V8 pipelineBrowser runtimeBrowser runtime
Agent protocolNative MCP and AWPCDPCDP
Benchmark policyRetained, denominator-complete reportsProject-specificProject-specific
LicenseApache-2.0AGPL-3.0Chromium

Install

bash
curl -fsSL https://plasmate.app/install.sh | sh

Or install the native engine with Cargo:

bash
cargo install plasmate

The npm and PyPI packages named plasmate are client SDKs; they do not bundle or install the native plasmate executable. Install the native engine first, then add npm install plasmate or pip install plasmate to applications that need the corresponding SDK.

Quick Start

Fetch a page and get structured output

bash
plasmate fetch https://news.ycombinator.com

Returns SOM JSON: structured regions, interactive elements with stable IDs, and content. Measure output size on the pages and configuration used by your application.

Start a CDP server (Puppeteer compatible)

bash
plasmate serve --protocol cdp --host 127.0.0.1 --port 9222

Then connect with Puppeteer:

javascript
import puppeteer from 'puppeteer-core';

const browser = await puppeteer.connect({
  browserWSEndpoint: 'ws://127.0.0.1:9222',
  protocolTimeout: 10000,
});

const page = await browser.newPage();
await page.goto('https://example.com');

const title = await page.evaluate(() => document.title);
console.log(title);

await browser.close();

Start an AWP server (native protocol)

bash
plasmate serve --protocol awp --host 127.0.0.1 --port 9222

AWP's foundational v0.1 core has seven wire methods: awp.hello, session.create, session.close, page.navigate, page.observe, page.act, and page.extract. The current native handler also exposes session-listing, network-interception, plugin, cookie, and proxy-pool extensions. Click, type, select, scroll, toggle, and clear are page.act actions, not separate wire methods.

Run a supervised stateful workflow

bash
plasmate agent-run --plan examples/agent-workflow.json \
  --report agent-workflow-report.json --dry-run

Plans are versioned and bounded; mutating steps require separate --confirm-step <id> approvals, while JavaScript evaluation and cookie writes also require category opt-ins. See the workflow contract for schemas, secret references, containment, and execution examples.

Run as an MCP tool server (Model Context Protocol)

bash
plasmate mcp

This exposes Plasmate over stdio as MCP tools:

  • fetch_page - get structured SOM from any URL
  • extract_text - get clean readable text
  • extract_links - get deduplicated links from a page
  • ard_discover - inspect bounded static ARD v0.9 draft catalog signals without invoking them
  • crawl_policy - evaluate RFC 9309 robots.txt policy without changing fetch behavior
  • inspect_page - return bounded SOM first, with deterministic optional visual fallback
  • cache_status - inspect MCP SOM cache reuse and restorable page-state entries
  • session_status - inspect active sessions, loaded URLs, HTML/SOM/node inventory, and disabled/readonly interactive counts
  • trace_status - inspect bounded action-trace retention for one session
  • trace_export - export privacy-safe plasmate.trace.v1 events
  • trace_clear - discard retained events without resetting their sequence
  • replay_validate - validate a retained action without executing it
  • screenshot_page - capture a page screenshot, with SOM fallback
  • open_page - start an interactive session (returns session_id, SOM, cache_restored)
  • navigate_to - navigate an existing session
  • evaluate - run JavaScript in the page context
  • click - click elements by SOM element ID
  • type_text - type into an input or textarea
  • select_option - select a dropdown option
  • scroll - scroll the page or an element
  • toggle - toggle checkbox, radio, or details state
  • clear - clear an input or textarea
  • close_page - end a session
  • get_cookies - read session cookies
  • set_cookies - add or update session cookies
  • clear_cookies - remove session cookies

For an authenticated local Streamable HTTP endpoint, set a capability token and select the HTTP transport explicitly:

bash
PLASMATE_MCP_HTTP_TOKEN="$(openssl rand -hex 32)" \
  plasmate mcp --transport http --host 127.0.0.1 --port 9272

The endpoint is http://127.0.0.1:9272/mcp. Every request must include Authorization: Bearer <token>. The server implements JSON response mode for the stateful MCP 2025-11-25 transport and the stateless 2026-07-28 release candidate. It deliberately returns HTTP 405 for GET rather than claiming an SSE notification stream it does not implement. See docs/mcp-streamable-http.md for lifecycle, headers, and browser-Origin policy.

Example Claude Desktop config:

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

For AI Agents

Plasmate is purpose-built for AI agent pipelines. Several ways to wire it in:

MCP (Claude Desktop, Cursor, VS Code Copilot, Windsurf)

Add to your MCP config and every tool call automatically uses Plasmate:

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

Config file locations:

  • Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
  • Cursor — ~/.cursor/mcp.json
  • VS Code Copilot — .vscode/mcp.json (workspace) or user settings
  • Windsurf — ~/.codeium/windsurf/mcp_config.json

Once connected, the native server advertises its current tool surface through MCP tools/list. It includes stateless fetch/extraction/discovery tools, cache/session/trace inspection, screenshot and stateful page interaction, cookie operations, and validation-only replay. Query tools/list instead of depending on a hard-coded count; the authoritative registration is src/mcp/server.rs.

Tip: use selector="main" to strip nav/footer, selector="interactive" to return only actionable elements, or selector="action:click" to build a compact click-target menu before the LLM sees the content. Use cache_status after repeated fetches to inspect local MCP SOM cache hits, misses, selector entries, effective-HTML entries, and avoided HTML work. Use session_status before long interactive runs to inspect active browser session count, capacity, loaded URLs, raw/effective HTML sizes, SOM sizes, node-map counts, structured data presence, disabled/readonly interactive counts, age, and idle time. Stateful open_page and navigate_to return cache_restored=true when they reuse a content-hash-validated cache entry with both SOM and effective HTML. Set trace=true on open_page to opt into bounded, memory-only action tracing, then use trace_status, trace_export, and side-effect-free replay_validate. Typed values and page bodies are never exported. See docs/session-tracing.md for the privacy contract, bounds, drift classes, and validation-only limitation.

Before a multi-page crawl, use crawl_policy or the CLI equivalent:

bash
plasmate crawl-policy https://example.com/private --product-token Plasmate

The versioned report distinguishes an unavailable robots file (4xx, access permitted by RFC 9309) from an unreachable one (network/5xx, access denied). It is advisory metadata, not authorization, and does not silently alter ordinary fetch or fetch_page. See docs/CRAWL-POLICY.md.

Use inspect_page when an agent may need pixels. Its default auto mode always returns a bounded compact SOM and only attaches a screenshot for named signals such as near-empty structure, canvas-heavy content, or image-map/image controls. never recommends without capture; always is an explicit capture request. Page JavaScript is off by default; javascript=true runs untrusted page code through the supervised JavaScript worker before the separately isolated screenshot process. Rendering uses a sandboxed/CSP-constrained document with JavaScript disabled, no unsafe file-access or browser-sandbox switches, a dead network proxy, and process-tree cleanup. Plasmate does not interpret the image with a vision model. See docs/STRUCTURED-VISUAL-FALLBACK.md.

Static ARD discovery (draft)

Inspect the three static Agentic Resource Discovery signals supported by Plasmate—the well-known catalog, an HTML rel="ai-catalog" link, and a robots.txt Agentmap directive:

bash
plasmate ard-discover https://example.com/ --output ard-report.json

The versioned plasmate.ard.discovery.v1 report validates bounded catalog envelopes and labels all publisher metadata, inline data, trust manifests, attestations, and signatures as untrusted and unverified. It does not search a registry, invoke entries, fetch entry endpoints, follow nested catalogs, or verify identity. HTTPS and same-origin catalog discovery references are mandatory, and the ARD path cannot use Plasmate's private-network development override. Standalone reports and fully wrapped MCP tool results each have an independently measured 512 KiB serialized bound. See docs/ARD.md for limits and protocol scope.

Vercel AI SDK

Use Plasmate via the AI SDK's built-in MCP client (AI SDK v4+):

bash
npm install ai @ai-sdk/openai
ts
import { experimental_createMCPClient as createMCPClient, generateText } from 'ai'
import { Experimental_StdioMCPTransport as StdioMCPTransport } from 'ai/mcp-stdio'
import { openai } from '@ai-sdk/openai'

const mcp = await createMCPClient({
  transport: new StdioMCPTransport({
    command: 'plasmate',
    args: ['mcp'],
  }),
})

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools: await mcp.tools(),
  maxSteps: 5,
  prompt: 'Summarize the top 3 stories on news.ycombinator.com',
})

await mcp.close()

This wires the full Plasmate MCP tool set directly into any Vercel AI SDK agent. See Vercel AI SDK MCP docs for details.

LLM context

  • Machine-readable summary: https://plasmate.app/llms.txt

  • Codebase guide for AI coding agents: AGENTS.md

  • The checked-in MCP Registry metadata declares ghcr.io/plasmate-labs/plasmate:v0.6.0 as the runnable, version-pinned OCI package for the next release candidate. This image is not available until the immutable v0.6.0 release workflow publishes it. Only after it is anonymously pullable and the metadata is published can Registry clients launch it over stdio with the mcp subcommand. The eventual direct invocation is:

    bash
    docker run --rm -i ghcr.io/plasmate-labs/plasmate:v0.6.0 mcp

    The npm and PyPI packages named plasmate are client SDKs, not server executables. For a host-native installation, install the Rust binary above and configure the command as plasmate mcp.

What is SOM?

The DOM was built for rendering. SOM was built for reasoning.

SOM strips layout, styling, scripts, SVGs, and boilerplate. It keeps structure, content, and interactive elements with stable IDs that agents can reference in actions.

Output-size evidence

The retained v0.5.1 public-web snapshots in website/docs/coverage.json and website/docs/coverage-js.json recorded median serialized-byte ratios of 9.98x over 83 successful non-JavaScript inputs and 9.32x over 82 successful JavaScript inputs, respectively, from 98 attempted URLs in each run. These are historical, observational byte ratios—not universal token savings, cost savings, latency, or task-success claims. Blocked and failed inputs remain in the denominator. See the benchmarking policy and public claim registry before comparing or citing results.

JavaScript Support

Plasmate embeds V8 and executes page JavaScript, including:

  • Inline and external <script> tags
  • fetch() and XMLHttpRequest with real HTTP requests
  • setTimeout / setInterval with timer draining
  • DOM mutations (createElement, appendChild, textContent, innerHTML, etc.)
  • DOMContentLoaded and load events
  • Promise resolution and microtask pumping

The JS pipeline runs during plasmate fetch and CDP page.goto(). The resulting DOM mutations are serialized back to HTML before SOM compilation, so JS-rendered content is captured.

CDP Compatibility

In the historical campfire-commerce fixture from Lightpanda's Puppeteer benchmark, Plasmate passed the assertions described in the March 2026 exploratory report. That single fixture is evidence for the listed workflow, not full Puppeteer, Playwright, CDP, or web-platform compatibility. Supported CDP methods include:

  • page.goto(), page.content(), page.title()
  • page.evaluate(), page.waitForFunction()
  • browser.newPage(), browser.createBrowserContext()
  • Runtime.evaluate, Runtime.callFunctionOn
  • DOM.getDocument, DOM.querySelector, DOM.querySelectorAll
  • Input.dispatchMouseEvent, Input.dispatchKeyEvent
  • Target management (create, attach, close)
  • Plasmate.getSom, Plasmate.getStructuredData, Plasmate.getInteractiveElements, Plasmate.getMarkdown, Plasmate.getText, Plasmate.getLinks

Plasmate.getInteractiveElements returns a full-tree action menu, including nested and shadow-root targets. It accepts optional role, action, label, exact, enabledOnly, replay lookup (value plus by, or direct id, cacheKey, htmlId, testId), and offset/limit params so Puppeteer/ Playwright clients can request, for example, one page of enabled click targets before calling an LLM. Each target includes SOM role names, deterministic cache_key, html_id, test_id, enabled, and blocked_reason when available.

DOM.querySelector / DOM.querySelectorAll walk the SOM-backed node tree in document order and understand stable replay selectors such as #html_id, #som_id, [data-testid="..."], [data-test-id="..."], common attributes such as [name="..."], [href="..."], [type="..."], [aria-label="..."], [aria-labelledby="..."], [role="..."], SOM role names, text, and labels. Matching for text and labels is case-insensitive. CDP DOM nodes expose replay attributes such as data-plasmate-id, data-som-role, HTML id, test id, ARIA label, href/name/type, and disabled/readonly/required flags when available. Accessibility.getFullAXTree is also SOM-backed and includes nested and shadow-root elements with backend node ids plus disabled/readonly properties when available.

CDP is a compatibility layer. AWP is the native protocol, designed for agents rather than debuggers.

Architecture

HTML → Network (reqwest) → HTML Parser (html5ever)
  → JS Pipeline (V8: scripts, fetch, XHR, timers, DOM mutations)
    → DOM Serialization → SOM Compiler → JSON output
  • Network: reqwest with TLS, HTTP/2, redirects, compression; cookie jar supported, cookie APIs and proxy configuration are still limited
  • JS Runtime: V8 with DOM shim (80+ methods), blocking fetch bridge
  • SOM Compiler: semantic region detection, element ID generation, interactive element preservation, smart truncation, deduplication
  • Protocols: AWP (seven foundational core methods plus current extensions) and a CDP compatibility layer for supported Puppeteer workflows

Build from Source

bash
git clone https://github.com/plasmate-labs/plasmate.git
cd plasmate
cargo build --release
./target/release/plasmate fetch https://example.com

Requirements: Rust 1.88+ for both default and plugins builds. V8 is fetched automatically by rusty_v8. CI checks the declared minimum against default and all-feature builds so dependency updates cannot silently raise it.

Docker

Prebuilt multi-arch images (linux/amd64 and linux/arm64) are published to GHCR:

bash
# Server mode (CDP or AWP)
docker run --rm -p 9222:9222 ghcr.io/plasmate-labs/plasmate:latest

# One-shot fetch
docker run --rm ghcr.io/plasmate-labs/plasmate:latest fetch https://example.com

Build locally:

bash
docker build -t plasmate .
docker run --rm -p 9222:9222 plasmate

Tests

bash
cargo test --workspace    # all workspace tests
./scripts/action-manifest-conformance.sh

Benchmarks

Run the deterministic supervised agent task gate and independently validate its fixture provenance and complete denominators:

bash
cargo run --locked -- agent-task-benchmark-v1 --output agent-task-benchmark-v1.json
cargo run --locked -- agent-task-benchmark-validate --input agent-task-benchmark-v1.json

This is a task-contract benchmark, not a latency or model-quality claim. See the benchmarking methodology.

Run the built-in benchmark against cached pages:

bash
cargo run --release -- bench --urls bench/urls.txt

Or test against live sites:

bash
plasmate fetch https://en.wikipedia.org/wiki/Rust_(programming_language) | jq '.regions | length'

See plasmate.app/compare for the full comparison with Lightpanda and Chrome.

Roadmap

See docs.plasmate.app/roadmap for the full roadmap.

v0.5 (current):

  • Proxy support (HTTP, HTTPS, SOCKS5 with auth)
  • Proxy rotation (pool management, sticky sessions)
  • Iframe support
  • Shadow DOM support (declarative shadow DOM)
  • Native bounded ES-module core (same-origin static URL imports; see scope and limitations)
  • Broader module compatibility (import maps, CORS graphs, dynamic import, import attributes, top-level await)
  • MCP cache/session observability for repeated agent workflows
  • Parallel sessions at scale (500+ concurrent)

Ecosystem

Plasmate documents integrations across the AI and developer ecosystem. The links below are an ecosystem directory, not a count of currently tested or maintained compatibility contracts. Verify each integration's repository, version support, and test status before adopting it:

See awesome-plasmate for the broader community-maintained directory.

License

Apache-2.0. See LICENSE.

Built by Plasmate Labs.

安装

TypingMind
{
  "mcpServers": {
    "plasmate": {
      "command": "plasmate",
      "args": [
        "mcp"
      ]
    }
  }
}

将 Plasmate MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Plasmate 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 您可以在自己的设备上本地运行 MCP,也可以通过 URL 连接远程 MCP 服务器。

方式 1:使用本地连接器

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 Plasmate 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Plasmate MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "plasmate": {
      "command": "npx",
      "args": [
        "-y",
        "plasmate"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Plasmate MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Plasmate MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Plasmate 帮我完成这项任务吗?
Plasmate
当然。我已阅读。
以下是我使用 Plasmate 得到的结果。

方式 2:添加 MCP 服务器 URL

如果 Plasmate 已托管在远程服务器上,或您的团队希望让多个用户共用一个连接器,请选择此方式。

1

打开 MCP 连接器

在 TypingMind 中,前往“插件”,打开“MCP 连接器”,然后选择“添加 URL”。

  1. 在您的浏览器中打开 TypingMind。
  2. 进入“插件”。
  3. 打开“MCP 连接器”。
  4. 点击“添加 URL”。
TypingMind 的“添加自定义 MCP 服务器 URL”表单
2

粘贴服务器 URL

在“服务器 URL”字段中输入 提供商提供的 MCP 服务器 URL。根据服务器要求,添加连接名称、描述、图标、自定义 HTTP 请求头或 OAuth 客户端设置。

  1. 将 提供商提供的 MCP 服务器 URL 粘贴到“服务器 URL”字段中。
  2. 为 Plasmate 输入连接名称。
  3. 您可以添加描述和图标,以便更容易识别此连接。
  4. 如果服务器需要身份验证,请添加自定义 HTTP 请求头或 OAuth 客户端信息。
3

创建连接

点击“创建连接”,然后返回插件列表,确认新的 MCP 连接显示为“有效”。

  1. 点击“创建连接”。
  2. 返回 MCP 连接器列表。
  3. 确认 Plasmate 连接显示为“有效”。
  4. 如果连接未立即出现,请刷新插件列表。
4

切换模型,无需重新连接

使用您偏好的模型开始聊天,在“插件”中启用 Plasmate 工具,并根据需要随时切换到其他模型。该 MCP 连接在 TypingMind 工作区中仍然可用。

  1. 在 TypingMind 中开始新聊天。
  2. 选择您想使用的 AI 模型。
  3. 在“插件”中启用 Plasmate 工具。
  4. 需要时,请让模型使用该工具。
  5. 切换到其他 AI 模型,继续使用同一个 MCP 连接。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Plasmate 帮我完成这项任务吗?
Plasmate
当然。我已阅读。
以下是我使用 Plasmate 得到的结果。

常见问题

Plasmate MCP 服务器有什么用途?

Plasmate 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Plasmate MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 Plasmate,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 Plasmate MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 Plasmate 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Plasmate MCP 连接到 TypingMind?

您可以通过本地 MCP 连接器,或添加远程 MCP 服务器 URL,在 TypingMind 中连接 Plasmate。当服务器需要访问您设备上的文件、应用或私有资源时,请使用本地连接器;当 MCP 服务器托管在远程时,请使用服务器 URL。

Plasmate MCP 在 TypingMind 中提供哪些工具?

Plasmate 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Plasmate MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 Plasmate 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇