Skip to main content
Glama

Atlassian Confluence MCP Server

by aashari

Atlassian Confluence MCP 服务器

适用于 Atlassian Confluence Cloud 的 Node.js/TypeScript 模型上下文协议 (MCP) 服务器。它使 AI 系统(例如 Claude 或 Cursor AI 等 LLM)能够安全地实时与您的 Confluence 空间、页面和内容进行交互。

为什么要使用此服务器?

  • 最少输入,最大输出:简单的标识符无需额外的标志即可提供全面的详细信息。
  • 完整的知识库访问:让 AI 助手能够查看文档、维基和知识库内容。
  • 丰富的内容格式:将 Atlassian 文档格式自动转换为可读的 Markdown。
  • 安全的本地身份验证:使用您的凭据在本地运行,永远不会在远程服务器上存储令牌。
  • 直观的 Markdown 响应:所有输出均采用结构良好、一致的 Markdown 格式。

什么是 MCP?

模型上下文协议 (MCP) 是一项开放标准,用于将 AI 系统安全地连接到外部工具和数据源。此服务器为 Confluence Cloud 实现了 MCP,使 AI 助手能够以编程方式与您的 Confluence 内容进行交互。

先决条件

  • Node.js (>=18.x):下载
  • 可以访问 Confluence Cloud 的Atlassian 帐户

设置

步骤 1:获取 Atlassian API 令牌

  1. 转到您的 Atlassian API 令牌管理页面: https://id.atlassian.com/manage-profile/security/api-tokens
  2. 单击创建 API 令牌
  3. 为其提供描述性标签(例如, mcp-confluence-access )。
  4. 单击**“创建”**
  5. 立即复制生成的 API 令牌。您将无法再次看到它。

第 2 步:配置凭证

选项 A:MCP 配置文件(推荐)

编辑或创建~/.mcp/configs.json

{ "confluence": { "environments": { "ATLASSIAN_SITE_NAME": "<YOUR_SITE_NAME>", "ATLASSIAN_USER_EMAIL": "<YOUR_ATLASSIAN_EMAIL>", "ATLASSIAN_API_TOKEN": "<YOUR_COPIED_API_TOKEN>" } } }
  • <YOUR_SITE_NAME> :您的 Confluence 站点名称(例如, mycompany.atlassian.net对应的是mycompany )。
  • <YOUR_ATLASSIAN_EMAIL> :您的 Atlassian 帐户电子邮件。
  • <YOUR_COPIED_API_TOKEN> :步骤 1 中的 API 令牌。
选项 B:环境变量
export ATLASSIAN_SITE_NAME="<YOUR_SITE_NAME>" export ATLASSIAN_USER_EMAIL="<YOUR_EMAIL>" export ATLASSIAN_API_TOKEN="<YOUR_API_TOKEN>"

步骤3:安装并运行

npx快速入门
npx -y @aashari/mcp-server-atlassian-confluence ls-spaces
全局安装
npm install -g @aashari/mcp-server-atlassian-confluence mcp-atlassian-confluence ls-spaces

步骤4:连接到AI助手

配置与 MCP 兼容的客户端(例如 Claude、Cursor AI):

{ "mcpServers": { "confluence": { "command": "npx", "args": ["-y", "@aashari/mcp-server-atlassian-confluence"] } } }

MCP 工具

MCP 工具使用snake_case名称、 camelCase参数,并返回 Markdown 格式的响应。

  • conf_ls_spaces :列出可访问的 Confluence 空间( type :str opt、 status :str opt、 limit :num opt、 cursor :str opt)。用途:查看可用空间。
  • conf_get_space :获取详细的空间信息( spaceKey :str req)。用途:访问空间内容和元数据。
  • conf_ls_pages :列出带有过滤条件的页面( spaceIds :str[] opt、 spaceKeys :str[] opt、 title :str opt、 status :str[] opt、 sort :str opt、 limit :num opt、 cursor :str opt)。用途:查找符合条件的页面。
  • conf_get_page :获取完整页面内容( pageId :str req)。用途:以 Markdown 格式查看完整页面内容。
  • conf_ls_page_comments :列出页面上的评论( pageId :str req)。用途:阅读页面讨论。
  • conf_search :搜索 Confluence 内容( cql :str opt、 query :str opt、 title :str opt、 spaceKey :str opt、 labels :str[] opt、 contentType :str opt、 limit :num opt、 cursor :str opt)。用途:查找特定内容。

conf_ls_spaces

列出全局空间:

{ "type": "global", "status": "current", "limit": 10 }

conf_get_space

获取空间详细信息:

{ "spaceKey": "DEV" }

conf_ls_pages

按空间和标题列出页面:

{ "spaceKeys": ["DEV"], "title": "API Documentation", "status": ["current"], "sort": "-modified-date" }

列出来自多个空间的页面:

{ "spaceKeys": ["DEV", "HR", "MARKETING"], "limit": 15, "sort": "-modified-date" }

conf_get_page

获取页面内容:

{ "pageId": "12345678" }

conf_ls_page_comments

列表页评论:

{ "pageId": "12345678" }

简单搜索:

{ "query": "release notes Q1", "spaceKey": "PRODUCT", "contentType": "page", "limit": 5 }

高级 CQL 搜索:

{ "cql": "space = DEV AND label = api AND created >= '2023-01-01'" }

CLI 命令

