Add it to Claude Code
claude mcp add -e "CONFLUENCE_DOMAIN=${CONFLUENCE_DOMAIN}" -e "CONFLUENCE_EMAIL=${CONFLUENCE_EMAIL}" -e "CONFLUENCE_API_TOKEN=${CONFLUENCE_API_TOKEN}" ctk -- /path/to/ctk mcpCONFLUENCE_DOMAINCONFLUENCE_EMAILCONFLUENCE_API_TOKEN+ 3 optionalMake your agent remember this setup
ctk's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Dual-mode operation as both a CLI tool and an MCP server
- Full CRUD support for Confluence folders
- LCS-based unified diffing between page versions
- Write gating via environment variables for safety
- Automatic conversion between Markdown and Confluence XHTML storage format
Tools 8
manage_spacesPerform operations on Confluence spaces including list, get, get_by_key, and create.manage_pagesPerform page CRUD, version management, diffing, and movement.manage_searchExecute CQL or quick text searches within Confluence.manage_labelsManage page labels including list, add, and remove.manage_foldersPerform folder CRUD and child management.manage_commentsManage footer and inline comments, including replies.manage_attachmentsManage file attachments including list, download, upload, and delete.manage_usersRetrieve current user info or search for users.Environment Variables
CONFLUENCE_DOMAINrequiredAtlassian domain (e.g., acme for acme.atlassian.net)CONFLUENCE_EMAILrequiredEmail for the API tokenCONFLUENCE_API_TOKENrequiredAtlassian API tokenCONFLUENCE_TOKEN_TYPEclassic or scoped (auto-detected if omitted)CTK_ENABLE_WRITESSet to true to enable mutation toolsCTK_DISABLED_TOOLSComma-separated tool names to hideTry it
Original README from zach-snell/ctk
ctk — Confluence Toolkit
The most comprehensive dedicated Confluence MCP server in the open-source ecosystem. A dual-mode Go binary that works as both a rich CLI tool and an MCP server for AI agents.
8 MCP tools · Full CLI · Write gating · Single binary · Zero dependencies
Why ctk?
| ctk | mcp-atlassian (Python) | |
|---|---|---|
| Language | Go (single ~15MB binary) | Python (pip install + deps) |
| Confluence tools | 8 dedicated tools | ~30 mixed Jira+Confluence |
| Startup | ~50ms | ~2s |
| Folder support | Full CRUD | None |
| Page diff | LCS-based unified diff | None |
| Space create | Yes (V1 stable API) | None |
| Write gating | CTK_ENABLE_WRITES env var |
None |
| Auth | Classic + scoped tokens | Classic only |
Features
- Dual Mode — CLI for humans, MCP server for AI agents, same binary
- V2 API First — Modern Confluence V2 REST API with cursor-based pagination, V1 fallback for CQL search and space create
- Folder Support — Full CRUD for Confluence folders — the only dedicated Confluence MCP with folder operations
- Page Diff — LCS-based unified diff between any two page versions
- Write Gating — Mutation tools only registered when
CTK_ENABLE_WRITES=true, safe read-only defaults - Token-Efficient — Consolidated action-based tools minimize schema overhead. XHTML↔Markdown conversion. ResponseFlattener strips metadata bloat
- Markdown Interface — Agents send/receive markdown, ctk converts to/from Confluence XHTML storage format internally
Installation
# From source
git clone https://github.com/zach-snell/ctk.git && cd ctk
./install.sh # builds and copies to ~/.local/bin
# Or build manually
go build -o ctk ./cmd/ctk
Pre-built binaries available on the Releases page.
Quick Start
# Authenticate
ctk auth
# List spaces
ctk spaces list
# Get a page
ctk pages get 12345
# Search with CQL
ctk search --cql "type = page AND space = DEV AND title ~ 'architecture'"
# Create a page (writes enabled)
ctk pages create --space-id 12345 --title "My Page" --body "# Hello World"
CLI Commands
ctk auth Authenticate with Confluence Cloud
ctk spaces List, get, create spaces
ctk pages Page CRUD, versions, diff, move
ctk folders Folder CRUD, children
ctk search CQL and quick text search
MCP Server
Stdio Transport (Claude Desktop, Cursor, OpenCode, etc.)
{
"mcpServers": {
"confluence": {
"command": "/path/to/ctk",
"args": ["mcp"],
"env": {
"CONFLUENCE_DOMAIN": "your-domain",
"CONFLUENCE_EMAIL": "[email protected]",
"CONFLUENCE_API_TOKEN": "your-api-token",
"CTK_ENABLE_WRITES": "true"
}
}
}
}
Streamable HTTP Transport
ctk mcp --port 8080
Environment Variables
| Variable | Description | Required |
|---|---|---|
CONFLUENCE_DOMAIN |
Atlassian domain (e.g., acme for acme.atlassian.net) |
Yes |
CONFLUENCE_EMAIL |
Email for the API token | Yes |
CONFLUENCE_API_TOKEN |
Atlassian API token | Yes |
CONFLUENCE_TOKEN_TYPE |
classic or scoped (auto-detected if omitted) |
No |
CTK_ENABLE_WRITES |
Set to true to enable mutation tools |
No |
CTK_DISABLED_TOOLS |
Comma-separated tool names to hide | No |
MCP Tools (8)
| Tool | Actions |
|---|---|
manage_spaces |
list, get, get_by_key, create |
manage_pages |
get, get_by_title, list, get_children, get_ancestors, list_versions, diff, create, update, delete, move |
manage_search |
cql, quick |
manage_labels |
list, add, remove |
manage_folders |
list, get, get_children, create, update, delete |
manage_comments |
list_footer, list_inline, get_replies, add_footer, reply |
manage_attachments |
list, download, upload, delete |
manage_users |
get_current, search |
Security
Three-layer safety model:
- Token scopes — Atlassian scopes control which APIs the token can call (403 if missing)
- Write gating — Mutation tools only registered when
CTK_ENABLE_WRITES=true(read-only by default) - Tool denial — Explicitly hide tools:
CTK_DISABLED_TOOLS="manage_folders,manage_labels"
Development
go test -race ./... # Run tests
golangci-lint run ./... # Lint
go build -o ctk ./cmd/ctk # Build