Confluence Automation via Rube MCP
Automate Confluence operations including page creation and updates, content search with CQL, space management, label tagging, and page hierarchy navigation through Composio's Confluence toolkit.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Confluence connection via with toolkit
- Always call first to get current tool schemas
Setup
Get Rube MCP: Add
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming responds
- Call with toolkit
- If connection is not ACTIVE, follow the returned auth link to complete Confluence OAuth
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Create and Update Pages
When to use: User wants to create new documentation or update existing Confluence pages
Tool sequence:
- - List spaces to find the target space ID [Prerequisite]
CONFLUENCE_SEARCH_CONTENT
- Find existing page to avoid duplicates or locate parent [Optional]
CONFLUENCE_GET_PAGE_BY_ID
- Get current page content and version number before updating [Prerequisite for updates]
- - Create a new page in a space [Required for creation]
- - Update an existing page with new content and incremented version [Required for updates]
CONFLUENCE_ADD_CONTENT_LABEL
- Tag the page with labels after creation [Optional]
Key parameters:
- : Space ID or key (e.g., , ) -- space keys are auto-converted to IDs
- : Page title (must be unique within a space)
- : Parent page ID for creating child pages; omit to place under space homepage
- : HTML/XHTML content in Confluence storage format
body.storage.representation
: Must be for create operations
- : For updates, must be current version + 1
- : Optional change description
Pitfalls:
- Confluence enforces unique page titles per space; creating a page with a duplicate title will fail
- requires set to current version + 1; always fetch current version first with
- Content must be in Confluence storage format (XHTML), not plain text or Markdown
- uses while uses with
- requires a numeric long ID, not a UUID or string
2. Search Content
When to use: User wants to find pages, blog posts, or content across Confluence
Tool sequence:
CONFLUENCE_SEARCH_CONTENT
- Keyword search with intelligent relevance ranking [Required]
- - Advanced search using Confluence Query Language [Alternative]
CONFLUENCE_GET_PAGE_BY_ID
- Hydrate full content for selected search results [Optional]
- - Browse pages sorted by date when search relevance is weak [Fallback]
Key parameters for SEARCH_CONTENT:
- : Search text matched against page titles with intelligent ranking
- : Limit search to a specific space
- : Max results (default 25, max 250)
- : Pagination offset (0-based)
Key parameters for CQL_SEARCH:
- : CQL query string (e.g.,
text ~ "API docs" AND space = DOCS AND type = page
)
- : Comma-separated properties (e.g., , )
- : , , or
- : Max results (max 250; reduced to 25-50 when using body expansions)
CQL operators and fields:
- Fields: , , , , , , , ,
- Operators: , , (contains), , , , , , ,
- Functions: , ,
- Example:
title ~ "meeting" AND lastModified > now("-7d") ORDER BY lastModified DESC
Pitfalls:
CONFLUENCE_SEARCH_CONTENT
fetches up to 300 pages and applies client-side filtering -- not a true full-text search
- is the real full-text search; use for content body search
- HTTP 429 rate limits can occur; throttle to ~2 requests/second with backoff
- Using body expansions in CQL_SEARCH may reduce max results to 25-50
- Search indexing is not immediate; recently created pages may not appear
3. Manage Spaces
When to use: User wants to list, create, or inspect Confluence spaces
Tool sequence:
- - List all spaces with optional filtering [Required]
CONFLUENCE_GET_SPACE_BY_ID
- Get detailed metadata for a specific space [Optional]
- - Create a new space with key and name [Optional]
CONFLUENCE_GET_SPACE_PROPERTIES
- Retrieve custom metadata stored as space properties [Optional]
CONFLUENCE_GET_SPACE_CONTENTS
- List pages, blog posts, or attachments in a space [Optional]
CONFLUENCE_GET_LABELS_FOR_SPACE
- List labels on a space [Optional]
Key parameters:
- : Space key -- alphanumeric only, no underscores or hyphens (e.g., , )
- : Human-readable space name
- : or
- : (active) or
- : For GET_SPACE_CONTENTS, filters by space key
- : Numeric space ID for GET_SPACE_BY_ID (NOT the space key)
Pitfalls:
- Space keys must be alphanumeric only (no underscores, hyphens, or special characters)
- requires numeric space ID, not the space key; use to find numeric IDs
- Clickable space URLs may need assembly: join (relative) with
- Default pagination is 25; set explicitly (max 200 for spaces)
4. Navigate Page Hierarchy and Labels
When to use: User wants to explore page trees, child pages, ancestors, or manage labels
Tool sequence:
CONFLUENCE_SEARCH_CONTENT
- Find the target page ID [Prerequisite]
CONFLUENCE_GET_CHILD_PAGES
- List direct children of a parent page [Required]
CONFLUENCE_GET_PAGE_ANCESTORS
- Get the full ancestor chain for a page [Optional]
CONFLUENCE_GET_LABELS_FOR_PAGE
- List labels on a specific page [Optional]
CONFLUENCE_ADD_CONTENT_LABEL
- Add labels to a page [Optional]
CONFLUENCE_GET_LABELS_FOR_SPACE_CONTENT
- List labels across all content in a space [Optional]
CONFLUENCE_GET_PAGE_VERSIONS
- Audit edit history for a page [Optional]
Key parameters:
- : Page ID for child pages, ancestors, labels, and versions
- : Opaque pagination cursor for GET_CHILD_PAGES (from )
- : Items per page (max 250 for child pages)
- : Child page sort options: , , , , , , ,
Pitfalls:
- only returns direct children, not nested descendants; recurse for full tree
- Pagination for GET_CHILD_PAGES uses cursor-based pagination (not start/limit)
- Verify the correct page ID from search before using as parent; search can return similar titles
- requires the page ID, not a version number
Common Patterns
ID Resolution
Always resolve human-readable names to IDs before operations:
- Space key -> Space ID: with filter, or accepts space keys directly
- Page title -> Page ID:
CONFLUENCE_SEARCH_CONTENT
with param, then extract page ID
- Space ID from URL: Extract numeric ID from Confluence URLs or use GET_SPACES
Pagination
Confluence uses two pagination styles:
- Offset-based (most endpoints): (0-based offset) + (page size). Increment by until fewer results than are returned.
- Cursor-based (GET_CHILD_PAGES, GET_PAGES): Use the from in the response. Continue until no link is present.
Content Formatting
- Pages use Confluence storage format (XHTML), not Markdown
- Basic elements: , -, , , , , ,
- Tables: / structure
- Macros:
<ac:structured-macro ac:name="code">
for code blocks, etc.
- Always wrap content in proper XHTML tags
Known Pitfalls
ID Formats
- Space IDs are numeric (e.g., ); space keys are short strings (e.g., )
- Page IDs are numeric long values for GET_PAGE_BY_ID; some tools accept UUID format
- requires numeric ID, not the space key
- takes an integer, not a string
Rate Limits
- HTTP 429 can occur on search endpoints; honor Retry-After header
- Throttle to ~2 requests/second with exponential backoff and jitter
- Body expansion in CQL_SEARCH reduces result limits to 25-50
Content Format
- Content must be Confluence storage format (XHTML), not Markdown or plain text
- Invalid XHTML will cause page creation/update to fail
- nests body under ; uses +
Version Conflicts
- Updates require exact next version number (current + 1)
- Concurrent edits can cause version conflicts; always fetch current version immediately before updating
- Title changes during update must still be unique within the space
Quick Reference
| Task | Tool Slug | Key Params |
|---|
| List spaces | | , , |
| Get space by ID | CONFLUENCE_GET_SPACE_BY_ID
| |
| Create space | | , , |
| Space contents | CONFLUENCE_GET_SPACE_CONTENTS
| , , |
| Space properties | CONFLUENCE_GET_SPACE_PROPERTIES
| , |
| Search content | CONFLUENCE_SEARCH_CONTENT
| , , |
| CQL search | | , , |
| List pages | | , , |
| Get page by ID | CONFLUENCE_GET_PAGE_BY_ID
| (integer) |
| Create page | | , , |
| Update page | | , , , |
| Delete page | | |
| Child pages | CONFLUENCE_GET_CHILD_PAGES
| , , |
| Page ancestors | CONFLUENCE_GET_PAGE_ANCESTORS
| |
| Page labels | CONFLUENCE_GET_LABELS_FOR_PAGE
| |
| Add label | CONFLUENCE_ADD_CONTENT_LABEL
| content ID, label |
| Page versions | CONFLUENCE_GET_PAGE_VERSIONS
| |
| Space labels | CONFLUENCE_GET_LABELS_FOR_SPACE
| space ID |