Using Claude Code MCP with Atlassian: A Complete Guide to Documentation Generation

Using Claude Code MCP with Atlassian: A Complete Guide to Documentation Generation

The Model Context Protocol (MCP) has revolutionized how we integrate AI tools with external services. In this post, I’ll show you how to set up Claude Code MCP with Atlassian and demonstrate a practical use case: automatically generating comprehensive documentation for OpenTelemetry implementation in your codebase.

Table of Contents

Setting Up Claude Code MCP with Atlassian

Getting started with Claude Code MCP and Atlassian is straightforward. Here’s the command to add the Atlassian MCP server:

claude mcp add atlassian --transport sse "https://mcp.atlassian.com/v1/sse" --scope user

This command:

  • Adds the Atlassian MCP server to your Claude Code configuration
  • Uses Server-Sent Events (SSE) as the transport mechanism
  • Connects to the official Atlassian MCP endpoint
  • Sets the scope to user level for personal access

After running this command, Claude Code will have direct access to your Atlassian workspace, including Confluence pages and Jira issues.

Real-World Use Case: OpenTelemetry Documentation

Let me walk you through a practical example where I used Claude Code with the Atlassian MCP integration to create comprehensive documentation for OpenTelemetry usage in a codebase.

Step 1: Initial Setup and Analysis

Claude Code MCP Initial Setup

The process begins by instructing Claude Code to analyze the codebase and understand how OpenTelemetry is implemented. I started with this prompt:

“Can you analyze this codebase and create a comprehensive Confluence page documenting how OpenTelemetry is used throughout the project? Include code examples, configuration details, and best practices.”

Claude Code immediately began scanning the repository to understand:

  • OpenTelemetry configuration files
  • Instrumentation patterns
  • Tracing implementations
  • Metrics collection setup
  • Custom spans and attributes

Step 2: Documentation Generation Process

Claude Code MCP Building Documentation

The AI systematically went through the codebase, identifying:

  1. Configuration Analysis: Examining otel-config.yaml, environment variables, and initialization code
  2. Instrumentation Patterns: Finding auto-instrumentation setups and manual instrumentation
  3. Custom Implementations: Discovering custom metrics, traces, and logging integrations
  4. Best Practices: Identifying patterns that follow OpenTelemetry standards

Step 3: Content Creation and Structuring

Claude Code MCP Generating Content

Important Best Practice: Before publishing directly to Confluence, I instructed Claude Code to first generate the documentation as a local Markdown file. This approach offers several advantages:

"Please create a comprehensive OpenTelemetry documentation as a Markdown file first.
I want to review and improve the content before publishing it to Confluence."

This workflow allows you to:

  • Review the generated content thoroughly
  • Make manual improvements and corrections
  • Add team-specific context and examples
  • Test code snippets and verify accuracy
  • Format the content properly before publication

Claude Code generated a well-structured local Markdown file including:

  • Executive Summary: High-level overview of OpenTelemetry usage
  • Architecture Overview: How observability fits into the system design
  • Configuration Guide: Step-by-step setup instructions
  • Code Examples: Real examples from the codebase with explanations
  • Troubleshooting Guide: Common issues and solutions
  • Performance Considerations: Best practices for production deployments

Step 4: Review, Improve, and Publish

After reviewing the local Markdown file, I made several improvements:

  • Added company-specific configuration examples
  • Included troubleshooting steps for common issues encountered by the team
  • Updated code snippets to match the current codebase version
  • Added cross-references to relevant internal documentation

Once satisfied with the content, I instructed Claude Code to publish the refined documentation to Confluence:

"The Markdown documentation looks great! Please now create a Confluence page
with this content in the 'Engineering Documentation' space."

Final Confluence Documentation

The final Confluence page was comprehensive and immediately useful for the development team. It included:

  • Interactive code snippets with syntax highlighting
  • Diagrams showing trace flow
  • Configuration templates
  • Links to relevant Jira tickets
  • References to external OpenTelemetry documentation

Key Benefits of This Approach

1. Automated Code Analysis

Claude Code can understand complex codebases and extract meaningful patterns, saving hours of manual documentation work.

2. Living Documentation

Since the MCP integration allows direct updates to Confluence, documentation can be kept current with code changes.

3. Consistent Structure

AI-generated documentation follows consistent formatting and structure standards across all pages.

4. Cross-Platform Integration

The Atlassian MCP server provides access to both Confluence and Jira, enabling rich cross-referencing.

Best Practices for Claude Code MCP + Atlassian

1. Use the Markdown-First Workflow

  • Always request Markdown generation first: "Create a Markdown file for this documentation"
  • Review and improve the local file before publishing
  • Test all code examples and verify accuracy
  • Add team-specific context and examples
  • Use version control to track documentation changes

2. Prepare Your Workspace

  • Ensure you have appropriate permissions in Confluence
  • Create a dedicated space for AI-generated documentation
  • Set up page templates for consistency

3. Provide Clear Instructions

  • Be specific about the type of documentation needed
  • Include examples of desired output format
  • Specify which code patterns to focus on
  • Request Markdown format first, then Confluence publication

4. Review and Refine

  • Always review AI-generated content before publishing
  • Add team-specific context that AI might miss
  • Update screenshots and diagrams as needed
  • Validate all code snippets and configurations

5. Maintain Security

  • Be mindful of sensitive information in codebases
  • Review generated content for any exposed secrets
  • Use appropriate Confluence page restrictions

Advanced Use Cases

The Claude Code MCP + Atlassian integration opens up many possibilities:

  • API Documentation: Generate comprehensive API docs from code comments and endpoints
  • Architecture Decision Records: Create ADRs based on code analysis and git history
  • Onboarding Guides: Build team onboarding documentation from project structure
  • Security Reviews: Document security implementations and compliance measures
  • Performance Analysis: Create performance optimization guides based on code patterns

Conclusion

The integration of Claude Code MCP with Atlassian represents a significant leap forward in automated documentation generation. By combining AI’s analytical capabilities with Atlassian’s collaborative platform, teams can maintain high-quality, up-to-date documentation with minimal manual effort.

The OpenTelemetry documentation example demonstrates how this technology can transform a time-consuming manual process into an automated workflow that produces professional-grade results. As MCP continues to evolve, we can expect even more sophisticated integrations that will further streamline development workflows.

Try setting up the Claude Code MCP Atlassian integration in your environment and experiment with documenting different aspects of your codebase. You might be surprised by how much insight AI can provide into your own code!


Have you tried using Claude Code MCP with Atlassian? Share your experiences and use cases in the comments below.