Skip to main content
Glama
Confluence MCP Server

Confluence MCP Server

by aaronsb

Confluence Cloud MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with Confluence Cloud. This server enables AI assistants to manage Confluence spaces, pages, and content through a standardized interface.

CI/CD Pipeline

Features

  • Space Management

    • List spaces

    • Get space details

  • Page Operations

    • Create, read, update pages

    • List pages in a space

    • Convert page content from Confluence storage format to Markdown

  • Search & Labels

    • Search content using CQL

    • Manage page labels

Related MCP server: Confluence MCP Server

Setup

The easiest way to use this server is with the pre-built Docker image:

docker run --rm -i \
  -e CONFLUENCE_API_TOKEN=your-api-token \
  -e CONFLUENCE_EMAIL=your-email@domain.com \
  -e CONFLUENCE_DOMAIN=your-domain.atlassian.net \
  ghcr.io/aaronsb/confluence-cloud-mcp:latest

Option 2: Building Locally

  1. Clone the repository:

git clone https://github.com/aaronsb/confluence-cloud-mcp.git
cd confluence-cloud-mcp
  1. Build and run using the local build script:

# Build the Docker image
./scripts/build-local.sh

# Run the server
CONFLUENCE_API_TOKEN=your-token CONFLUENCE_EMAIL=your-email ./scripts/run-local.sh

Option 3: Using npx (Direct from GitHub)

Run directly from GitHub without installation:

# With inline environment variables
CONFLUENCE_DOMAIN=your-domain.atlassian.net \
CONFLUENCE_EMAIL=your-email@domain.com \
CONFLUENCE_API_TOKEN=your-api-token \
npx github:aaronsb/confluence-cloud-mcp

# Or with an environment file
npx github:aaronsb/confluence-cloud-mcp --env /path/to/.env

Create a .env file with your Confluence credentials:

CONFLUENCE_DOMAIN=your-domain.atlassian.net
CONFLUENCE_EMAIL=your-email@domain.com
CONFLUENCE_API_TOKEN=your-api-token

Option 4: From Source

  1. Install dependencies:

npm install
  1. Configure environment variables: Create a .env file with your Confluence credentials:

CONFLUENCE_DOMAIN=your-domain.atlassian.net
CONFLUENCE_EMAIL=your-email@domain.com
CONFLUENCE_API_TOKEN=your-api-token
  1. Build the project:

npm run build
  1. Run the server:

node build/index.js

Usage

The server can be integrated with MCP-compatible AI assistants by adding it to their MCP configuration:

Using Claude Code CLI:

claude mcp add confluence-cloud npx -- github:aaronsb/confluence-cloud-mcp --env /path/to/.env

Using npx in MCP configuration:

