It would be amazing if I could have Claude etc generate diagrams (say SVGs) and upload/insert them into generated documentation using the MCP server. At the moment I have to manually copy and paste them in which breaks down the amazing benefits from using confluence and the mcp server for docs. I love the connector btw :)
I've been struggling with this whole week... 😅
I mean, it's not that bad, but it can get quite annoying when you have to add/copy attachments manually.
Anyhow, as Viswanathan said, ECO-1265 is a place to look at > I'd recommend setting yourself as a watcher. I do believe they've mentioned somewhere that this should be shipped this or next quarter, but we'll see. 👀
It will definitelly save a lot of time in some cases.
Cheers,
Tobi
I believe current Confluence MCP servers rely on standard REST API v2 endpoints for reading and writing Confluence Storage Format (XML/HTML) text content.
Uploading and displaying visuals involves a two-step process that most standard MCP implementations don't combine into a single tool yet.
Looks like a feature request is open for this https://jira.atlassian.com/browse/ECO-1265
GitHub reference specifically requests tools (getConfluencePageAttachments, uploadConfluenceAttachment) to fetch and upload media natively without needing external scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Scott — the missing half probably isn't your config: Confluence Cloud REST v2 has no "create attachment" operation at all. /wiki/api/v2/pages/{id}/attachments is read-only, so an MCP server built purely on v2 can write the page text but has nowhere to put the file. Uploading still lives on the older v1 endpoint, which is why it tends to be absent from MCP tool sets.
While ECO-1265 is open you can close the loop yourself with two calls, and they wrap neatly into one custom MCP tool:
1) Upload the file (v1, multipart)
POST /wiki/rest/api/content/{pageId}/child/attachment
header: X-Atlassian-Token: nocheck
form fields: file=@diagram.svg and minorEdit=true
Scope: write:confluence-file on a classic-scope app, or the granular attachment-write scope. Worth checking first — a read-only token here tends to fail quietly rather than loudly.
2) Reference it from the page body (v2 update)
PUT /wiki/api/v2/pages/{id} with body.representation = "storage" and the markup
<ac:image><ri:attachment ri:filename="diagram.svg"/></ac:image>
That request also needs id, status, title and version.number = current + 1. Keeping the body in storage rather than ADF is what makes the image reference a one-liner.
Two things that cost me time: attach first and update the body second, otherwise the reference renders as a broken image; and if a model-generated SVG looks wrong on the page (they often carry foreignObject or system fonts), re-export it as PNG once to confirm you're looking at an SVG problem and not an API problem.
Disclosure: I work on Diagram.now, a Confluence diagramming app, so I'm biased on this last part. It may still be worth weighing the other shape of the problem: an attachment is a flat picture, so every "move that one box" means regenerating and re-uploading the whole file. Keeping it as an editable diagram on the page — importing the Mermaid your model already emits, or describing it in text and adjusting it in the editor afterwards — avoids that round trip. https://marketplace.atlassian.com/apps/523472243/diagram-now-diagram-editor-for-confluence?utm_source=atlassian-community&utm_content=mcp-image-insert
The two REST calls above are worth having either way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community !!
As Vishwa suggest a mktplace app can help to render mermaid diagrams directly in Confluence. If you are open to try out one, take a look at
Mermaid Diagrams & Charts for Confluence
The app has more than 15 diagramming templates and also integrates with your code repositories like GitHub/Bitbucket.
Disclaimer : I am part of the app dev team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.