MCP SERVER

WIKI

Confluence integration with three-way sync — source specs, build artifacts, and live pages tracked independently.

27
tools
3
content sources
7
sync states
TOOLS
ToolPurposeReturns
publish_filePublish 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
pushBatch 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
statusThree-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
buildCompile YAML page specs to .build/ directory. Incremental — skips unchanged sources. Renders diagram SVGs alongside XHTML.Build results with built/skipped/error counts
edit_pageDOM-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_pageSwap color scheme on a live page. Reverse-maps RGB values to palette positions, replaces with target scheme, republishes.Scheme transition, replacement count
screenshotCapture a Confluence page as rendered PNG via headless Chromium. Full-page or viewport.PNG image data
fetch_pageDownload page content by numeric ID, URL, display path, or short link. Supports historical versions.Title, space, XHTML content, version
get_page_contextFetch a page with its parent, siblings, and children in one call. Hierarchy snapshot.Page metadata with full neighborhood
search_pagesCQL search across Confluence. Full query language support.Matching pages with title, space, excerpt
diagram_publishUpload SVG as page attachment and return ac:image embed XHTML. Stable filenames for iterative overwrite.Attachment ID, embed XHTML
upload_attachmentAttach any file to a page. Overwrites existing attachment with same filename.Attachment ID, filename, download URL
move_pageReparent a page in the Confluence hierarchy. Preserves title and content.Confirmation
delete_pageMove a page to trash. Recoverable.Confirmation
add_labelAdd labels to a page. Comma-separated for batch.Updated label list
remove_labelRemove a single label from a page.Confirmation
get_page_labelsList all labels attached to a page.Label names
get_pages_by_labelFind pages with a specific label. Sorted by last modified.Matching pages
add_commentAdd a footer comment to a page in XHTML storage format.Comment ID
get_page_commentsList footer and inline comments. Includes resolved status for inline comments.Comment bodies, authors, inline metadata
list_child_pagesList children of a page. Paginated.Child page titles and IDs
get_page_ancestorsBreadcrumb chain from root to parent.Ancestor page list
list_spacesBrowse available Confluence spaces. Filter by global or personal.Space keys, names, types
get_spaceSpace details — name, description, homepage.Space metadata
get_recent_changesRecently modified pages across Confluence. Optional space filter.Pages sorted by modification time
get_current_userAuthenticated user profile and personal space.Username, display name, space key, homepage ID
loginRe-authenticate via cloudflared. Opens browser, blocks 30-120s. Call on 401 errors.New access token
THREE-WAY SYNC

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.

Source Specs

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.

Build Artifacts

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.

Live Pages

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.

IN-MEMORY OPERATIONS

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.

DOM Editing

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.

Scheme Swapping

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.

INTEGRATION
xhtml-tools

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.

svg-tools

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.

page-spec

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.