Skip to main content
Glama

tokensave-mcp-diet

A small MCP proxy that keeps oversized tool results out of your AI's context. Part of TokenSave, which measures where AI tokens go.

Put it in front of Playwright MCP, Chrome DevTools MCP, MCP for Blender or another MCP server. Every tool passes through unchanged. When a tool returns a large page snapshot or a long text, the proxy sends back a shorter version instead and keeps the full result in memory, so the model can still read any part of it.

Why

We measured both servers with Claude Code (Opus 5.5) on 2026-10-22, 94 runs in total:

Playwright MCP 0.0.83

Chrome DevTools MCP 1.11.0

One full snapshot of a long Wikipedia article

504,168 characters, about 205,600 Claude tokens

427,400 characters, about 208,900 Claude tokens

Same snapshot through tokensave-mcp-diet 0.2 (table of contents)

about 1,140 Claude tokens (−99%)

about 1,120 Claude tokens (−99%)

Hacker News front page snapshot, tokens added to the request

18,407 → 6,770 (−63%)

14,115 → 8,047 (−43%)

Whole task "list the top 5 stories", API cost (average of 5 runs)

$0.298 → $0.208 (−30%)

$0.271 → $0.226 (−17%)

Whole task "find two facts in the long Wikipedia article", API cost (5 runs)

$0.181 → $0.173 (−4%)

$0.230 → $0.178 (−23%)

Full method, raw logs and limitations: https://tokensave.app/data/browser-mcp-token-cost (dataset DOI 10.5281/zenodo.23555401, CC BY 4.0)

Claude Code already refuses tool results that are too large and saves them to a file. Version 0.1 sent a 9,000-token outline in that case and lost money inside Claude Code (+3% to +44% per task). Version 0.2 sends a table of contents of about 1,100 tokens instead, which costs about the same as Claude Code's refusal note and lets the model open just the section it needs. In clients that pass large results straight into the context, one long page can cost more than 200,000 tokens.

Compared with Chrome DevTools MCP's filePath option

Chrome DevTools MCP can also keep big results out of the context on its own: take_snapshot and evaluate_script take an optional filePath and write the result to a file instead of returning it (#463, #2054). Use it when your agent can read local files and you want the whole result in one place.

The proxy works differently: the model gets a short outline or table of contents with live uids, so it can keep clicking and typing on the page, and reads one section with snapshot_detail instead of opening a file. It also works with servers that have no such option (Playwright MCP, MCP for Blender) and with clients that cannot read files. We have not measured the filePath option; our numbers above are for Chrome DevTools MCP 1.11.0 without it.

Blender (version 0.3)

MCP for Blender in Claude Code, 2026-10-22, 72 runs: everyday tasks cost $0.16 to $0.23 and a racing scene with a chase camera $0.47, with small results, so the proxy changes little there (−4% to −8%, within noise). The one expensive case is a long script output: printing every property of 580 objects cost $0.873, and $0.166 through the proxy (−81%). Data: https://tokensave.app/data/blender-mcp-token-cost

Related MCP server: Chrome DevTools MCP

What it does

  1. Compact (snapshot fits the budget): the same tree with the noise removed: link targets, [cursor=pointer], separators, empty layout wrappers and deep indentation. Every ref / uid stays, so clicks and typing work as before.

  2. Outline (still too big): headings, form fields, buttons and links only, long text cut, long runs of links collapsed.

  3. Table of contents (very large pages): page title, headings with their refs, the form fields and buttons, and a link count. Usually under 1,500 tokens.

  4. snapshot_detail tool: reads any part of the last full snapshot by ref / uid (a heading ref returns its whole section), or by a text query, instead of taking another full snapshot.

  5. Long text results (version 0.3, any server): text over --max-text characters keeps its first 2,000 and last 1,000 characters plus a summary of the hidden lines (how many, and their most common shapes). A new result_detail tool returns any part by line range or text search. Long string fields in structuredContent are shortened the same way, because some clients (Claude Code) show those instead of the text.

  6. Smaller images (version 0.3): tools with a max_size argument (MCP for Blender's look) get 512-pixel images unless the model asks for more than 1,000.

Images and short results are passed through untouched.

Install

Needs Node.js 18 or later. No npm account or API key.

Claude Code (.mcp.json or claude mcp add):

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "github:johnisking/tokensave-mcp-diet", "--", "npx", "-y", "@playwright/mcp@latest"]
    }
  }
}

For Chrome DevTools MCP, replace the part after -- with npx -y chrome-devtools-mcp@latest. For MCP for Blender, use uvx mcp-for-blender. On Windows, use "command": "cmd" and put "/c" in front of the arguments.

Docker: the included Dockerfile runs the proxy in front of headless Playwright MCP (docker build -t tokensave-mcp-diet ., then docker run -i --rm tokensave-mcp-diet). Listing the tools needs no browser; to use the browser tools in the container, add npx playwright install --with-deps chromium to the image.

The same setup should work in other MCP clients that start servers with a command (Claude Desktop, Cursor, Codex); we have only measured it in Claude Code.

Options

Option

Default

Meaning

--max-chars

8000

Snapshots shorter than this are passed through unchanged

--budget

20000

Largest compact snapshot to send; above this the outline is sent

--toc-over

60000

Snapshots longer than this get only a table of contents

--keep-links

12

In the outline, how many links of a long run to keep

--max-text

8000

Other text results longer than this keep only their head and tail (0 turns this off)

--image-size

512

Default max_size for image tools that take one (0 turns this off)

--max-previews

3

Upper limit for a previews argument (asset thumbnails)

--drop-user-prompt

off

Remove the user_prompt argument some servers ask for (MCP for Blender uses it for its opt-in telemetry) and hide their telemetry tools

