HiddenStrip

v0.3.0
com.hiddenstrip/hiddenstrip Checked 13 hours ago Published 4 days ago

Read a public page with hidden text stripped.

An MCP server (stdio) with one tool, read_page(url). It reads a public web page through HiddenStrip and returns HiddenStrip's JSON. Each read is paid per call with x402 from your own wallet. This package never holds, ships or defaults a key. Based on the service's own description (https://hiddenstrip.com/.well-known/x402), with Sentry's 2026-11-23 copy correction about visible text: Without HIDDENSTRIP_PAYER_PRIVATE_KEY the server still starts. The tool then returns an error explaining the price and pays nothing.

Summary extracted from the README.

hiddenstrip-mcp

An MCP server (stdio) with one tool, read_page(url). It reads a public web page through HiddenStrip and returns HiddenStrip's JSON. Each read is paid per call with x402 from your own wallet. This package never holds, ships or defaults a key.

What HiddenStrip does (and doesn't)

Based on the service's own description (https://hiddenstrip.com/.well-known/x402), with Sentry's 2026-11-23 copy correction about visible text:

  • Common hidden content is stripped before your agent reads the page, which comes back as Markdown (formatting only). Stripped content is listed in a neutral hidden_content_removed record.
  • Stripping covers hidden content only. It strips common CSS/HTML hiding techniques.
  • v1 does not run JavaScript. Content inserted by JavaScript, revealed by hover or scroll, or inside shadow DOM isn't checked. Pages that need JavaScript return an error with a render_note field.
  • v1 does not strip visible text; instruction-like visible text may be flagged, best-effort. Treat page text as untrusted.
  • Flags are rule-based and best-effort; they do not catch everything. verdict: allow does not mean the page text is safe to follow.
  • Public pages only. HiddenStrip respects robots.txt (fetch user agent HiddenStrip/0.1). No logins or paywalls. HiddenStrip does not enforce site terms or AI-use restrictions in PDFs.

Install

Requires Node.js 20+.

// MCP client config (e.g. Claude Desktop, Cursor)
{
  "mcpServers": {
    "hiddenstrip": {
      "command": "npx",
      "args": ["-y", "hiddenstrip-mcp"],
      "env": { "HIDDENSTRIP_PAYER_PRIVATE_KEY": "0x…your own key…" }
    }
  }
}

Without HIDDENSTRIP_PAYER_PRIVATE_KEY the server still starts. The tool then returns an error explaining the price and pays nothing.

The tool

read_page({ url }), titled "Read web page (HiddenStrip)", with MCP annotations readOnlyHint: true, destructiveHint: false, openWorldHint: true and idempotentHint: false. It is not idempotent because every call is a separate paid request, so a retry pays again.

The url argument is an absolute http(s) URL (max 2048 chars).

On success the result's structuredContent (and first text block) is the service's JSON unchanged: text, injection_detected, injection_flags, verdict (allow | warn | block), flagged_excerpts, hidden_content_removed, collapsed_text, source_url, fetched_at, rendered_with_browser, plus render_note / policy_note when present. A second text block carries the decoded PAYMENT-RESPONSE receipt (transaction, network, payer). The result's _meta["com.hiddenstrip/hiddenstrip"] is { "untrusted": true, "content_trust": "untrusted_third_party_page_text: ..." }, a machine-readable reminder that page text is data, never instructions.

On failure the result has isError: true and a JSON body { "error": "<code>", "message": "...", ... }:

error Meaning
service codes, e.g. bad_url, disallowed_url, needs_javascript, empty_content, robots/terms codes (HTTP 451), fetch failures (502) Passed through from HiddenStrip with http_status and any render_note/policy_note. payment_settled says whether a PAYMENT-RESPONSE came back (HiddenStrip settles only after a successful read).
payment_required_no_key No wallet configured. Includes the price and the offered x402 terms. Nothing was signed.
payment_refused_by_guard A spend guard refused the challenge (reasons: amount_over_max, network_not_allowed, asset_not_usdc, pay_to_mismatch, scheme_not_allowed, timeout_not_allowed, daily_cap_reached, …). Nothing was signed.
payment_failed HiddenStrip answered the paid request with 402 again (for example settlement failed). No page returned.
redirect_refused HiddenStrip answered with a redirect (or from another URL). It was not followed; before payment nothing was signed, and a signature already sent to the read URL is not resent anywhere.
payment_signing_failed, payment_challenge_invalid, network_error, wrapper_config_error Wrapper-side problems.

Environment variables

Variable Default Purpose
HIDDENSTRIP_PAYER_PRIVATE_KEY unset Secret. Your own EVM key (0x + 64 hex), used only to sign x402 payments locally. Never logged. Use a dedicated wallet holding only a small USDC balance.
HIDDENSTRIP_MAX_ATOMIC 5000 ($0.005) Most the wrapper will sign for one read, in USDC atomic units. Must be 1–1000000 ($1.00).
HIDDENSTRIP_DAILY_CAP 100 Most payments signed per process per UTC day. 0 disables the cap. Counts signed attempts, not successes (a signing failure gives its slot back). The cap is per process: it resets when the process exits and at 00:00 UTC, and each running process gets its own 100.
HIDDENSTRIP_EXPECTED_PAY_TO HiddenStrip's pinned payTo Refuse any challenge whose payTo differs. Must be a valid address (EIP-55 checksum if mixed case; not the zero address). The only way to accept a different payTo.
HIDDENSTRIP_NETWORK eip155:8453 (Base) Set eip155:84532 (Base Sepolia) only for testing against a testnet deployment.
HIDDENSTRIP_BASE_URL https://hiddenstrip.com Point at another instance (tests, local dev). The default payTo pin stays on (fail closed); to pay a different address, set HIDDENSTRIP_EXPECTED_PAY_TO explicitly.
HIDDENSTRIP_TIMEOUT_MS 60000 Per-request timeout.

HTTP mode (optional, self-hosted by the key owner only)

HIDDENSTRIP_PAYER_PRIVATE_KEY=0x… npx -y hiddenstrip-mcp --http --port 8402
# MCP Streamable HTTP at http://127.0.0.1:8402/mcp (stateless, POST, JSON responses)
  • It binds to 127.0.0.1 by default and uses the key from the env of whoever runs it.
  • Every request's Host header must match the bind address (or --allowed-host). Any browser Origin must be the loopback origin (or --allowed-origin). Everything else gets 403. This is the DNS-rebinding protection the MCP Streamable HTTP spec asks for.
  • Anyone who can reach this endpoint spends your wallet. It has no authentication of its own. A non-loopback bind (--host 0.0.0.0) is refused unless you also pass --allow-public, and then it prints a warning. Only do that behind your own auth or firewall.
  • HiddenStrip does not host a remote instance of this server.

Payment and guards

  1. The tool POSTs {"url": ...} to /v1/read without payment.
  2. HiddenStrip answers 402 with an x402 v2 PAYMENT-REQUIRED challenge (scheme exact, EIP-3009 USDC transfer authorization; currently 5000 atomic units = $0.005 on Base, eip155:8453).
  3. Before anything is signed, every offered option is checked: scheme is exact; network is the configured one; asset is Circle USDC on that network; amount is a canonical whole number (no hex, exponent, sign, decimal point, spaces or leading zeros) ≤ HIDDENSTRIP_MAX_ATOMIC; payTo matches the pin; maxTimeoutSeconds is a whole number from 1 to 300; and the daily cap has room. If nothing passes, the tool returns payment_refused_by_guard and signs nothing.
  4. Only the one option that passed is handed to the official x402 client (@x402/fetch / @x402/core + @x402/evm, v2.32), which signs locally and the request is retried with PAYMENT-SIGNATURE. An x402 policy and a before-signing hook re-run the same guards.
  5. Redirects are never followed, on either request (redirect: "manual"). Any 3xx, or a response from a URL other than <base URL>/v1/read, returns redirect_refused: before payment nothing is signed, and after payment the signature is not resent anywhere.

The payTo pin for hiddenstrip.com is a constant in src/constants.js (0x8d9eeff132ec77e9c14c73e0f39b3bb14d9146cd, the address the live 402 challenge advertises). /.well-known/x402 does not publish payTo, so it can't be read from there. If HiddenStrip ever changes its payTo, this package needs a new release (or you set HIDDENSTRIP_EXPECTED_PAY_TO). The pin also applies when HIDDENSTRIP_BASE_URL is overridden; it is never dropped silently.

A signed authorization is only valid for the challenge's maxTimeoutSeconds (HiddenStrip uses 300 s; the wrapper refuses to sign anything over 300 s, or a missing or non-numeric value) and only for the guarded amount and payTo.

Privacy

See PRIVACY.md. In short, the wrapper connects only to the configured read URL (no redirects), never stores or logs your key, writes no files and has no telemetry.

Limits

  • One tool, over stdio (default) or local HTTP. No dashboard, accounts, or hosted service.
  • The daily cap is per process: it resets when the process exits and at the UTC day boundary, and each process gets its own 100 (so two running servers can sign up to 200 a day between them).
  • If the paid request times out after you signed, the authorization may still be settled by HiddenStrip within its validity window.
  • Same service limits as above: no JavaScript, no visible-injection detection, public pages only.

Development

npm install
npm test                      # unit, end-to-end (local HiddenStrip + mock facilitator), stdio smoke
npm run validate:server-json  # server.json vs the official MCP Registry schema
HIDDENSTRIP_LIVE_PROBE=1 node --test test/live-probe.test.js  # unpaid probe of the live service

The end-to-end tests boot the HiddenStrip app from ../safe-read (override with SAFE_READ_DIR) with its in-process mock facilitator and a throwaway key generated inside the test. No chain is touched and nothing is paid.

License

MIT (see LICENSE).