ctk mcp
Start the Model Context Protocol (MCP) server for Confluence Cloud.
# stdio transport (default)ctk mcp
# HTTP Streamable transportctk mcp --port 8080| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--port | -p | int | 0 | Port to listen on. When 0 (default), uses stdio transport. |
Transport Modes
Section titled “Transport Modes”stdio (default)
Section titled “stdio (default)”When no --port is specified, ctk communicates over standard input/output. This is the standard mode for local MCP clients:
- Claude Desktop / Claude Code
- Cursor
- opencode
- Any MCP client using stdio
ctk mcpHTTP Streamable
Section titled “HTTP Streamable”When --port is specified, ctk starts an HTTP server using the MCP Streamable HTTP transport:
ctk mcp --port 8080Starting Confluence MCP Server on :8080 (HTTP Streamable)Use this mode for remote MCP clients, web-based integrations, or multi-user setups.
Prerequisites
Section titled “Prerequisites”Authentication must be configured before starting the server. The server checks for credentials in this order:
- Environment variables:
CONFLUENCE_DOMAIN,CONFLUENCE_EMAIL,CONFLUENCE_API_TOKEN - Stored credentials: from
ctk auth(saved at~/.config/ctk/credentials.json)
If neither is found, the server exits with an error:
No credentials found. Either: 1. Run: ctk auth 2. Set CONFLUENCE_DOMAIN + CONFLUENCE_EMAIL + CONFLUENCE_API_TOKEN env varsWrite Gating
Section titled “Write Gating”By default, write operations (create, update, delete, move) are disabled. To enable them, set:
CTK_ENABLE_WRITES=true ctk mcpOr in your MCP client configuration:
{ "environment": { "CTK_ENABLE_WRITES": "true" }}When writes are disabled, write actions return an error and are excluded from tool descriptions.
Client Configuration Examples
Section titled “Client Configuration Examples”Claude Desktop / Claude Code
Section titled “Claude Desktop / Claude Code”{ "mcpServers": { "ctk": { "command": "/path/to/ctk", "args": ["mcp"], "env": { "CONFLUENCE_DOMAIN": "mycompany", "CONFLUENCE_EMAIL": "jane@example.com", "CONFLUENCE_API_TOKEN": "your-api-token", "CTK_ENABLE_WRITES": "true" } } }}opencode
Section titled “opencode”{ "mcp": { "ctk": { "type": "local", "command": ["/path/to/ctk", "mcp"], "environment": { "CONFLUENCE_DOMAIN": "mycompany", "CONFLUENCE_EMAIL": "jane@example.com", "CONFLUENCE_API_TOKEN": "your-api-token", "CTK_ENABLE_WRITES": "true" } } }}What Happens at Startup
Section titled “What Happens at Startup”- Credentials loaded from env vars or stored credentials
- Token type auto-detected (classic vs scoped) if not set explicitly
- Write gating checked —
CTK_ENABLE_WRITESdetermines available actions - Tools registered — tool descriptions dynamically reflect read-only vs read-write mode
- Server ready — begins accepting MCP requests