Skip to content

Serve packaged page tools over loopback MCP - #9

Open
DNTOF wants to merge 5 commits into
cursor/ssrf-ocr-gate-0e28from
cursor/packaged-mcp-0e28
Open

DNTOF wants to merge 5 commits into
cursor/ssrf-ocr-gate-0e28from
cursor/packaged-mcp-0e28

Conversation

@DNTOF

@DNTOF DNTOF commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Depends on #8 (cursor/ssrf-ocr-gate-0e28, c5caff7). This branch does not merge, publish, sign, or retag v0.0.1.

Source 7617d696213d3f2bc824f41ed18b1ab904a80335. The 39f6c9e artifact (13603251941) still has the private ACL, and it does not answer a JSON line. Do not point ZCode at that helper.

The committed helper read stdin until it saw a Content-Length header. A JSON line with the pipe left open produced no stdout. npx runs mathscrap-mcp-stdio, which speaks one JSON object per line and POSTs it to the window's loopback listener. It does not spawn mathscrap-mcp.exe.

A normal window close deletes the session and endpoint before the runtime calls process::exit. Ending the process with taskkill does not.

Artifact

Workflow run: https://github.com/DNTOF/MathScrap/actions/runs/42447911927

All three jobs succeeded. Artifact mathscrap-mcp-test-windows id 13604726585 is an Actions artifact, not a GitHub Release. The Windows job started the packaged window and the npx client. initialize returned mathscrap 0.0.2-dev, tools/list returned 7 tools, and page_read returned formulas=0 for that empty runner window. CloseMainWindow then exited and the session files were gone. That is not the parent PC and not ZCode.

81e17ec109f0b01a62701e9f124320f1efa6e713c1bae4316dbc52e7bda8b5da  MathScrap-mcp-test-windows-x64.exe
4340594a07ef4fcf3e6748a17fbd7364351882a76e0697b1d48956f7926fa7a2  mathscrap-mcp.exe
14c10e20d7275993447ed58aef26fb9967567ca80d35a4b9ef4455fda19080e8  mathscrap-mcp-stdio-0.0.2-dev.tgz
bd6d87faf94ef266a4f8f783acc72fef3bedc4534a7bb04342d7e3e9e66274fd  mcp-stdio-probe.mjs
7480d3d9d1f8685ff010cc50a6226481476ce787593f942d8593fddcc8b5a07f  PROVENANCE.txt

signed=no, github_release=no, official_v0.0.1=no, profile mcptest, session directory %LOCALAPPDATA%\MathScrap-mcptest\mcp. These bytes match the sums above. Nothing was published to npm.

What to run

Leave C:\Users\AllowCache\AppData\Local\MathScrap\mathscrap.exe alone. Unzip into a new folder, for example C:\Users\AllowCache\AppData\Local\MathScrap-mcptest-run\. Start MathScrap-mcp-test-windows-x64.exe and leave that window open. cwd is C:\Users\AllowCache. No extra env. Back up C:\Users\AllowCache\.zcode\cli\config.json, then in a new ZCode session add:

"mathscrap-test": {
  "type": "stdio",
  "command": "npx.cmd",
  "args": ["--yes", "--package", "C:\\Users\\AllowCache\\AppData\\Local\\MathScrap-mcptest-run\\mathscrap-mcp-stdio-0.0.2-dev.tgz", "mathscrap-mcp-stdio"]
}

/mcp list, then /mcp connect mathscrap-test, then page_read. Do not use zcode -p and do not restart the open chat.

From that folder, with the window still open:

node mcp-stdio-probe.mjs npx.cmd --yes --package mathscrap-mcp-stdio-0.0.2-dev.tgz mathscrap-mcp-stdio

page_read=ok means the open test window answered. The probe prints redacted snippets and does not print the token.

Open in Web Open in Cursor 

DNTOF and others added 5 commits November 8, 2026 02:53
The window listens on 127.0.0.1 and a stdio helper forwards MCP into the open page. The test profile is unsigned, uses its own identifier, and is not a release.

Co-authored-by: DNT_OF <allowcache@gmail.com>
Create the session directory and files with a protected DACL before the token is written, and delete them when the window closes or MCP is turned off. A swapped or overly broad session file is refused.

Co-authored-by: DNT_OF <allowcache@gmail.com>
Use CreateDirectory and CreateFile so the protected ACL exists before the token is written. The phone sheet test waits until the type tool is selected before the touch, so the tap cannot still see the pen.

Co-authored-by: DNT_OF <allowcache@gmail.com>
A bare JSON line never completed the helper's Content-Length read, so
initialize produced no reply. npx mathscrap-mcp-stdio forwards newline
JSON to the loopback window and does not spawn the helper. A normal
window close deletes the session files before the runtime exits.

Co-authored-by: DNT_OF <allowcache@gmail.com>
Co-authored-by: DNT_OF <allowcache@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant