<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: wei wang</title>
    <description>The latest articles on DEV Community by wei wang (@wei_wang_fe65fe24cc3fe8d9).</description>
    <link>https://dev.to/wei_wang_fe65fe24cc3fe8d9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4284091%2F2e1a8bc8-0e78-4264-aaef-ebb3557c2e25.png</url>
      <title>DEV Community: wei wang</title>
      <link>https://dev.to/wei_wang_fe65fe24cc3fe8d9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wei_wang_fe65fe24cc3fe8d9"/>
    <language>en</language>
    <item>
      <title>MCP servers cost 7.6x more or less than you think: a real tools/list benchmark</title>
      <dc:creator>wei wang</dc:creator>
      <pubDate>Sun, 06 Dec 2026 08:55:05 +0000</pubDate>
      <link>https://dev.to/wei_wang_fe65fe24cc3fe8d9/mcp-servers-cost-76x-more-or-less-than-you-think-a-real-toolslist-benchmark-4jjl</link>
      <guid>https://dev.to/wei_wang_fe65fe24cc3fe8d9/mcp-servers-cost-76x-more-or-less-than-you-think-a-real-toolslist-benchmark-4jjl</guid>
      <description>&lt;p&gt;Every MCP directory lists tool counts from the README. Those counts are frequently wrong, and nobody publishes the thing that actually matters: how much context window a server consumes before you type a single word.&lt;/p&gt;

