Skip to content

Add vision-ready Paperless document retrieval - #224

Merged
aleksclark merged 3 commits into
mainfrom
aleks/paperless-improve
Sep 6, 2026
Merged

Add vision-ready Paperless document retrieval#224
aleksclark merged 3 commits into
mainfrom
aleks/paperless-improve

Conversation

@aleksclark

Copy link
Copy Markdown
Collaborator

Summary

  • expose Paperless thumbnails and previews as native MCP media so vision-capable models can inspect document orientation and read static images without decoding base64
  • preserve PDFs as embedded resources and add isolated live coverage for thumbnail, preview, and OCR retrieval

Test plan

  • PAPERLESS_LIVE_TEST=1 go test ./integrations/paperless -run '^TestLiveDocumentVision$' -v against paperless.fleet.clark.team
  • make ci

💘 Generated with Crush

Expose thumbnails, image previews, and PDFs as native MCP media so models can inspect orientation and read document content without decoding base64 envelopes.

💘 Generated with Crush

Assisted-by: Crush:gpt-5.6
Co-Authored-By: GPT-5.6 <noreply@anthropic.com>

@acmacalister acmacalister left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition — native ImageContent/EmbeddedResource for Paperless thumbnails and previews is the right shape, and the unit + live coverage around it looks solid. CI is green (build/test/lint/security/rust-sdk/compose). A couple of follow-ups inline: project-scoped execute still drops Media, and the response size check only sees the metadata JSON.

Comment thread server/server.go
Comment thread server/server.go
Comment thread integrations/paperless/paperless.go Outdated
Preserve media on project-scoped endpoints, apply response limits to binary payloads, and use predictable file extensions for common image formats.

💘 Generated with Crush

Assisted-by: Crush:gpt-5.6
Co-Authored-By: GPT-5.6 <noreply@anthropic.com>

@acmacalister acmacalister left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is green (build/test/lint/security/rust-sdk/compose) and the follow-ups from the earlier pass look solid — shared toolResultContent/toolResultBytes, project-router parity, JPEG extension map. One real functional gap left: media is now counted toward the 50KB server cap, but Paperless never raises that cap for thumbnail/preview, so typical documents will fail on the MCP path even though adapter + unit tests pass.

Comment thread integrations/paperless/paperless.go
Raise response headroom only for thumbnail and preview tools so real documents pass through the media-aware server limit while other Paperless responses keep the default cap.

💘 Generated with Crush

Assisted-by: Crush:gpt-5.6
Co-Authored-By: GPT-5.6 <noreply@anthropic.com>

@acmacalister acmacalister left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR — CI is green across build/test/lint/security/rust-sdk/compose, and the earlier follow-ups (shared media conversion on both execute surfaces, media bytes in the response cap, stable JPEG extensions, and 5MB per-tool headroom for thumbnail/preview) all look correctly wired. LGTM.

@aleksclark
aleksclark merged commit c70e70a into main Sep 6, 2026
6 checks passed
@aleksclark
aleksclark deleted the aleks/paperless-improve branch September 6, 2026 14:22
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.

2 participants