Repository navigation
feat: document reader: /api/v1/read, hosted MCP read_url, readm3 read (0.32.0) - #86
Merged
Merged
Conversation
GET|POST /api/v1/read and the read_url tool (readm3 mcp and the hosted https://readm3.com/mcp) return the text of a PDF, web page, office document, EPUB or text file. Public addresses only, checked on every redirect; 25 MB cap. No account: 20 reads an hour per address, then 402 with an x402 offer for a $1 day pass; a signed-in account, pass or Power Key is not metered. readm3 read URL on the CLI. 0.32.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a document reader so c0mpute / Infernet chat (and any agent) can summarize a link such as https://arxiv.org/pdf/2106.01820.
server/read.ts: SSRF-guarded fetch (http(s) only, every hop resolved and refused if any address is private/loopback/link-local/CGNAT/mapped, manual redirects ≤5, 25 MB cap, 30 s) and extraction: PDF viaunpdf(zero deps), HTML to light Markdown, office/EPUB viaextract.ts, text as is. Scanned PDFs are refused, not guessed.GET|POST /api/v1/read→{title, kind, pages, bytes, chars, truncated, text}.https://readm3.com/mcp(stateless Streamable HTTP JSON-RPC, no login) with one tool,read_url. Onlytools/callis metered, so the handshake is free.server/read-gate.ts: a second@profullstack/x402-gatewaywithfreeQuotaon the reader paths only: 20 reads/hour per address, then 402 + x402 offer for a $1 day pass (/read/pass). Pass, Power Key, verified session cookie or readm3 API token skip it (a made-up cookie does not). Env:READM3_FREE_READS,READM3_FREE_READS_WINDOW,READM3_READ_PRICE_CENTS.read_urlinreadm3 mcp,readm3 read URLon the CLI, README + llms.txt.Tests:
server/test/read.test.ts(11: address checks, redirect into metadata IP, PDF/HTML/text, caps, gate quota/401/fake cookie, MCP). Full server suite 119 pass, unit 228 pass, typecheck clean. Smoked locally against the real arXiv PDF (17 pages, 40,154 chars) and abs page via /mcp, and saw the 402 after the allowance.🤖 Generated with Claude Code