Atlassian MCP ByteBuddy Cookbook
This cookbook introduces how to combine Atlassian MCP with ByteBuddy to implement project management, JIRA integration, and other features.
Overview
Atlassian MCP provides integration capabilities with tools like JIRA and Confluence, enabling the AI assistant to:
- View and manage JIRA issues
- Read Confluence documents
- Create project reports
- Track task progress
Configuration
1. Install Atlassian MCP
bash
# Install MCP server
npm install -g @atlassian/mcp-server
# Or use pip
pip install atlassian-mcp-server2. Configure ByteBuddy
json
{
"mcpServers": {
"atlassian": {
"command": "node",
"args": ["atlassian-mcp-server"],
"env": {
"ATLASSIAN_URL": "https://your-domain.atlassian.net",
"ATLASSIAN_USERNAME": "your-email@example.com",
"ATLASSIAN_API_TOKEN": "your-api-token"
}
}
}
}3. Get API Token
- Visit Atlassian Account Settings
- Create a new API Token
- Add the Token to environment variables
Use Cases
Scenario 1: JIRA Issue Management
typescript
// View project issues
const issues = await mcp.call("atlassian.listIssues", {
project: "PROJ",
status: "In Progress",
});
// Create new issue
const newIssue = await mcp.call("atlassian.createIssue", {
project: "PROJ",
summary: "Fix login bug",
description: "Users cannot log into the system",
issueType: "Bug",
priority: "High",
});Scenario 2: Code Review and Issue Association
typescript
// Associate PR with JIRA issue
const prNumber = getPullRequestNumber();
const issueKey = "PROJ-123";
await mcp.call("atlassian.addComment", {
issueKey,
comment: `PR #${prNumber} has been submitted, please review the code changes.`,
});
// Update issue status
await mcp.call("atlassian.transitionIssue", {
issueKey,
transition: "In Review",
});Scenario 3: Automated Reporting
typescript
// Generate weekly report
const weeklyReport = await generateWeeklyReport({
project: "PROJ",
startDate: "2024-01-01",
endDate: "2024-01-07",
});
await mcp.call("atlassian.createConfluencePage", {
title: "Weekly Project Report",
content: weeklyReport,
spaceKey: "PROJ",
});Best Practices
1. Workflow Integration
yaml
# .github/workflows/jira-update.yml
name: Update JIRA Status
on:
pull_request:
types: [opened, closed]
jobs:
update-jira:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update JIRA
run: |
bytebuddy --mcp atlassian --update-jira-status2. Commit Message Standards
bash
# Commit message format
git commit -m "PROJ-123: Fix login authentication issue"
# Automatically extract issue key
const issueKey = extractJiraKey(commitMessage);
if (issueKey) {
await updateJiraIssue(issueKey, { status: 'In Development' });
}3. Project Templates
json
{
"projectTemplates": {
"web-app": {
"jiraConfig": {
"issueTypes": ["Story", "Bug", "Task", "Epic"],
"workflow": ["Backlog", "In Progress", "In Review", "Done"],
"fields": ["Priority", "Labels", "Components"]
},
"confluenceStructure": {
"pages": ["Requirements", "Design", "API Docs", "Deploy Guide"]
}
}
}
}Advanced Features
1. Custom Queries
typescript
// Complex JQL query
const customQuery = `
project = PROJ AND
status not in (Done, Closed) AND
priority in (High, Critical) AND
updated >= -7d
`;
const criticalIssues = await mcp.call("atlassian.searchIssues", {
jql: customQuery,
fields: ["summary", "status", "priority", "assignee"],
});2. Bulk Operations
typescript
// Bulk update issues
const issues = ["PROJ-101", "PROJ-102", "PROJ-103"];
for (const issueKey of issues) {
await mcp.call("atlassian.transitionIssue", {
issueKey,
transition: "Ready for QA",
});
}3. Integration Monitoring
typescript
// Monitor project health
const healthMetrics = await calculateProjectHealth({
project: "PROJ",
metrics: ["velocity", "burndown", "bugRate"],
});
await mcp.call("atlassian.createDashboard", {
title: "Project Health Dashboard",
gadgets: healthMetrics,
});Troubleshooting
Common Issues
Insufficient API Permissions
bash
# Check permission scopes
curl -u "email:api_token" \
"https://your-domain.atlassian.net/rest/api/3/myself"MCP Connection Failure
bash
# Test MCP connection
bytebuddy --mcp atlassian --test-connectionIssue Update Failure
typescript
// Add error handling
try {
await mcp.call("atlassian.transitionIssue", {
issueKey,
transition: "In Progress",
});
} catch (error) {
console.error("Failed to update issue:", error.message);
// Log error and retry
}Security Considerations
- API Token Security: Store sensitive information using environment variables
- Permission Minimization: Grant only necessary permission scopes
- Audit Logging: Log all API calls
- Access Control: Restrict MCP server access permissions
Through Atlassian MCP integration, ByteBuddy can seamlessly integrate into existing project management workflows, improving development efficiency.