Confluence MCP

by cosmix
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Enables retrieving, searching, creating, and updating Confluence pages and spaces, as well as handling content transformation for AI consumption.

  • Referenced as a separate MCP server available from another repository, indicating integration capabilities with Jira.

Confluence MCP

Confluence 的模型上下文协议 (MCP) 服务器,使 AI 助手能够通过标准化界面与 Confluence 内容进行交互。

ℹ️ Jira有一个单独的 MCP 服务器

特征

  • 使用个人 API 令牌向 Confluence 进行身份验证
  • 检索和搜索 Confluence 页面和空间
  • 创建和更新 Confluence 内容
  • 检索并添加页面评论
  • 检索并添加页面附件
  • 清理并转换 Confluence 内容以供 AI 使用
  • 处理 API 通信、错误处理和数据转换
  • 基本速率限制以防止 API 滥用

先决条件

  • Bun (v1.0.0 或更高版本)
  • 具有 API 访问权限的 Confluence 帐户

安装

# Clone the repository git clone https://github.com/cosmix/confluence-mcp.git cd confluence-mcp # Install dependencies bun install # Build the project bun run build

配置

要使用此 MCP 服务器,您需要设置以下环境变量:

CONFLUENCE_API_TOKEN=your_api_token CONFLUENCE_BASE_URL=your_confluence_instance_url # e.g., https://your-domain.atlassian.net/wiki CONFLUENCE_USER_EMAIL=your_email

Claude 桌面/Cline 配置

将此配置添加到您的设置文件中:

{ "mcpServers": { "confluence": { "command": "bun", "args": ["/absolute/path/to/confluence-mcp/dist/index.js"], "env": { "CONFLUENCE_API_TOKEN": "your_api_token", "CONFLUENCE_BASE_URL": "your_confluence_instance_url/wiki", "CONFLUENCE_USER_EMAIL": "your_email" } } } }

发展

# Run in development mode bun run dev # Run tests bun test

可用工具

Confluence MCP 服务器公开以下工具:

获取页面

通过 ID 检索 Confluence 页面。格式是指内容的返回格式,可以是textmarkdown 。includeMarkup includeMarkup允许检索原始的 Confluence 存储格式 (XHTML) 标记,这对于在保留格式的同时更新页面非常有用。

{ "pageId": "123456", "format": "text", "includeMarkup": true }

搜索页面

使用 CQL(Confluence 查询语言)搜索 Confluence 页面。格式是指内容的返回格式,可以是textmarkdown 。includeMarkup includeMarkup允许检索每个页面的原始 Confluence 存储格式 (XHTML) 标记。

{ "query": "space = DEV and label = documentation", "limit": 10, "format": "text", "includeMarkup": true }

获取空间

列出所有可用的 Confluence 空间。

{ "limit": 50 }

创建页面

创建一个新的 Confluence 页面。parentId 是可选parentId ,可用于在现有页面下创建子页面。

{ "spaceKey": "DEV", "title": "New Page Title", "content": "<p>Page content in Confluence Storage Format (XHTML)</p>", "parentId": "123456" }

更新页面

更新现有的 Confluence 页面。

{ "pageId": "123456", "title": "Updated Page Title", "content": "<p>Updated content in Confluence Storage Format (XHTML)</p>", "version": 1 }

获取评论

检索特定 Confluence 页面的评论。格式是指返回内容的格式,可以是textmarkdown

{ "pageId": "123456", "limit": 25, "format": "text" }

添加评论

在 Confluence 页面中添加评论。创建主题回复时, parentId为可选参数。

{ "pageId": "123456", "content": "<p>This is a new comment.</p>", "parentId": "789012" }

获取附件

检索特定 Confluence 页面的附件。

{ "pageId": "123456", "limit": 25 }

添加附件

向 Confluence 页面添加附件。fileContentBase64 应为文件内容的fileContentBase64编码字符串。

{ "pageId": "123456", "filename": "document.pdf", "fileContentBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+P...", "comment": "Uploaded new version of the document" }

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENCE文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

模型上下文协议服务器,使 AI 助手能够与 Confluence 内容交互,支持检索、搜索、创建和更新页面和空间等操作。

  1. Features
    1. Prerequisites
      1. Installation
        1. Configuration
          1. Claude Desktop / Cline Configuration
        2. Development
          1. Available Tools
            1. get_page
            2. search_pages
            3. get_spaces
            4. create_page
            5. update_page
            6. get_comments
            7. add_comment
            8. get_attachments
            9. add_attachment
          2. LICENCE
            ID: hcc8z46c21