使用说明
Atlassian的MCP服务器
用于Atlassian产品(Confluence和Jira)的MCP服务器,基于 全能技能 框架。为AI助手提供26个工具,用于与Confluence页面和Jira问题进行交互。
特性
- 📄 汇流工具 --通过安全处理存储格式(XHTML)读取、创建、更新和搜索Confluence页面
- 🎫 Jira工具 --搜索、创建、更新、克隆和转换问题;敏捷董事会、冲刺和报告
- 🔑 共享Atlassian身份验证 --单身
ATLASSIAN_URL两种产品的证书 - 🔐 OAuth 2.1与PKCE --通过HTTP提供授权码流和可选的ngrok隧道
- 🏦 保险库支持的凭据 --1Password、Bitwarden、Keeper支持通过 泛令牌
- 🧩 可组合技能 --每种产品都是一种独立的全能技能,可以单独使用或组合使用
包裹
| 包装 | 描述 |
|---|---|
skills/confluence |
Confluence omniskill——8个页面操作工具 |
skills/jira |
Jira omniskill——18个用于问题跟踪、敏捷和报告的工具 |
cmd/mcp-atlassian |
具有stdio和HTTP模式的MCP服务器二进制文件 |
底层Confluence和Jira客户端库位于 去Atlassian (confluence/ 和 jira/ 包装)。
安装
MCP服务器二进制文件
go install github.com/plexusone/mcp-atlassian/cmd/mcp-atlassian@latest
作为图书馆
go get github.com/plexusone/mcp-atlassian
快速开始
使用存储包
import "github.com/grokify/go-atlassian/confluence/storage"
// Create a page with structured blocks
page := &storage.Page{
Blocks: []storage.Block{
&storage.Heading{Level: 1, Text: "Welcome"},
&storage.Paragraph{Text: "This is a test page."},
&storage.Table{
Headers: []string{"Name", "Status"},
Rows: []storage.Row{
{Cells: []storage.Cell{
{Text: "Service A"},
{Macro: &storage.Macro{
Name: "status",
Params: map[string]string{"colour": "Green", "title": "OK"},
}},
}},
},
},
},
}
// Render to Storage XHTML
xhtml, err := storage.Render(page)
if err != nil {
log.Fatal(err)
}
// Validate before sending to Confluence
if err := storage.Validate(xhtml); err != nil {
log.Fatal(err)
}
使用Confluence客户端
import "github.com/grokify/go-atlassian/confluence"
// Create client
auth := confluence.BasicAuth{
Username: "user@example.com",
Token: "your-api-token",
}
client := confluence.NewClient("https://example.atlassian.net/wiki", auth)
// Get a page as structured IR
page, info, err := client.GetPageStorage(ctx, "12345")
if err != nil {
log.Fatal(err)
}
// Modify the page
page.Blocks = append(page.Blocks, &storage.Paragraph{Text: "New content"})
// Update the page
err = client.UpdatePageStorage(ctx, info.ID, page, info.Version, info.Title)
运行MCP服务器
# Install from GitHub
go install github.com/plexusone/mcp-atlassian/cmd/mcp-atlassian@latest
# Or build from source
go build -o mcp-atlassian ./cmd/mcp-atlassian
使用Claude代码进行配置
Claude Code支持三种配置作用域。看 克劳德代码MCP文档 了解详情。
用户范围 (~/.claude.json):
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"ATLASSIAN_USERNAME": "user@example.com",
"ATLASSIAN_API_TOKEN": "your-api-token"
}
}
}
}
项目范围 (.mcp.json 在项目根目录中,可以检查到源代码管理中):
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"ATLASSIAN_USERNAME": "user@example.com",
"ATLASSIAN_API_TOKEN": "your-api-token"
}
}
}
}
企业管理 (managed-mcp.json 在系统目录中):
看 企业MCP配置 了解详情。
使用Claude Desktop进行配置
添加到您的Claude桌面设置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
持有直接凭证
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"ATLASSIAN_USERNAME": "user@example.com",
"ATLASSIAN_API_TOKEN": "your-api-token"
}
}
}
}
使用1Password
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"OP_SERVICE_ACCOUNT_TOKEN": "ops_...",
"OMNITOKEN_VAULT_URI": "op://MyVault",
"OMNITOKEN_CREDENTIALS_NAME": "atlassian"
}
}
}
}
与Bitwarden合作
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"BW_ACCESS_TOKEN": "...",
"BW_ORGANIZATION_ID": "...",
"OMNITOKEN_VAULT_URI": "bw://org-id",
"OMNITOKEN_CREDENTIALS_NAME": "atlassian"
}
}
}
}
与Keeper合作
{
"mcpServers": {
"atlassian": {
"command": "/path/to/mcp-atlassian",
"env": {
"ATLASSIAN_URL": "https://example.atlassian.net",
"KSM_TOKEN": "US:...",
"OMNITOKEN_VAULT_URI": "keeper://",
"OMNITOKEN_CREDENTIALS_NAME": "atlassian"
}
}
}
}
选项2:保险库支持的凭据
使用 泛令牌 配备保险库后端,用于安全的凭证存储。
| 提供者 | URI模式 | 要求 |
|---|---|---|
| 1密码 | op://vault |
OP_SERVICE_ACCOUNT_TOKEN 有人是。 |
| Bitwarden | bw://org-id |
BW_ACCESS_TOKEN 和 BW_ORGANIZATION_ID 环境变量 |
| 保管员 | keeper:// |
KSM_TOKEN 或 KSM_CONFIG 有人是。 |
| 文件 | file:///path |
没有 |
1密码示例
export OP_SERVICE_ACCOUNT_TOKEN="ops_..."
mcp-atlassian --vault op://MyVault --credentials-name atlassian \
--base-url https://example.atlassian.net
Bitwarden示例
export BW_ACCESS_TOKEN="..."
export BW_ORGANIZATION_ID="..."
mcp-atlassian --vault bw://org-id --credentials-name atlassian \
--base-url https://example.atlassian.net
Keeper示例
export KSM_TOKEN="US:..."
mcp-atlassian --vault keeper:// --credentials-name atlassian \
--base-url https://example.atlassian.net
环境变量
| 变量 | 标志 | 描述 |
|---|---|---|
ATLASSIAN_URL |
--base-url |
您的Atlassian实例URL(例如。, https://example.atlassian.net) |
ATLASSIAN_USERNAME |
--username |
您的Atlassian用户名(通常是您的电子邮件) |
ATLASSIAN_API_TOKEN |
--api-token |
来自的API令牌 Atlassian帐户设置 |
CONFLUENCE_BASE_URL |
- | 遗留问题:与的汇流URL /wiki 后缀(如果 ATLASSIAN_URL 未设置) |
OMNITOKEN_VAULT_URI |
--vault |
凭据的Vault URI |
OMNITOKEN_CREDENTIALS_NAME |
--credentials-name |
vault中的凭据名称(默认值: atlassian) |
OP_SERVICE_ACCOUNT_TOKEN |
- | 1密码服务帐户令牌 |
BW_ACCESS_TOKEN |
- | Bitwarden访问令牌 |
BW_ORGANIZATION_ID |
- | Bitwarden组织ID |
KSM_TOKEN |
- | Keeper令牌(格式: REGION:TOKEN) |
独立运行(用于测试)
export ATLASSIAN_URL=https://example.atlassian.net
export ATLASSIAN_USERNAME=user@example.com
export ATLASSIAN_API_TOKEN=your-api-token
./mcp-atlassian
MCP工具
MCP服务器公开了这些工具:
汇流
| 工具 | 说明 |
|---|---|
confluence_read_page |
以结构化块的形式阅读页面 |
confluence_read_page_xhtml |
以原始存储格式XHTML读取页面 |
confluence_update_page |
使用结构化块更新页面 |
confluence_update_page_xhtml |
使用原始存储格式XHTML更新页面 |
confluence_create_page |
使用结构化块创建新页面 |
confluence_create_table |
从结构化数据创建表块 |
confluence_delete_page |
删除页面 |
confluence_search_pages |
使用CQL搜索页面 |
Jira
| 工具 | 说明 |
|---|---|
jira_get_issue |
按密钥获取Jira问题 |
jira_search |
使用JQL搜索问题 |
jira_create_issue |
创建新问题 |
jira_update_issue |
更新问题字段 |
jira_add_comment |
向问题添加评论 |
jira_get_comments |
获取问题的评论 |
jira_get_transitions |
获取可用转换 |
jira_transition_issue |
将问题转换为新状态 |
jira_clone_issue |
克隆字段映射问题 |
jira_bulk_update |
一次更新多个问题 |
jira_get_projects |
列出可用项目 |
jira_get_boards |
列出敏捷板 |
jira_get_sprints |
列出板上的冲刺 |
jira_move_to_sprint |
将问题转移到冲刺阶段 |
jira_velocity_report |
冲刺速度报告 |
jira_burndown_report |
Sprint燃耗数据 |
jira_worklog_report |
时间跟踪摘要 |
jira_cycle_time_report |
问题周期时间分析 |
何时使用XHTML工具
结构化块工具(confluence_read_page, confluence_update_page)更安全,建议用于大多数用例。但是,XHTML工具在以下情况下很有用:
- 调试:查看原始XHTML以了解解析问题
- 复杂内容:具有列宽、嵌套列表或块解析器不完全支持的自定义宏的表
- 保留格式:当您需要在不丢失内联样式或属性的情况下进行小编辑时
工具输入示例
conference_read_page
{
"name": "confluence_read_page",
"arguments": {
"page_id": "12345"
}
}
conference_read_page_xhtml
{
"name": "confluence_read_page_xhtml",
"arguments": {
"page_id": "12345"
}
}
返回原始存储格式XHTML xhtml 字段以及页面元数据。
conference_create_page
{
"name": "confluence_create_page",
"arguments": {
"space_key": "TEAM",
"title": "Meeting Notes 2025-01-15",
"parent_id": "11111",
"blocks": [
{"type": "heading", "level": 1, "text": "Meeting Notes"},
{"type": "paragraph", "text": "Attendees: Alice, Bob, Carol"},
{"type": "heading", "level": 2, "text": "Action Items"},
{"type": "bullet_list", "items": ["Review PR #123", "Update documentation", "Schedule follow-up"]}
]
}
}
conference_update_page
{
"name": "confluence_update_page",
"arguments": {
"page_id": "12345",
"title": "Updated Page Title",
"blocks": [
{"type": "heading", "level": 1, "text": "Updated Content"},
{"type": "paragraph", "text": "This page has been updated."},
{"type": "table", "headers": ["Name", "Role"], "rows": [["Alice", "Lead"], ["Bob", "Developer"]]}
]
}
}
conference_update_page_xhtml
{
"name": "confluence_update_page_xhtml",
"arguments": {
"page_id": "12345",
"title": "Updated Page Title",
"xhtml": "<h1>Updated Content</h1><p>This page has been updated with raw XHTML.</p><table><tbody><tr><th>Name</th><th>Role</th></tr><tr><td>Alice</td><td>Lead</td></tr></tbody></table>"
}
}
当您需要保留结构化块会丢失的复杂格式时,请使用此功能。
conference_create_table
{
"name": "confluence_create_table",
"arguments": {
"headers": ["Service", "Owner", "Status"],
"rows": [
["Auth", "Platform", {"macro": {"name": "status", "params": {"colour": "Green", "title": "OK"}}}],
["API", "Backend", {"macro": {"name": "status", "params": {"colour": "Yellow", "title": "Degraded"}}}]
]
}
}
conference_delete_page
{
"name": "confluence_delete_page",
"arguments": {
"page_id": "12345"
}
}
汇流搜索页面
{
"name": "confluence_search_pages",
"arguments": {
"cql": "space=TEAM and type=page and title~\"Meeting\"",
"limit": 10
}
}
块类型
| 类型 | 描述 |
|---|---|
Paragraph |
文本段落 |
Heading |
H1-H6标题 |
Table |
单元格中有标题、行和可选宏的表 |
BulletList |
无序列表 |
NumberedList |
已排序列表 |
Macro |
汇流宏(状态、信息、代码等) |
CodeBlock |
带有语言的代码块 |
HorizontalRule |
水平分隔器 |
为什么这种方法有效
- LLM生成结构化JSON (非XHTML)→ 更少的错误
- 渲染是确定性的 Go代码→ 保证有效输出
- 验证发现问题 在API调用之前
- 往返安全:解析→ 修改→ 渲染保留结构
许可证
麻省理工学院
另见
- 更改日志.md -发布历史
- ROADMAP.md -计划功能
- 汇流存储格式文档