confluence-mcp-server
This MCP server provides comprehensive tools to interact with Atlassian Confluence Cloud, Server, and Data Center, enabling search, reading, creating, updating, and managing pages and attachments with safe, token-efficient workflows.
Search & Discovery
Search pages by keyword (optionally filtered by space) or execute raw CQL queries.
Reading Pages
Fetch full page content in Confluence storage (XHTML) format.
Get a page outline (headings only) for low-token navigation.
Read a specific section by heading or a content block defined by named anchor macros.
Creating & Updating Pages
Create new pages with an optional parent and space.
Update full page content with auto-incremented versioning.
Update a specific section by heading — the server handles the full-page read/write automatically.
Two-Phase Safe Updates (Preview + Confirm)
Preview heading-based or anchor-based section updates to review changes and receive a confirmation hash.
Commit updates only if the hash still matches current content, preventing conflicting changes.
Anchor Management
Insert invisible start/end anchor macros around a heading-based section for stable future targeting.
Staged (Draft) Updates
Stage full-page, section, or anchor-block updates in memory without immediately writing to Confluence.
List, view (with diff), commit (with hash verification), or discard staged drafts.
Attachments
Upload files to a Confluence page via local path or base64 data, with overwrite control; returns image markup for embedding.
User & Connection
Retrieve the currently authenticated Confluence user.
Provides tools for searching, reading, creating, updating pages, uploading attachments, and querying users in Confluence Cloud, Server, or Data Center.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@confluence-mcp-server search for pages about API design"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
confluence-mcp-server
一个面向 Confluence Cloud / Server / Data Center 的 MCP 服务,提供页面搜索、CQL 查询、读取、创建、更新、附件上传和用户身份查询能力。
功能
confluence_search_pages: 按关键词搜索页面confluence_execute_cql_search: 执行原生 CQL 查询confluence_get_page: 按页面 ID 获取内容(storage 格式)confluence_get_page_outline: 获取页面标题目录,适合低 token 导航confluence_get_page_section: 按标题读取单个 section,避免把整页正文返回给模型confluence_get_page_anchor_block: 按 Anchor 起止边界读取块内容confluence_create_page: 创建页面(支持可选parentId)confluence_update_page: 更新页面内容并自动递增版本confluence_update_page_section: 按标题更新单个 section,由 MCP 服务端完成整页替换与提交confluence_preview_page_section_update: 预览按标题更新的命中范围,返回旧内容和确认 hashconfluence_update_page_section_confirmed: 带 hash 确认提交按标题更新,避免 preview 后内容已变化confluence_add_anchor_block_to_section: 给一个标题 section 自动加上起止 Anchor,便于后续稳定更新confluence_preview_page_anchor_block_update: 预览按 Anchor 范围更新的命中块,返回旧内容和确认 hashconfluence_update_page_anchor_block_confirmed: 带 hash 确认提交 Anchor 范围更新confluence_stage_page_update: 暂存整页改动到 MCP 服务端内存,不提交到 Confluenceconfluence_stage_page_section_update: 暂存标题 section 改动到 MCP 服务端内存,不提交到 Confluenceconfluence_stage_page_anchor_block_update: 暂存 Anchor 块改动到 MCP 服务端内存,不提交到 Confluenceconfluence_list_pending_page_updates: 列出当前 MCP 进程里的未提交 wiki 改动confluence_get_pending_page_update: 查看某个未提交改动的 old/new/diff 内容confluence_commit_pending_page_update: 校验 hash 后把某个未提交改动真正提交到 Confluenceconfluence_discard_pending_page_update: 丢弃某个未提交改动confluence_upload_attachment: 上传页面附件(支持本地文件路径或 base64,同名附件默认更新为新版本)confluence_get_current_user: 获取当前认证用户(whoami)
Related MCP server: confluence-mcp
环境要求
Node.js 18+
可访问的 Confluence Cloud / Server / Data Center
快速开始
npm install
npm run build
npm start通过 npx 使用(推荐)
发布到 npm 后,可在 MCP 客户端中直接使用 npx 启动,无需手动克隆仓库:
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["-y", "confluence-mcp-server"],
"env": {
"CONF_MODE": "server",
"CONF_BASE_URL": "https://confluence.example.com",
"CONF_USERNAME": "your-username",
"CONF_TOKEN": "your-token",
"CONF_DEFAULT_SPACE": "DOC"
}
}
}
}也可以不在客户端配置里写连接信息,先只启动 MCP 服务:
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["-y", "confluence-mcp-server"]
}
}
}然后在对话里提供连接参数,让模型先调用 confluence_configure_connection:
{
"baseUrl": "https://confluence.example.com",
"mode": "server",
"authMode": "auto",
"username": "your-username",
"token": "your-token",
"defaultSpace": "DOC"
}该配置只保存在当前 MCP 服务进程内存中,重启后会丢失。长期使用仍建议放在 MCP 客户端的环境变量配置里,避免在对话上下文中暴露密钥。
如果当前进程已经有连接(例如通过环境变量连到了旧地址),也可以只切换部分字段。比如只把地址从一台 Confluence 切到另一台、账号密码不变:
{
"baseUrl": "http://192.168.40.82:8090"
}未传的 mode、认证信息和 defaultSpace 会继承当前连接;如果显式传入 token / password / username / authMode,则会重新计算认证。
环境变量
CONF_BASE_URL: Confluence 基础地址,例如https://confluence.example.comCONF_MODE: 部署模式,cloud或server(默认server)CONF_AUTH_MODE: 认证模式,auto/basic/bearer(默认auto)CONF_USERNAME: 登录用户名(Cloud 必填;Server 在basic模式或使用密码时必填)CONF_PASSWORD: 用户密码(与CONF_TOKEN组合按模式使用)CONF_TOKEN: 访问令牌(Cloud 下作为 API Token;Server 下默认走 Bearer)CONF_DEFAULT_SPACE: 默认空间 Key(可选)
如果未设置这些环境变量,服务会以“未配置连接”的状态启动;此时先调用 confluence_configure_connection 即可。可用 confluence_get_connection_status 查看当前连接状态,该工具不会返回 token/password。
MCP 客户端配置示例
{
"mcpServers": {
"confluence": {
"command": "node",
"args": ["dist/index.js"],
"env": {
"CONF_MODE": "server",
"CONF_BASE_URL": "https://confluence.example.com",
"CONF_USERNAME": "your-username",
"CONF_TOKEN": "your-token",
"CONF_DEFAULT_SPACE": "DOC"
}
}
}
}说明
该项目当前聚焦 Confluence 能力,不包含 Jira 工具。
Cloud 模式固定使用 Basic(
CONF_USERNAME+CONF_TOKEN/CONF_PASSWORD)。Server 模式可用 Bearer 或 Basic(
CONF_AUTH_MODE=auto时优先 Bearer)。Cloud 模式 API 基础路径为
/wiki/rest/api,Server 模式为/rest/api。上传图片后,
confluence_upload_attachment会返回storageImageMarkup,可把它拼到confluence_update_page的bodyStorageValue中展示图片。Confluence 原生更新仍是整页版本化
PUT;confluence_update_page_section只是把“整页读取 + 局部替换 + 整页提交”放在 MCP 服务端完成,从而显著减少模型侧 tokens。两阶段更新不会减少 Confluence 侧请求次数,但会显著降低误改风险:preview 返回旧内容和
expectedCurrentHash,confirmed update 会重新拉取页面并校验 hash 一致后才提交。暂存更新工具会把改动保存在当前 MCP 服务端进程内存中,不会调用 Confluence
PUT;重启 MCP 服务后这些未提交草稿会丢失。Anchor 模式使用 Confluence Anchor 宏作为隐形边界,适合长期自动维护固定区域;普通阅读模式下通常不会显示这些锚点。
低 Token 推荐流程
先用
confluence_search_pages或confluence_execute_cql_search定位页面。再用
confluence_get_page_outline获取标题目录,不直接读整页正文。用
confluence_get_page_section按heading拉取需要处理的 section。修改完成后,用
confluence_update_page_section只提交该 section 的 storage 内容。
如果页面里存在重复标题,可以配合 occurrence 指定第几个同名标题;matchMode=contains 可用于模糊匹配标题。
更安全的两阶段更新
先调用
confluence_preview_page_section_update。检查返回的
oldStorageValue和newStorageValue是否符合预期。把返回的
expectedCurrentHash原样传给confluence_update_page_section_confirmed。服务端会重新拉取页面并校验 hash,一致才真正提交更新。
未提交改动流程
如果希望 AI 先改 wiki、你检查后再决定是否真正保存,可以使用暂存工具:
用
confluence_stage_page_section_update、confluence_stage_page_anchor_block_update或confluence_stage_page_update创建未提交草稿。检查返回的
oldStorageValue、newStorageValue、diffStorageValue和draftId。需要稍后查看时,用
confluence_list_pending_page_updates或confluence_get_pending_page_update。确认保存时,用
confluence_commit_pending_page_update提交;服务端会重新拉取页面并校验expectedCurrentHash,一致才写入 Confluence。不想保存时,用
confluence_discard_pending_page_update丢弃。
这些草稿只存在于当前 MCP 服务端内存,不会出现在 Confluence 页面历史里,也不会跨服务重启持久化。
更稳定的 Anchor 更新
先用
confluence_add_anchor_block_to_section给目标 section 加上startAnchor/endAnchor。后续读取时用
confluence_get_page_anchor_block。更新时先用
confluence_preview_page_anchor_block_update,确认后再调用confluence_update_page_anchor_block_confirmed。
Anchor 名称建议使用业务语义化命名,例如 risk-summary-start、risk-summary-end,避免依赖标题文本本身。
Available Tools
23 toolsconfluence_add_anchor_block_to_sectionA
Insert invisible start/end anchor macros around a heading-based section so later updates can target a stable block instead of relying on heading matching.
Inputs: pageId (required), heading (required), startAnchor (required), endAnchor (required), +5 more.
confluence_commit_pending_page_updateA
Commit one staged page update to Confluence by draftId after re-reading and hash-checking the current content.
Inputs: draftId (required), minorEdit, message.
confluence_create_pageC
Create a Confluence page. Supports optional parentId. Returns unified fields.
Inputs: title (required), bodyStorageValue (required), spaceKey, parentId.
confluence_discard_pending_page_updateA
Discard one staged page update by draftId without writing it to Confluence.
Inputs: draftId (required).
confluence_execute_cql_searchB
Execute raw Confluence CQL search. Returns unified fields: id, type, title, spaceKey, url, version.
Inputs: cql (required), limit, expand.
confluence_get_current_userA
Get current authenticated Confluence user (whoami).
Inputs: no named parameters.
confluence_get_pageB
Get a Confluence page by ID. Returns unified fields and bodyStorageValue.
Inputs: pageId (required), expand.
confluence_get_page_anchor_blockA
Get a page block between two invisible anchor macros. Returns only the matched block to save tokens.
Inputs: pageId (required), startAnchor (required), endAnchor (required).
confluence_get_page_outlineA
Get a page outline by parsing headings from body.storage. Returns unified fields plus headings[] for low-token navigation.
Inputs: pageId (required).
confluence_get_page_sectionA
Get a single page section by heading. The server fetches full storage internally but only returns the matched section to save tokens.
Inputs: pageId (required), heading (required), occurrence, includeHeading, +1 more.
confluence_get_pending_page_updateA
Get one staged page update by draftId. The draft has not been written to Confluence.
Inputs: draftId (required).
confluence_list_pending_page_updatesA
List staged page updates kept in MCP server memory. These drafts have not been written to Confluence.
Inputs: pageId.
confluence_preview_page_anchor_block_updateA
Preview an anchor-based block update. Returns the current block, the proposed replacement, and a hash that must be echoed to the confirmed update call.
Inputs: pageId (required), startAnchor (required), endAnchor (required), blockStorageValue (required).
confluence_preview_page_section_updateA
Preview a heading-based section update. Returns the currently matched section, the proposed replacement, and a hash that must be echoed to the confirmed update call.
Inputs: pageId (required), heading (required), sectionStorageValue (required), occurrence, +2 more.
confluence_search_pagesB
Search Confluence pages by keyword. Returns unified fields: id, type, title, spaceKey, url, version.
Inputs: query, spaceKey, limit.
confluence_stage_page_anchor_block_updateA
Stage an anchor-based block update in MCP server memory without writing to Confluence. Returns a draftId plus old/new/diff content for review.
Inputs: pageId (required), startAnchor (required), endAnchor (required), blockStorageValue (required), +1 more.
confluence_stage_page_section_updateA
Stage a heading-based section update in MCP server memory without writing to Confluence. Returns a draftId plus old/new/diff content for review.
Inputs: pageId (required), heading (required), sectionStorageValue (required), occurrence, +3 more.
confluence_stage_page_updateA
Stage a full-page update in MCP server memory without writing to Confluence. Use list/get to review, commit to save, or discard to drop it.
Inputs: pageId (required), bodyStorageValue (required), title.
confluence_update_pageA
Update a Confluence page content. Auto increments version. Returns unified fields.
Inputs: pageId (required), bodyStorageValue (required), title, minorEdit, +1 more.
confluence_update_page_anchor_block_confirmedA
Confirm an anchor-based block update after preview. The server re-reads the page and only updates when the preview hash still matches current content.
Inputs: pageId (required), startAnchor (required), endAnchor (required), blockStorageValue (required), +4 more.
confluence_update_page_sectionA
Update one page section by heading. The server fetches full storage internally, replaces the matched range, and writes back the whole page so the model only sends the section content.
Inputs: pageId (required), heading (required), sectionStorageValue (required), occurrence, +5 more.
confluence_update_page_section_confirmedA
Confirm a heading-based section update after preview. The server re-reads the page and only updates when the preview hash still matches current content.
Inputs: pageId (required), heading (required), sectionStorageValue (required), expectedCurrentHash (required), +6 more.
confluence_upload_attachmentA
Upload an attachment to a Confluence page. Supports local filePath or base64Data; same-name files are updated by default. Returns attachment fields and image storage markup when applicable.
Inputs: pageId (required), filePath, base64Data, fileName, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool has a unique purpose clearly indicated by its name and description. There is no overlap between tools like create_page, update_page, stage_page_update, etc., as they target different actions (create, read, update, stage, commit) and granularities (page, section, anchor block).
All tools follow the consistent pattern 'confluence_verb_noun' (e.g., confluence_create_page, confluence_get_page_section). The verbs are specific and the nouns clearly indicate the target, forming a predictable and uniform naming scheme.
With 23 tools, the server is on the higher side but justifiable for the domain. The staging/preview/commit workflow for sections and anchor blocks adds necessary tools for safe editing, but the count is slightly above the ideal range for a focused server.
The tool surface covers page creation, reading (with sections/blocks), updating, and attachment upload, plus search and user info. However, a delete page tool is missing, and updating page titles is not explicitly supported, leaving notable gaps in lifecycle coverage.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
MCP Server for JFrog, providing tools for development and artifact management.
MCP server for Appcircle mobile CI/CD platform.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server implementation for interacting with self-hosted Confluence Data Center or Server instances via search, content retrieval, and optional write operations. It features space auto-discovery, audit logging, and granular access control for secure enterprise collaboration.-
- AlicenseBqualityDmaintenanceMCP server for administering Atlassian Confluence Cloud wiki pages, supporting CRUD operations, page navigation, comments, attachments, and more.621GPL 3.0
- FlicenseAqualityDmaintenanceMCP server for Confluence REST API enabling page retrieval, attachment downloads, space listing, comment access, and full-text search via tools.6-
- AlicenseNot gradedqualityDmaintenanceMCP server for searching and retrieving pages from Atlassian Confluence.30 npm1MIT