Confluence MCP
Confluence 的模型上下文协议 (MCP) 服务器,使 AI 助手能够通过标准化界面与 Confluence 内容进行交互。
ℹ️ Jira有一个单独的 MCP 服务器
特征
使用个人 API 令牌向 Confluence 进行身份验证
检索和搜索 Confluence 页面和空间
创建和更新 Confluence 内容
检索并添加页面评论
检索并添加页面附件
清理并转换 Confluence 内容以供 AI 使用
处理 API 通信、错误处理和数据转换
基本速率限制以防止 API 滥用
Related MCP server: Atlassian Confluence MCP Server
先决条件
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_emailClaude 桌面/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 页面。格式是指内容的返回格式,可以是text或markdown 。includeMarkup includeMarkup允许检索原始的 Confluence 存储格式 (XHTML) 标记,这对于在保留格式的同时更新页面非常有用。
{
"pageId": "123456",
"format": "text",
"includeMarkup": true
}搜索页面
使用 CQL(Confluence 查询语言)搜索 Confluence 页面。格式是指内容的返回格式,可以是text或markdown 。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 页面的评论。格式是指返回内容的格式,可以是text或markdown 。
{
"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文件。
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.