{
  "mcpServers": {
    "confluence": {
      "command": "npx",
      "args": ["github:aaronsb/confluence-cloud-mcp", "--env", "/path/to/.env"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using Docker:

{
  "mcpServers": {
    "confluence": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "ghcr.io/aaronsb/confluence-cloud-mcp:latest"],
      "env": {
        "CONFLUENCE_DOMAIN": "your-domain.atlassian.net",
        "CONFLUENCE_EMAIL": "your-email@domain.com",
        "CONFLUENCE_API_TOKEN": "your-api-token"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Note for AI Assistants: If you're an AI assistant like Cline trying to install this MCP server, please refer to the llms-install.md file for detailed installation instructions.

Available Tools

Space Tools

  • list_confluence_spaces: List all spaces in Confluence

  • get_confluence_space: Get details about a specific space

Page Tools

  • list_confluence_pages: List pages in a space

  • get_confluence_page: Get a specific page with its content (now includes Markdown conversion)

  • create_confluence_page: Create a new page in a space

  • update_confluence_page: Update an existing page

The get_confluence_page tool now automatically converts Confluence storage format content to Markdown, making it easier to work with page content. The conversion handles:

  • Headers (h1-h6)

  • Lists (ordered and unordered)

  • Links

  • Emphasis (bold/italic)

  • Code blocks

  • Tables

  • Paragraphs and line breaks

Search & Label Tools

  • search_confluence_pages: Search Confluence content using CQL

  • get_confluence_labels: Get labels for a page

  • add_confluence_label: Add a label to a page

  • remove_confluence_label: Remove a label from a page

Note: All tool names follow the [verb]confluence[noun] naming convention for consistency and clarity.

Development

This project is written in TypeScript and follows the MCP SDK conventions for implementing server capabilities. The codebase is organized into:

  • src/client/ - Confluence API client implementation

  • src/handlers/ - MCP tool request handlers

  • src/schemas/ - JSON schemas for tool inputs

  • src/types/ - TypeScript type definitions

  • src/utils/ - Utility functions including content format conversion

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

  • Automated testing and linting on pull requests

  • Automatic Docker image builds on main branch commits

  • Multi-architecture image builds (amd64, arm64)

  • Container publishing to GitHub Container Registry

Local Development

For local development, use the provided scripts:

  • ./scripts/build-local.sh: Builds the project and creates a local Docker image

  • ./scripts/run-local.sh: Runs the local Docker image with your credentials

License

MIT

Available Tools

11 tools
add_confluence_labelA

Add a label to a page. Labels help organize content and make it easier to find related pages through search_confluence_pages.

Label Format:

  • Must contain only letters, numbers, hyphens, and underscores

  • No spaces or special characters allowed

Error Handling:

  • Returns 400 for invalid label format

  • Returns 403 for insufficient permissions

  • Returns 404 if page not found

  • Returns 409 if label already exists on the page

Response includes:

  • Success status

  • Label details (id, name, prefix, creation date)

  • Operation message

Inputs: pageId (required), label (required).

create_confluence_pageC

Create a new page in a space

Inputs: spaceId (required), title (required), content (required), parentId.

find_confluence_pageA

Find and retrieve a Confluence page by its title. Returns the page content in markdown format, along with metadata. Optionally specify a spaceId to narrow the search. If multiple pages match the title, returns a list of matches to choose from. TIP: Use this when you know the exact page title, but prefer search_confluence_pages for partial matches.

Inputs: title (required), spaceId.

get_confluence_labelsB

Get labels for a page. Use this to understand page categorization and find related content through common labels.

Inputs: pageId (required).

get_confluence_pageA

Get a specific Confluence page by its ID. Returns the complete page content in markdown format, along with metadata like version history and space information. The page ID can be found in search results, page listings, or other API responses. TIP: Save page IDs from searches for direct access to frequently needed pages.

Inputs: pageId (required).

get_confluence_spaceB

Get details about a specific space

Inputs: spaceId (required).

list_confluence_pagesA

List all pages in a Confluence space. Best used when you need to explore all content in a specific space rather than searching for specific terms. Returns page IDs, titles, and metadata. TIP: Use this when search_confluence_pages might miss relevant pages or when you need a complete inventory of pages in a space.

Inputs: spaceId (required), limit, start.

list_confluence_spacesA

List all available Confluence spaces. Best used as the first step in a content discovery workflow. Returns space IDs, names, and keys that you can use with other tools. TIP: Use a higher limit (e.g., 100) on first call to get a comprehensive view of available spaces.

Inputs: limit, start.

remove_confluence_labelA

Remove a label from a page.

Error Handling:

  • Returns 403 for insufficient permissions

  • Returns 404 if page or label not found

Response includes:

  • Success status

  • Operation details (pageId, label, operation type)

  • Success message

Inputs: pageId (required), label (required).

search_confluence_pagesA

Search across Confluence pages using simple text or CQL (Confluence Query Language).

Query Types:

  1. Simple Text Search:

    • Just provide the search term directly (e.g., "documentation")

    • The system automatically wraps it in proper CQL syntax

  2. Advanced CQL Search:

    • Must include "type =" to signal raw CQL usage

    • Examples:

      • type = "page" AND text ~ "project"

      • type = "page" AND space.key = "TEAM"

      • type = "page" AND created >= "2024-01-01"

Search Capabilities:

  • Full text search across all pages

  • Space-specific searches

  • Content type filtering

  • Metadata-based filtering

CQL Operators (for advanced queries):

  • ~ : contains

  • = : equals

  • != : not equals

  • AND, OR : combine conditions

  • () : group conditions

  • = <= : date comparisons

  • IN : multiple values

Common Search Patterns:

  • Finding pages in specific space: type = "page" AND space.key = "SPACENAME" AND text ~ "searchterm"

  • Finding recent pages: type = "page" AND created >= "2024-01-01" AND text ~ "searchterm"

  • Finding pages by title: type = "page" AND title ~ "exactname"

  • Finding pages by label: type = "page" AND label = "labelname"

Response includes:

  • Page ID, title, and type

  • Space information

  • URL to the page

  • Last modified date

  • Content excerpt with search term highlighting

Pagination:

  • Use 'limit' to control results per page (default: 25)

  • Use 'start' for pagination offset

Workflow Tips:

  1. Start with list_confluence_spaces to get space keys

  2. Use space-specific searches for better results

  3. Use the returned pageId with get_confluence_page for full content

  4. Look for highlighted excerpts in results to identify most relevant matches

Best Practices:

  1. Start with simple text searches when possible

  2. Use advanced CQL (with 'type =') for complex queries

  3. Use space-specific searches for better performance

  4. Use get_confluence_page to fetch full content of found pages

Inputs: query (required), limit, start.

update_confluence_pageB

Update an existing page

Inputs: pageId (required), title (required), content (required), version (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose. find_confluence_page is for exact title matches, search_confluence_pages for partial/text searches, and get_confluence_page for direct ID access. Labels and spaces tools are also well-separated.

    Naming Consistency5/5

    All tools follow a consistent verb_confluence_noun pattern (e.g., add_confluence_label, create_confluence_page, list_confluence_spaces). No mixing of conventions or ambiguous verbs.

    Tool Count5/5

    11 tools cover the core functionality of a Confluence content server (CRUD for pages, spaces, labels) without being excessive. Each tool earns its place.

    Completeness3/5

    The set covers most page operations (create, read, update, search) but notably lacks a delete_page tool. Labels have add/get/remove but no update. Missing delete is a significant gap for a CRUD-oriented server.

    Related MCP Connectors

    Related MCP Servers