feat(mcp): add read-only attachments surface (pad_attachment)#875
Merged
Conversation
Wire the existing attachment HTTP dispatchers onto the MCP catalog as a new read-only pad_attachment tool with list/show actions, mirroring the CLI `pad attachment list` / `pad attachment show`. Both dispatch paths already existed (ExecDispatcher via passThrough, HTTPHandlerDispatcher via dispatch_http_attachments.go) — this exposes them on the tool surface. - New tool rather than pad_item actions: an attachment is its own workspace-scoped resource, not an item property; a dedicated tool keeps pad_item's action enum focused. - Read-only only: upload/download/view stay CLI-only (filesystem-bound), matching the catalog's exclusion rules. - Bumps ToolSurfaceVersion 0.10 -> 0.11; updates instructions.md, README, CLAUDE.md, readOnlyActions, and the drift-guard fixtures. - The base64 image RESOURCE for multimodal agents is deferred to TASK-2076 (ResourceFetcher returns strings; no CLI base64-to-stdout path exists — non-trivial, out of scope here). TASK-2017 Claude-Session: https://claude.ai/code/session_019knGmnHcx5rrgWXQ8V8DZS
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.
What
Wires the existing (but previously unexposed) attachment HTTP dispatchers onto the MCP catalog as a new read-only
pad_attachmenttool withlist/showactions, mirroring the CLIpad attachment list/pad attachment show.Attachments had zero MCP surface even read-only, though
internal/mcp/dispatch_http_attachments.go(+ its tests) already existed. Both dispatch paths now reach the surface:passThrough([]string{"attachment", "list"|"show"})shells out to the CLI.dispatchAttachmentList/dispatchAttachmentShow(ref→UUID resolution, attached/unattached fold, HEAD-header extraction).Decisions
pad_attachmenttool, notpad_itemactions. An attachment is its own workspace-scoped resource (optionally item-linked), not an item property. A dedicated tool keepspad_item's already-large action enum focused, and matches the HTTP dispatcher's first-classattachment list/attachment showcmdPaths.upload/download/viewstay CLI-only (filesystem-bound), excluded per the catalog's exclusion rules (same rationale as thenoRemoteEquivalenttable).collectionfilter documented as collection UUID, not slug — matches the CLI flag and the server filter (Codex review catch).pad://workspace/{ws}/attachments/{id}returning base64 for small images is genuinely non-trivial (ResourceFetcher returns strings; no CLI base64-to-stdout path; needs a size gate + MIME allowlist + HTTP-dispatcher parity). Routed to TASK-2076 rather than expanding this PR.Version bump
ToolSurfaceVersion0.10 → 0.11. Updated in lockstep:internal/mcp/version.gochangelog,instructions.md,README.md,CLAUDE.md,cmd/pad/mcp.go+catalog_meta.gohelp text,readOnlyActions, and the drift-guard test fixtures.Gates
golangci-lint,go test ./...,go build ./cmd/pad, andgo test ./internal/mcp/...(drift guard) all green. Codex review CLEAN.TASK-2017
https://claude.ai/code/session_019knGmnHcx5rrgWXQ8V8DZS