Skip to main content

runspec-confluence

A Confluence runnable for runspec, ported from the Atlassian MCP server onto atlassian-python-api — pages, spaces, comments, labels, restrictions and attachments, on Cloud and Server/Data Center. One runnable — confluence — with 20-plus verbs. pip install it into a venv and it's discoverable by runspec local, runspec serve (MCP), and runspec-console.

runspec serve flattens each verb into a leaf MCP tool (confluence_get-page, …). Read verbs are autonomy = "autonomous"; writes are autonomy = "confirm".

Install

pip install runspec-confluence

Verbs

Area Verbs
Search search (CQL), search-text, search-by-label
Spaces list-spaces, get-space, get-space-pages
Pages (read) get-page, get-page-children, get-page-ancestors, get-page-history, get-page-restrictions, whoami
Pages (write) create-page, update-page, delete-page, move-page
Labels & comments get-labels, add-label, get-comments, add-comment
Attachments get-attachments, download-attachments, upload-attachment, delete-attachment
Macros & diagrams list-macros, get-diagram, download-diagram, add-diagram

Page bodies pass in a Confluence representation via --content-format (storage / wiki / editor / markdown); markdown is converted to storage XHTML client-side (best-effort).

Macros and diagrams

get-page --markdown renders macros readably: code and PlantUML/Mermaid macros become fenced blocks tagged with their language, info/note/tip/warning panels become block quotes, expand becomes a bold title over its body, and a draw.io or Gliffy diagram becomes a placeholder such as [draw.io diagram "arch" rev 3].

draw.io and Gliffy keep the diagram itself as a page attachment, so:

  • list-macros --page-id 123 lists every macro on the page with its parameters.
  • get-diagram --page-id 123 [--name arch] reads the diagram as text: its shapes (labels, containing group) and connectors (source -> target [label]). Works with draw.io's compressed and uncompressed formats; Gliffy is best-effort. A diagram embedded from another page (inc-drawio) is read from that page.
  • download-diagram --page-id 123 --dest ./out saves the .drawio / .gliffy source and the .png preview.

draw.io diagrams are read-only: creating or editing one would also need a fresh PNG preview, which only draw.io can render.

Creating diagrams

add-diagram puts a diagram written as text on a page as an image, with the source in a collapsed "Diagram source" block under it so it can be edited and re-rendered later. Re-adding the same --name replaces the image.

Render the PNG first and pass it with --image. In runspec-console the agent does this with the built-in render_diagram tool, which needs nothing installed:

confluence add-diagram --page-id 123 --kind mermaid --name "Order flow" \
  --image order-flow.png \
  --source $'graph TD\n  Cart-->Checkout\n  Checkout-->Payment'

The image path is on the host the runnable runs on, so a remote host needs the PNG uploaded there first.

Without --image, it uses a renderer the operator turned on for the host. Both are off by default; with neither set, the call refuses before touching the page.

  • Kroki: a Kroki server renders the text to PNG. Works on any Confluence, for mermaid, plantuml, c4plantuml, graphviz, d2, ditaa, erd, nomnoml, bpmn and structurizr.
  • macro: inserts your Mermaid or PlantUML app's macro with the text as its body, so Confluence draws it live and people can edit it. Needs the app.
Env var Meaning
CONFLUENCE_KROKI_URL Kroki server, e.g. a self-hosted https://kroki.example.com. The public kroki.io sees your diagram text, so prefer your own.
CONFLUENCE_DIAGRAM_MODE macro or image. Unset: Kroki when a Kroki URL is set, else nothing.
CONFLUENCE_MERMAID_MACRO Your Mermaid app's macro name (vendors differ; list-macros on a page with one shows it). Needed for Mermaid in macro mode.
CONFLUENCE_PLANTUML_MACRO PlantUML app's macro name, default plantuml.

All take the usual CONFLUENCE_<ENV>_ prefix. With a Kroki URL set, macro mode checks the text renders before touching the page.

Auth — env vars only

export CONFLUENCE_URL=https://your-org.atlassian.net/wiki
# Cloud (API token):
export CONFLUENCE_USERNAME=you@example.com
export CONFLUENCE_API_TOKEN=<api-token>
# …or Server/DC (Personal Access Token):
export CONFLUENCE_PERSONAL_TOKEN=<pat>

Cloud vs Server/DC is detected from a .atlassian.net host or set with CONFLUENCE_CLOUD. Every verb takes --env, selecting CONFLUENCE_<ENV>_* prefixed vars. The PAT can instead ride the runspec-console secret channel via the optional --confluence-pat (a password-typed arg, refused on the CLI, kept out of logs).

confluence search --cql "space = OPS AND type = page"
confluence get-page --page-id 123456
confluence create-page --space OPS --title "Runbook" --content-format markdown --body "# Steps"

Public Python API

The pure logic is in runspec-confluence-core — over atlassian-python-api + markdown, no runspec dependency, no entry points. Every op takes a ConfluenceConfig first arg and raises ConfluenceError, so a private wrapper can inject credentials and bake in a default space / env:

from runspec_confluence_core import config_from_env, build_client, get_page

cfg = config_from_env(env="prod")
page = get_page(cfg, page_id="123456")

Development

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
ruff check . && ruff format --check .
pytest

Metadata

Release files for runspec-confluence 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runspec-confluence 0.8.0
File Size Uploaded
runspec_confluence-0.8.0.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for runspec-confluence 0.8.0
File Interpreter ABI Platform
runspec_confluence-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / runspec_confluence-0.8.0.tar.gz

Download URL runspec_confluence-0.8.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
04374fb3804a9af5205dfbeb1c3851012f3f24a10b873645dcadacc69ca48299
BLAKE2b-256 checksum
How to use checksums
25a0c91619f565551e2d5df0a367316b850f44a696c61e8a1014694c7b94c3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / runspec_confluence-0.8.0-py3-none-any.whl

Download URL runspec_confluence-0.8.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e467afe16303dcfc4de6e338f01bc8caa3484bebad0e864988f5ee84d75ce1e1
BLAKE2b-256 checksum
How to use checksums
0e31c8a5141c2a42a8bc953542d41bf749c819cfe137bbe612297ea12e99374e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page