Plasmate
v0.6.0 · Rust · Apache-2.0
I built Plasmate because agent workloads routinely pass raw HTML, presentation markup, and runtime machinery into models when the task needs content, structure, and available actions.
The core idea: instead of returning raw HTML, Plasmate compiles pages into a Semantic Object Model (SOM). That's a structured JSON representation of what's actually on the page: what you can click, what you can type into, what the content says. Everything an agent doesn't need gets stripped.
The retained v0.5.1 public-web snapshot recorded a 9.98x median serialized-byte ratio over 83 successful inputs from 98 attempted URLs. The JavaScript-enabled snapshot recorded 9.32x over 82 successful inputs from the same attempted total. These are historical, observational byte ratios—not universal token, cost, latency, memory, or task-success claims. See the public claim registry.
What it does
Plasmate supports direct HTML-to-SOM compilation, semantic extraction, JavaScript execution through V8, native MCP and AWP, and a documented CDP compatibility subset. The repository also includes the WebTaskBench evaluation suite.
- plasmate compile - Compile HTML to SOM from files or stdin. No browser, no network. Perfect for publisher build pipelines.
- html_id field - SOM elements preserve original HTML id attributes for DOM resolution and agent interaction.
- ARIA state capture - aria-expanded, aria-selected, aria-checked, aria-disabled, aria-current, aria-pressed, aria-hidden.
- details/summary support - Disclosure widgets as first-class interactive elements with toggle action and open state.
- Better tables - 12 columns (was 8), 30 rows (was 20), colspan handling, caption extraction.
- GDPR/cookie banner stripping - Consent overlays detected and removed automatically.
- ICU/Intl support - Full ICU data for Intl.NumberFormat and related APIs in JS-heavy SPAs.
- Raised script limits - 3MB per script, 10MB total. Handles large SPA bundles.
- WebTaskBench - An open evaluation harness for comparing agent task behavior across page representations.
How it works
Plasmate is a single Rust binary. Give it a URL, get structured JSON back.
Under the hood: html5ever parses the HTML, V8 runs JavaScript (with a full DOM shim for SPA frameworks), then the SOM compiler extracts semantic structure. It also speaks a documented CDP compatibility subset, AWP, and MCP.
How to read the evidence
Output size depends on the page, Plasmate version, configuration, and measurement method. The retained public-web snapshots compare raw-response bytes with serialized SOM bytes. They do not establish token savings under a named tokenizer or downstream model savings.
The 9.98x statistic covers 83 successful non-JavaScript inputs from 98 attempted URLs. Twelve blocked and three failed inputs stay in the attempted-input denominator. The 9.32x JavaScript statistic covers 82 successful inputs, with fourteen blocked and two failed.
Review the benchmarking policy and retained scorecard before comparing or citing the result.
SDKs and integrations
SOM itself is an open spec (v1.0) with JSON Schema validation. We publish interactive HTML and JS coverage scorecards with complete attempted, successful, blocked, and failed input counts.
MCP tools (for AI agents)
Run plasmate mcp and an MCP-compatible client gets tools including:
What's next
Plasmate's current and proposed work is tracked in the public roadmap. Treat roadmap items as plans, not shipped capabilities.
Why Apache-2.0
Plasmate is published under Apache-2.0 so teams can inspect the implementation, run it in their own infrastructure, and build on it under a permissive open source license. The goal is to make an agent-oriented representation and runtime available as shared infrastructure.
Get started
For Claude Desktop or any MCP client: