Back to MCP directory
publicPublicdnsLocal runtime

confluence-mcp-server

这是一个基于TypeScript的MCP服务器,提供与Confluence交互的工具,包括执行CQL查询搜索页面和获取页面内容的功能。

article

README

🚀 Confluence 通信服务器 MCP 服务器

这是一个基于 TypeScript 的 MCP 服务器,主要用于与 Confluence 进行交互。它提供了执行 CQL 查询搜索页面以及获取 Confluence 页面内容等实用工具。

🚀 快速开始

Confluence 通信服务器 MCP 服务器提供了一系列工具来实现与 Confluence 的交互,下面为你介绍其主要功能及使用方式。

✨ 主要特性

Confluence 工具

  • execute_cql_search:用于运行 CQL 查询以搜索 Confluence 页面。
  • get_page_content:用于获取 Confluence 页面的内容。

📦 安装指南

开发环境安装

  1. 安装依赖
npm install
  1. 构建服务器
npm run build
  1. 带有自动重建的开发
npm run watch

与 Claude Desktop 一起使用

要与 Claude Desktop 一起使用,请添加服务器配置:

  • MacOS 系统:配置文件路径为 ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows 系统:配置文件路径为 %APPDATA%/Claude/claude_desktop_config.json

配置文件内容如下:

{
  "mcpServers": {
    "Confluence communication server": {
      "command": "node",
      "args": [
        "/PROJECT_PATH/build/index.js"
      ],
      "env": {
        "CONFLUENCE_URL": "https://XXXXXXXX.atlassian.net/wiki",
        "CONFLUENCE_API_MAIL": "Your email",
        "CONFLUENCE_API_KEY": "KEY_FROM: https://id.atlassian.com/manage-profile/security/api-tokens"
      }
    }
  }
}

调试

由于 MCP 服务器通过 stdio 通信,调试可能具有挑战性。我们建议使用 MCP Inspector,它作为包脚本可用,运行以下命令:

npm run inspector

Inspector 将提供一个访问调试工具的 URL,你可以在浏览器中打开该 URL 进行调试。

💻 使用示例

基础用法

以下是使用 execute_cql_searchget_page_content 工具的示例:

// 示例代码,假设已经有合适的导入和初始化
// 调用 execute_cql_search 工具
const searchResult = execute_cql_search('your_cql_query', 20);
console.log(searchResult);

// 调用 get_page_content 工具
const pageContent = get_page_content('your_page_id');
console.log(pageContent);

高级用法

在实际项目中,你可以根据业务需求将这些工具集成到更复杂的逻辑中。例如,在获取搜索结果后,对结果进行筛选和处理:

// 示例代码,假设已经有合适的导入和初始化
const searchResult = execute_cql_search('your_cql_query', 30);
const filteredResult = searchResult.filter(item => item.someCondition);
const pageContents = [];
for (const item of filteredResult) {
  const pageContent = get_page_content(item.pageId);
  pageContents.push(pageContent);
}
console.log(pageContents);
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client