CLI 命令使用kebab-case )。运行--help获取详细信息(例如, mcp-atlassian-confluence ls-spaces --help )。

  • ls-spaces :列出空间( --type--status--limit--cursor )。例如: mcp-atlassian-confluence ls-spaces --type global
  • get-space :获取空间详情( --space-key )。例如: mcp-atlassian-confluence get-space --space-key DEV
  • ls-pages :列出页面( --space-keys--title--status--sort--limit--cursor )。例如: mcp-atlassian-confluence ls-pages --space-keys DEV
  • get-page :获取页面内容( --page-id )。例如: mcp-atlassian-confluence get-page --page-id 12345678
  • ls-page-comments :列出评论( --page-id )。例如: mcp-atlassian-confluence ls-page-comments --page-id 12345678
  • search :搜索内容( --cql--query--space-key--label--type--limit--cursor )。例如: mcp-atlassian-confluence search --query "security"

列出空间

列出全局空间:

mcp-atlassian-confluence ls-spaces --type global --status current --limit 10

获取空间

mcp-atlassian-confluence get-space --space-key DEV

列表页面

通过多个空格键:

mcp-atlassian-confluence ls-pages --space-keys DEV HR MARKETING --limit 15 --sort "-modified-date"

使用标题过滤器:

mcp-atlassian-confluence ls-pages --space-keys DEV --title "API Documentation" --status current

获取页面

mcp-atlassian-confluence get-page --page-id 12345678

列出页面评论

mcp-atlassian-confluence ls-page-comments --page-id 12345678

搜索

简单搜索:

mcp-atlassian-confluence search --query "security best practices" --space-key DOCS --type page --limit 5

CQL 搜索:

mcp-atlassian-confluence search --cql "label = official-docs AND creator = currentUser()"

响应格式

所有回复均为 Markdown 格式,包括:

  • 标题:内容类型和名称。
  • 内容:完整页面内容、搜索结果或项目列表。
  • 元数据:创建者、日期、标签和其他相关信息。
  • 分页:分页结果的导航信息。
  • 链接:适用时参考相关资源。

空间列表响应

# Confluence Spaces Showing **5** global spaces (current) | Key | Name | Description | |---|---|---| | [DEV](#) | Development | Engineering and development documentation | | [HR](#) | Human Resources | Employee policies and procedures | | [MARKETING](#) | Marketing | Brand guidelines and campaign materials | | [PRODUCT](#) | Product | Product specifications and roadmaps | | [SALES](#) | Sales | Sales processes and resources | *Retrieved from mycompany.atlassian.net on 2025-05-19 14:22 UTC* Use `cursor: "next-page-token-123"` to see more spaces.

页面内容响应

# API Authentication Guide **Space:** [DEV](#) (Development) **Created by:** Jane Smith on 2025-04-01 **Last updated:** John Doe on 2025-05-15 **Labels:** api, security, authentication ## Overview This document outlines the authentication approaches supported by our API platform. ## Authentication Methods ### OAuth 2.0 We support the following OAuth 2.0 flows: 1. **Authorization Code Flow** - For web applications 2. **Client Credentials Flow** - For server-to-server 3. **Implicit Flow** - For legacy clients only ### API Keys Static API keys are supported but discouraged for production use due to security limitations: | Key Type | Use Case | Expiration | |---|---|---| | Development | Testing | 30 days | | Production | Live systems | 90 days | ## Implementation Examples import requests def get_oauth_token(): return requests.post( 'https://api.example.com/oauth/token', data={ 'client_id': 'YOUR_CLIENT_ID', 'client_secret': 'YOUR_CLIENT_SECRET', 'grant_type': 'client_credentials' } ).json()['access_token'] *Retrieved from mycompany.atlassian.net on 2025-05-19 14:25 UTC*

发展

# Clone repository git clone https://github.com/aashari/mcp-server-atlassian-confluence.git cd mcp-server-atlassian-confluence # Install dependencies npm install # Run in development mode npm run dev:server # Run tests npm test

贡献

欢迎投稿!请:

  1. 分叉存储库。
  2. 创建功能分支( git checkout -b feature/xyz )。
  3. 提交更改( git commit -m "Add xyz feature" )。
  4. 推送到分支( git push origin feature/xyz )。
  5. 打开拉取请求。

有关详细信息,请参阅CONTRIBUTING.md

执照

ISC 许可证

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

模型上下文协议服务器使 Claude 等 AI 助手能够访问和搜索 Atlassian Confluence 内容,从而实现与您组织的知识库集成。

  1. 为什么要使用此服务器?
    1. 什么是 MCP?
      1. 先决条件
        1. 设置
          1. 步骤 1:获取 Atlassian API 令牌
          2. 第 2 步:配置凭证
          3. 步骤3:安装并运行
          4. 步骤4:连接到AI助手
        2. MCP 工具
          1. conf_ls_spaces
          2. conf_get_space
          3. conf_ls_pages
          4. conf_get_page
          5. conf_ls_page_comments
          6. conf_search
        3. CLI 命令
          1. 列出空间
          2. 获取空间
          3. 列表页面
          4. 获取页面
          5. 列出页面评论
          6. 搜索
        4. 响应格式
          1. 空间列表响应
          2. 页面内容响应
        5. 发展
          1. 贡献
            1. 执照

              Related MCP Servers

              • A
                security
                F
                license
                A
                quality
                A Model Context Protocol server that connects Claude and other AI assistants to your Notion workspace, allowing AIs to interact with databases, pages, and blocks.
                Last updated -
                12
                0
                10
                JavaScript
                • Apple
              • A
                security
                F
                license
                A
                quality
                A Model Context Protocol server that connects AI assistants like Claude to Notion workspaces, enabling them to view, search, create, and update Notion databases, pages, and content blocks.
                Last updated -
                12
                194
                JavaScript
                • Apple
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables AI assistants to interact with Confluence content, supporting operations like retrieving, searching, creating, and updating pages and spaces.
                Last updated -
                9
                8
                TypeScript
                MIT License
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.
                Last updated -
                3
                TypeScript
                • Apple

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/aashari/mcp-server-atlassian-confluence'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server