MCP SERVER
Confluence integration with three-way sync — source specs, build artifacts, and live pages tracked independently.
| Tool | Purpose | Returns |
|---|---|---|
| publish_file | Publish to Confluence from YAML spec, inline blocks, or raw XHTML. Creates or updates pages. Auto-compiles specs through the build pipeline. | Page ID, version, URL, diagram upload results |
| push | Batch publish compiled XHTML from .build/ to Confluence. Skips unchanged pages via content hash. Warns on remote conflicts. | Per-page sync status, push/skip/conflict counts |
| status | Three-way comparison: source specs vs .build/ artifacts vs Confluence. No compilation, no API calls unless remote=true. | Per-page status: clean, source_modified, build_modified, stale, remote_modified, conflict, new |
| build | Compile YAML page specs to .build/ directory. Incremental — skips unchanged sources. Renders diagram SVGs alongside XHTML. | Build results with built/skipped/error counts |
| edit_page | DOM-edit a live page in memory. Fetches XHTML, applies operations (move, delete, replace, insert, merge, wrap, unwrap, inject), republishes. | Applied operations list, final section map |
| retheme_page | Swap color scheme on a live page. Reverse-maps RGB values to palette positions, replaces with target scheme, republishes. | Scheme transition, replacement count |
| screenshot | Capture a Confluence page as rendered PNG via headless Chromium. Full-page or viewport. | PNG image data |
| fetch_page | Download page content by numeric ID, URL, display path, or short link. Supports historical versions. | Title, space, XHTML content, version |
| get_page_context | Fetch a page with its parent, siblings, and children in one call. Hierarchy snapshot. | Page metadata with full neighborhood |
| search_pages | CQL search across Confluence. Full query language support. | Matching pages with title, space, excerpt |
| diagram_publish | Upload SVG as page attachment and return ac:image embed XHTML. Stable filenames for iterative overwrite. | Attachment ID, embed XHTML |
| upload_attachment | Attach any file to a page. Overwrites existing attachment with same filename. | Attachment ID, filename, download URL |
| move_page | Reparent a page in the Confluence hierarchy. Preserves title and content. | Confirmation |
| delete_page | Move a page to trash. Recoverable. | Confirmation |
| add_label | Add labels to a page. Comma-separated for batch. | Updated label list |
| remove_label | Remove a single label from a page. | Confirmation |
| get_page_labels | List all labels attached to a page. | Label names |
| get_pages_by_label | Find pages with a specific label. Sorted by last modified. | Matching pages |
| add_comment | Add a footer comment to a page in XHTML storage format. | Comment ID |
| get_page_comments | List footer and inline comments. Includes resolved status for inline comments. | Comment bodies, authors, inline metadata |
| list_child_pages | List children of a page. Paginated. | Child page titles and IDs |
| get_page_ancestors | Breadcrumb chain from root to parent. | Ancestor page list |
| list_spaces | Browse available Confluence spaces. Filter by global or personal. | Space keys, names, types |
| get_space | Space details — name, description, homepage. | Space metadata |
| get_recent_changes | Recently modified pages across Confluence. Optional space filter. | Pages sorted by modification time |
| get_current_user | Authenticated user profile and personal space. | Username, display name, space key, homepage ID |
| login | Re-authenticate via cloudflared. Opens browser, blocks 30-120s. Call on 401 errors. | New access token |
Most wiki tools treat pages as remote state you fetch and push. Wiki tracks three independent states — the YAML source spec, the compiled build artifact, and the live Confluence version — and compares them without touching the network unless you ask.
YAML page specs live in the pages repo. Each spec declares blocks, scheme, density, and separation. The spec is the source of truth — edits happen here, not in Confluence. Source hash tracks whether the spec changed since last build.
wiki_build compiles specs to .build/ — XHTML files plus diagram SVGs rendered by svg-tools. Incremental by default: unchanged sources are skipped. The build directory is inspectable before publishing. Compiled hash tracks whether the artifact changed since last push.
Confluence pages carry a version number that advances on every edit. wiki_push compares the compiled hash against .sync.json and the remote version against the synced version. Seven possible states: clean, source_modified, build_modified, stale, remote_modified, conflict, new.
Two tools bypass the file pipeline entirely. They fetch a live page, transform its XHTML in memory, and republish — no local files, no build step, no sync state. The page is the input and the output.
edit_page fetches a page's storage-format XHTML, parses it into a DOM, applies a sequence of structural operations — move sections, delete blocks, replace content, insert new elements, merge adjacent sections — then serializes and republishes. The operation vocabulary comes from xhtml-tools. Tag balance is verified before every publish.
retheme_page fetches a page, reverse-maps every RGB value in the XHTML to its position in the source color scheme's palette, then replaces each with the corresponding color from the target scheme. Auto-detects the source scheme by frequency analysis. A page themed in ocean becomes sunset in one call — no manual color editing.
The compilation engine. Wiki delegates all YAML-to-XHTML compilation, DOM parsing, section identification, operation application, and scheme color mapping to xhtml-tools. Wiki is the Confluence transport layer — xhtml-tools is the content brain.
Diagram rendering. When a page spec contains diagram blocks, the build pipeline compiles diagram specs to SVG via svg-tools, writes them to .build/, and uploads them as Confluence attachments on publish. Automatic — no manual diagram_publish calls needed.
The shared type system. PageSpec defines the block vocabulary — hero, cards, table, prose, diagram, flow_chain, and more. Both wiki (for building) and xhtml-tools (for compiling) depend on page-spec for the canonical block definitions.
The server that publishes itself.