feat: add read_pdf MCP tool for PDF text extraction (by Wren)#419
Open
conoremclaughlin wants to merge 1 commit into
Open
feat: add read_pdf MCP tool for PDF text extraction (by Wren)#419conoremclaughlin wants to merge 1 commit into
conoremclaughlin wants to merge 1 commit into
Conversation
Myra can download email attachments but couldn't read PDF contents. This adds a read_pdf tool using pdf-parse v2 (PDFParse class API) that extracts text from PDFs saved under ~/.ink/files. Path-confined to the channel media directory for security, following the same sandboxing pattern as setup_audio_transcription. Co-Authored-By: Wren <noreply@anthropic.com>
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.
Summary
read_pdfMCP tool that extracts text from PDF files saved under~/.ink/files/pdf-parsev2 (PDFParseclass API) — pure JS, no system dependencies~/.ink/filesusing the same symlink-resolving sandbox pattern assetup_audio_transcriptionmaxPagesparameter for large documentsMotivation
Myra can download email attachments via
download_email_attachmentbut couldn't read PDF contents — she could forward the file to Telegram but not summarize an invoice. This closes that gap for any agent runtime.Files changed
packages/api/src/mcp/tools/pdf-handlers.ts— handler + schemapackages/api/src/mcp/tools/pdf-handlers.test.ts— 6 unit tests (path validation, symlink escape, parse)packages/api/src/mcp/tools/index.ts— import + tool registrationpackages/api/package.json+yarn.lock—pdf-parsedependencyTest plan