MCP Atlassian Integration
The Model Context Protocol (MCP) Atlassian integration is an open-source implementation that bridges Atlassian products (Jira and Confluence) with AI language models following Anthropic's MCP specification. This project, currently at version 0.21.1, enables secure, contextual AI interactions with Atlassian tools while maintaining data privacy and security. It is actively developed, with releases focusing on bug fixes and feature enhancements, typically without a strict, public release cadence.
Warnings
- gotcha Configuration for `mcp-atlassian` relies heavily on specific environment variables (e.g., `ATLASSIAN_SUBDOMAIN`, `ATLASSIAN_API_TOKEN`, `CONFLUENCE_SPACE_ID`). Incorrectly set or missing variables are the most common source of runtime errors.
- gotcha The library is primarily designed to function as a standalone service or CLI (`mcp-atlassian run-server` or `mcp-atlassian cli`). While individual core components can be imported, their setup and expected operational context often assume the environment is configured as if running the full service, which might not be immediately intuitive for direct programmatic embedding.
- breaking As a pre-1.0 library (currently `0.21.1`), `mcp-atlassian` does not guarantee strict semantic versioning. Breaking changes to API interfaces, configuration schemas, or core logic may be introduced in minor version increments (e.g., `0.x.y` to `0.x+1.z`).
Install
-
pip install mcp-atlassian
Imports
- AtlassianConfig
from mcp_atlassian.config import AtlassianConfig
- AtlassianConfigSchema
from mcp_atlassian.config import AtlassianConfigSchema
- AtlassianContextManager
from mcp_atlassian.lib.atlassian_context_manager import AtlassianContextManager
Quickstart
import os
from mcp_atlassian.config import AtlassianConfig, AtlassianConfigSchema
from mcp_atlassian.lib.atlassian_context_manager import AtlassianContextManager
# Set dummy environment variables for demonstration/validation.
# In a real scenario, these would be loaded from your shell environment or a .env file.
os.environ['ATLASSIAN_SUBDOMAIN'] = os.environ.get('ATLASSIAN_SUBDOMAIN', 'your-subdomain')
os.environ['ATLASSIAN_USERNAME'] = os.environ.get('ATLASSIAN_USERNAME', 'email@example.com')
os.environ['ATLASSIAN_API_TOKEN'] = os.environ.get('ATLASSIAN_API_TOKEN', 'your-api-token')
os.environ['CONFLUENCE_SPACE_ID'] = os.environ.get('CONFLUENCE_SPACE_ID', 'YOURSPACE')
os.environ['JIRA_PROJECT_KEY'] = os.environ.get('JIRA_PROJECT_KEY', 'YOURPROJ')
try:
# Load configuration from environment variables
config: AtlassianConfig = AtlassianConfigSchema().load(os.environ)
print("Configuration loaded successfully.")
print(f"Atlassian Subdomain: {config.atlassian_subdomain}")
# Initialize the Atlassian Context Manager
# This step demonstrates setup but will require valid credentials for actual API calls.
context_manager = AtlassianContextManager(config)
print("AtlassianContextManager initialized.")
# To perform an actual operation, you would use methods like:
# confluence_doc = context_manager.get_confluence_document('page-title')
# jira_issue = context_manager.get_jira_issue('JIRA-123')
except Exception as e:
print(f"Error loading configuration or initializing: {e}")
print("Please ensure all required ATLASSIAN_* environment variables are set correctly.")