I've been using iMCP with Claude and noticed that message attachments are referenced in the output (e.g., at_0_F1E5F818-3332-446C-B96B-E60C6ED3F0F7) but there's no way to actually retrieve them.
Use case
When Claude fetches messages, I can see that attachments exist, but I cannot view or process them. This limits the usefulness of the Messages integration – for example, I can't ask Claude to read a document someone sent me via iMessage.
Proposed solution
Add a new tool messages_attachment_fetch that retrieves attachment content:
messages_attachment_fetch:
- attachment_id: string (required) – the attachment identifier from messages_fetch
Returns:
- data: base64 encoded file content
- mime_type: string (e.g., "image/jpeg", "application/pdf")
- filename: string
Technical feasibility
Based on iMessage's SQLite structure:
attachment table in chat.db contains metadata (file path, MIME type, filename)
- Physical files are stored in
~/Library/Messages/Attachments/
- Relationship:
message → message_attachment_join → attachment
Since iMCP already uses Madrid to read chat.db, extending it to query the attachment table should be straightforward.
Sandbox considerations
The user would need to grant access to the ~/Library/Messages/Attachments/ folder via NSOpenPanel, similar to how access to chat.db is currently handled.
Optional enhancements
- Size limit parameter to avoid loading large videos
- Thumbnail generation for images
- List attachments for a specific conversation
Would love to see this feature added!
I've been using iMCP with Claude and noticed that message attachments are referenced in the output (e.g.,
at_0_F1E5F818-3332-446C-B96B-E60C6ED3F0F7) but there's no way to actually retrieve them.Use case
When Claude fetches messages, I can see that attachments exist, but I cannot view or process them. This limits the usefulness of the Messages integration – for example, I can't ask Claude to read a document someone sent me via iMessage.
Proposed solution
Add a new tool
messages_attachment_fetchthat retrieves attachment content:Technical feasibility
Based on iMessage's SQLite structure:
attachmenttable inchat.dbcontains metadata (file path, MIME type, filename)~/Library/Messages/Attachments/message→message_attachment_join→attachmentSince iMCP already uses Madrid to read
chat.db, extending it to query theattachmenttable should be straightforward.Sandbox considerations
The user would need to grant access to the
~/Library/Messages/Attachments/folder viaNSOpenPanel, similar to how access tochat.dbis currently handled.Optional enhancements
Would love to see this feature added!