Example: npx -y github:johnisking/tokensave-mcp-diet --budget 12000 -- npx -y @playwright/mcp@latest

Limits

  • Tested with Playwright MCP 0.0.83 and Chrome DevTools MCP 1.11.0 on Windows with Claude Code 2.1.295. Snapshot formats change between versions.

  • The outline drops plain text. The model has to call snapshot_detail to read it, which adds a step.

  • Tested with MCP for Blender (add-on 1.8, Blender 5.2.2) for version 0.3.

  • Shortened text keeps the head and tail only; the model has to call result_detail for the middle.

  • The proxy keeps snapshots and long results in memory only. Nothing is written to disk or sent anywhere.

License

MIT. Made by TokenSave, which measures where AI tokens go.

Available Tools

27 tools
browser_clickB
Destructive

Perform click on a web page

Inputs: target (required), button, element, modifiers, +1 more.

browser_closeB
Destructive

Close the page

Inputs: no named parameters.

browser_console_messagesC
Read-only

Returns all console messages

Inputs: level (required), all, filename.

browser_dragA
Destructive

Perform drag and drop between two elements

Inputs: endTarget (required), startTarget (required), endElement, startElement.

browser_dropA
Destructive

Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.

Inputs: target (required), data, paths, element.

browser_emulate_mediaA
Destructive

Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.

Inputs: media, contrast, colorScheme, forcedColors, +1 more.

browser_evaluateC
Destructive

Evaluate JavaScript expression on page or element

Inputs: function (required), target, element, filename.

browser_file_uploadB
Destructive

Upload one or multiple files

Inputs: paths.

browser_fill_formB
Destructive

Fill multiple form fields

Inputs: fields (required).

browser_findA
Read-only

Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref.

Inputs: text, regex, filename.

browser_handle_dialogC
Destructive

Handle a dialog

Inputs: accept (required), promptText.

browser_hoverA
Destructive

Hover over element on page

Inputs: target (required), element.

browser_navigateC
Destructive

Navigate to a URL

Inputs: url (required).

browser_navigate_backA
Destructive

Go back to the previous page in the history

Inputs: no named parameters.

browser_network_requestA
Read-only

Returns full details (headers and body) of a single network request, or a single part if part is set. Use the number from browser_network_requests.

Inputs: index (required), part, filename.

browser_network_requestsA
Read-only

Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.

Inputs: static (required), filter, filename.

browser_press_keyB
Destructive

Press a key on the keyboard

Inputs: key (required).

browser_resizeB
Destructive

Resize the browser window

Inputs: width (required), height (required).

browser_run_code_unsafeA
Destructive

Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.

Inputs: code, filename.

browser_select_optionB
Destructive

Select an option in a dropdown

Inputs: target (required), values (required), element.

browser_snapshotA
Read-only

Capture accessibility snapshot of the current page, this is better than screenshot

Inputs: boxes, depth, target, filename.

browser_tabsA
Destructive

List, create, close, or select a browser tab.

Inputs: action (required), url, index.

browser_take_screenshotA
Read-only

Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.

Inputs: scale (required), type, target, element, +2 more.

browser_typeB
Destructive

Type text into editable element

Inputs: text (required), target (required), slowly, submit, +1 more.

browser_wait_forB
Read-only

Wait for text to appear or disappear or a specified time to pass

Inputs: text, time, textGone.

result_detailA

Read part of a long tool result that tokensave-mcp-diet shortened (script output, logs, dumps). Pass id from the note (e.g. r1), and lines (e.g. "200-260") or query (text to find). Prefer this over running the command again.

Inputs: id (required), lines, query, max_chars.

snapshot_detailA

Read part of the last page snapshot that tokensave-mcp-diet shortened. Pass ref (an element ref or uid from the outline, e.g. e123 or 1_45) to get that element and everything inside it, or query to find text on the page with its surrounding section. Use this instead of taking a new full snapshot.

Inputs: ref, query, max_chars.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 27 tools

    Disambiguation4/5

    Most tools map to a distinct action (navigate, click, type, hover, select_option, wait_for, resize, close) and the descriptions actively steer choices, e.g. snapshot vs screenshot vs find vs snapshot_detail. A few boundaries blur: browser_evaluate vs browser_run_code_unsafe both execute JS, browser_drag vs browser_drop both involve dragging, and browser_snapshot vs browser_find vs snapshot_detail all read page structure.

    Naming Consistency4/5

    The set is overwhelmingly snake_case with a uniform browser_ prefix and a consistent verb_noun shape (browser_press_key, browser_navigate_back, browser_select_option). Deviations are minor: noun-only names like browser_snapshot and browser_tabs, and the two tokensave helper tools (snapshot_detail, result_detail) drop the browser_ prefix entirely.

    Tool Count3/5

    27 tools is heavy for a single server, though browser automation is a genuinely broad domain and nearly every tool covers a real capability. Some consolidation is possible (evaluate/run_code_unsafe, drag/drop, snapshot/find/snapshot_detail), so the surface sits above the comfortable range rather than clearly over-scoped.

    Completeness4/5

    Coverage is strong across the browser lifecycle: navigation, element interaction, form filling, file upload, drag/drop, dialogs, tabs, viewport, console, network inspection, media emulation, plus result-truncation helpers. Gaps are modest—no cookie/localStorage or session-state tools, no request interception, and scrolling must be done indirectly via evaluate or key presses.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender for AI-assisted 3D modeling, scene manipulation, and rendering.
      21
      34,804
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      A proxy server that wraps existing MCP servers to significantly reduce token consumption by compressing tool descriptions into a two-step interface. It enables users to integrate extensive toolsets without exceeding context limits or incurring high API costs.
      143
      Apache 2.0