&lt;p&gt;So I measured it at the protocol level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;Spawn the server with its own launch command, speak JSON-RPC, measure what comes back:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;initialize&lt;/code&gt; (protocol &lt;code&gt;2025-06-18&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;notifications/initialized&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tools/list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;measure the byte length of the returned JSON&lt;/li&gt;
&lt;li&gt;kill the process tree&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Convert with &lt;code&gt;tokens ≈ schema bytes / 3.6&lt;/code&gt;. JSON schema is highly repetitive, so it compresses harder than prose. Relative comparison holds; absolute numbers land within roughly ±10% of a real tokenizer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;Real tools&lt;/th&gt;
&lt;th&gt;README claims&lt;/th&gt;
&lt;th&gt;Schema bytes&lt;/th&gt;
&lt;th&gt;Resident tokens&lt;/th&gt;
&lt;th&gt;Per tool&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server-sequential-thinking&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;4,642&lt;/td&gt;
&lt;td&gt;1,289&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,289&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server-memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;11,065&lt;/td&gt;
&lt;td&gt;3,074&lt;/td&gt;
&lt;td&gt;342&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server-filesystem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;14&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;13,113&lt;/td&gt;
&lt;td&gt;3,643&lt;/td&gt;
&lt;td&gt;260&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;context7&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;5,599&lt;/td&gt;
&lt;td&gt;1,555&lt;/td&gt;
&lt;td&gt;777&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;github-mcp-server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;97&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;15,854&lt;/td&gt;
&lt;td&gt;4,404&lt;/td&gt;
&lt;td&gt;169&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;notion-mcp-server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;76,215&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;21,171&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;882&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;playwright-mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;21,199&lt;/td&gt;
&lt;td&gt;5,889&lt;/td&gt;
&lt;td&gt;236&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chrome-devtools-mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;33,210&lt;/td&gt;
&lt;td&gt;9,225&lt;/td&gt;
&lt;td&gt;280&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;firecrawl-mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;98,311&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;27,309&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;975&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Three things that surprised me
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. README tool counts are wrong in both directions
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;server-filesystem&lt;/code&gt; claims 7 tools. &lt;code&gt;tools/list&lt;/code&gt; returns &lt;strong&gt;14&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;github-mcp-server&lt;/code&gt; claims 97. It returns &lt;strong&gt;26&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Anyone sizing a stack from READMEs is off by 2x — sometimes over, sometimes under.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Per-tool cost spans 7.6x
&lt;/h3&gt;

&lt;p&gt;From 169 tokens (&lt;code&gt;github&lt;/code&gt;) to 1,289 tokens (&lt;code&gt;sequential-thinking&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sequential-thinking&lt;/code&gt; is the extreme case: exactly &lt;strong&gt;one&lt;/strong&gt; tool, but it costs 1,289 tokens because its parameter tree is deep (thought number, branches, revisions, and so on).&lt;/p&gt;

&lt;p&gt;This breaks the "N tools × some constant" estimation method most calculators use. The cost lives in the schema, not in the tool count.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. A normal stack eats a fifth of your context before you start
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stack&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;Tokens&lt;/th&gt;
&lt;th&gt;% of 200K&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;github + playwright + firecrawl + context7&lt;/td&gt;
&lt;td&gt;81&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39,157&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;19.6%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That is 19.6% of a 200K window, before the conversation starts.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;firecrawl&lt;/code&gt; alone is 27,309 of it — one server, 28 tools, 975 tokens each, because its JSON schema is huge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two practical implications
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Per-tool granularity matters more than per-server.&lt;/strong&gt; When one server's 28 tools cost 27k tokens, toggling the whole server off is too coarse a control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show the cost at decision time.&lt;/strong&gt; A config UI that displays token cost next to each server toggle lets people make an informed tradeoff instead of discovering the problem when their assistant gets slow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce it yourself
&lt;/h2&gt;

&lt;p&gt;The probe is a single file with no dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node probe-standalone.mjs npx -y @modelcontextprotocol/server-memory
node probe-standalone.mjs --batch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One caveat on startup times: run each server &lt;strong&gt;twice&lt;/strong&gt;. The first run is dominated by &lt;code&gt;npx&lt;/code&gt; downloading the package (1,700–3,200ms in my measurements). The second run is the real startup — usually 330–480ms. Reporting the first number as "cold start" is misleading, which I learned the hard way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;stdio servers only; HTTP/SSE servers behind auth are excluded&lt;/li&gt;
&lt;li&gt;where &lt;code&gt;tools/list&lt;/code&gt; only checks that env vars are non-empty, a placeholder key was used (recorded in the raw data as &lt;code&gt;used_placeholder_env&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;token counts are a &lt;code&gt;bytes / 3.6&lt;/code&gt; approximation, not an exact BPE count&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Full table, continuously updated: &lt;strong&gt;&lt;a href="https://ai.dengwolai.com/en/lab/" rel="noopener noreferrer"&gt;https://ai.dengwolai.com/en/lab/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Probe script and raw data: &lt;strong&gt;&lt;a href="https://github.com/q33123302/mcp-token-benchmark" rel="noopener noreferrer"&gt;https://github.com/q33123302/mcp-token-benchmark&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Paste your own &lt;code&gt;mcp.json&lt;/code&gt; and see the total: &lt;strong&gt;&lt;a href="https://ai.dengwolai.com/en/token/" rel="noopener noreferrer"&gt;https://ai.dengwolai.com/en/token/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>cursor</category>
    </item>
    <item>
      <title>How to prove whether a PDF tool actually uploads your file</title>
      <dc:creator>wei wang</dc:creator>
      <pubDate>Sun, 06 Dec 2026 08:39:41 +0000</pubDate>
      <link>https://dev.to/wei_wang_fe65fe24cc3fe8d9/how-to-prove-whether-a-pdf-tool-actually-uploads-your-file-pmk</link>
      <guid>https://dev.to/wei_wang_fe65fe24cc3fe8d9/how-to-prove-whether-a-pdf-tool-actually-uploads-your-file-pmk</guid>
      <description>&lt;p&gt;Most browser PDF mergers fall into one of two groups, and the marketing language for both is identical: "secure", "private", "your files never leave your device", "processed locally".&lt;/p&gt;

&lt;p&gt;Only one of those claims is checkable. This post is about the check.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 60-second test
&lt;/h2&gt;

&lt;p&gt;Open the tool. Press &lt;code&gt;F12&lt;/code&gt; (or right-click → Inspect). Switch to the &lt;strong&gt;Network&lt;/strong&gt; tab and tick &lt;strong&gt;Preserve log&lt;/strong&gt;, so requests survive the redirects and the download that follow.&lt;/p&gt;

&lt;p&gt;Then merge two PDFs.&lt;/p&gt;

&lt;p&gt;Read the requests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A request whose &lt;strong&gt;body is measured in megabytes&lt;/strong&gt;, with a content type of &lt;code&gt;multipart/form-data&lt;/code&gt;, is your file going to a server.&lt;/li&gt;
&lt;li&gt;Only page assets, JS bundles, fonts and analytics → the merge happened in your tab.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it. No source code, no trust required. The browser is telling you the truth because it has to actually send the bytes.&lt;/p&gt;

&lt;p&gt;A useful detail: &lt;code&gt;fetch&lt;/code&gt; with a &lt;code&gt;Blob&lt;/code&gt; body shows up the same way, so "we use fetch, not a form" is not a defence. If megabytes leave the machine, they leave the machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the upload path actually costs you
&lt;/h2&gt;

&lt;p&gt;This is not only about principle. Four things change in normal use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Size ceilings.&lt;/strong&gt; Server-side mergers usually cap at 20–100 MB, because the vendor pays for the bandwidth and the CPU. A local merge is limited by the tab's memory, which is several gigabytes. If your contract is 80 MB, that difference decides whether the job finishes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round-trip time.&lt;/strong&gt; 50 MB over a home upload link is minutes. The same file merged locally is seconds — no modem involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retention.&lt;/strong&gt; Most vendors delete uploads within an hour to a day. That is a reasonable policy and it is still a different thing from never receiving the file. You cannot verify a deletion policy from the outside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review.&lt;/strong&gt; Shared PDFs frequently sit in a queue where a human can open them. Local processing removes the queue from existence rather than promising to empty it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a local merge changes in the output
&lt;/h2&gt;

&lt;p&gt;A browser merger copies page objects from each input into a new document. Three consequences worth knowing before you promise anyone a clean result:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File size roughly adds up.&lt;/strong&gt; 3 × 8 MB inputs give you ~24 MB, not less. If the result is too large, that is a separate compression step; merging cannot shrink anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bookmarks and form fields vary by library.&lt;/strong&gt; &lt;code&gt;pdf-lib&lt;/code&gt; preserves document outlines. Some implementations silently drop them. Check a merged file's bookmark pane once and you know what your tool does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encrypted inputs stop the batch.&lt;/strong&gt; A PDF with an open password cannot be parsed without it, and a browser tool has no way to prompt mid-batch. Split the batch, or decrypt first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The order problem, which is not a bug
&lt;/h2&gt;

&lt;p&gt;The most common complaint about merging is that pages come out shuffled. It is almost always lexicographic sorting: file pickers order &lt;code&gt;scan10.pdf&lt;/code&gt; before &lt;code&gt;scan2.pdf&lt;/code&gt;, because they compare strings, not numbers.&lt;/p&gt;

&lt;p&gt;Practical fix: merge, then open the &lt;strong&gt;first and last page&lt;/strong&gt; of the result before sending it anywhere. If the order is wrong, reorder in the tool's list. Renaming files is the slow path.&lt;/p&gt;

&lt;h2&gt;
  
  
  When a server is genuinely the better answer
&lt;/h2&gt;

&lt;p&gt;I would rather be accurate than win an argument. A browser merge is the wrong tool when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the file is genuinely enormous (500 MB+), where a tab may run out of memory;&lt;/li&gt;
&lt;li&gt;you are on a phone with a few hundred MB of free RAM;&lt;/li&gt;
&lt;li&gt;you need OCR or conversion pipelines that depend on native binaries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reasonable rule: keep anything with a signature, an ID number or a contract local, and let large-but-boring files use whatever is fastest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the test on us
&lt;/h2&gt;

&lt;p&gt;The merger I use for this is &lt;a href="https://dengwolai.com/en/merge-pdf/" rel="noopener noreferrer"&gt;DengWoLai's PDF merge&lt;/a&gt;, which runs in the tab. Open DevTools on it while merging; you will see no request carrying your file. If you find one, say so — that would be a bug worth fixing, and the whole point of this post is that the check works both ways.&lt;/p&gt;

&lt;p&gt;Related, if page order is your specific problem: &lt;a href="https://dengwolai.com/en/guides/merge-pdf-order-wrong/" rel="noopener noreferrer"&gt;why merged PDF pages come out in the wrong order&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why "Redacted" Screenshots Still Show the Text (and a Zero-Upload Browser Fix)</title>
      <dc:creator>wei wang</dc:creator>
      <pubDate>Sat, 05 Dec 2026 06:30:39 +0000</pubDate>
      <link>https://dev.to/wei_wang_fe65fe24cc3fe8d9/why-redacted-screenshots-still-show-the-text-and-a-zero-upload-browser-fix-4h8p</link>
      <guid>https://dev.to/wei_wang_fe65fe24cc3fe8d9/why-redacted-screenshots-still-show-the-text-and-a-zero-upload-browser-fix-4h8p</guid>
      <description>&lt;p&gt;A colleague recently shared a badge screenshot where he thought he had blacked out his employee ID. Cranking up the phone screen brightness made the numbers readable right through the black stroke.&lt;/p&gt;

&lt;p&gt;In practice, three common "redaction" habits still leak sensitive text:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Semi-transparent highlighter / markup pens&lt;/strong&gt; (like the default iOS black marker): they blend with the underlying pixels (&lt;code&gt;observed = original * opacity + overlay * (1 - opacity)&lt;/code&gt;), so raising exposure or contrast often brings the text back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixed-grid pixelation / mosaic&lt;/strong&gt;: uniform block downsampling is mathematically reversible in many cases—especially for digits and short strings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgotten EXIF metadata &amp;amp; embedded thumbnails&lt;/strong&gt;: hiding pixels on the canvas doesn't always strip GPS coordinates, device info, or the unedited thumbnail stored inside EXIF.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To handle both redaction and metadata cleanup without uploading sensitive photos (IDs, contracts, chat screenshots) to a third-party server, I built a lightweight &lt;strong&gt;100% client-side&lt;/strong&gt; tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tool&lt;/strong&gt;: &lt;a href="https://dengwolai.com/en/image-privacy/" rel="noopener noreferrer"&gt;Strip EXIF &amp;amp; Redact Photos Locally (No Upload)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full write-up &amp;amp; 3-minute self-check&lt;/strong&gt;: &lt;a href="https://dengwolai.com/en/guides/screenshot-redaction-fails/" rel="noopener noreferrer"&gt;Why "Redacted" Screenshots Still Show the Text&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key design choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Safe by default&lt;/strong&gt;: defaults to solid-color block redaction instead of reversible mosaic (blur and mosaic are still optional).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full metadata wipe on export&lt;/strong&gt;: re-encoding through HTML5 Canvas drops every EXIF field (GPS, camera model, timestamp, embedded thumbnail).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero server upload&lt;/strong&gt;: everything runs locally in your browser—you can verify zero network requests in DevTools, or click &lt;strong&gt;"Load sample image"&lt;/strong&gt; to test without preparing a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback and bug reports are very welcome!&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
