This guide explains how to set up and configure credentials to use the atlassian commands for Jira, Confluence, and Bitbucket.
- Access to an Atlassian Cloud instance (Jira, Confluence, and/or Bitbucket)
- Your Atlassian email address (for Jira/Confluence)
- Your Bitbucket username and app password (for Bitbucket)
- Administrator or user account with appropriate permissions
-
Log in to your Atlassian account:
-
Create a new API token:
- Click "Create API token"
- Give it a descriptive name (e.g., "mcptools")
- Click "Create"
- Copy the generated token (you won't be able to see it again)
- API tokens are long-lived credentials (never expire unless manually revoked)
- Treat them like passwords - never commit them to version control
- You can revoke tokens anytime if they're compromised
- For security, create a separate token for mcptools rather than using a personal token
Bitbucket uses a separate authentication method with app passwords:
-
Log in to your Bitbucket account:
-
Create a new app password:
- Click "Create app password"
- Give it a descriptive name (e.g., "mcptools")
- Select the following permissions:
- Repositories: Read
- Pull requests: Read
- Click "Create"
- Copy the generated password (you won't be able to see it again)
-
Note your Bitbucket username:
- Your username is shown in your profile settings
- This is NOT your email address
Your base URL depends on where your Atlassian instance is hosted:
- Atlassian Cloud (most common):
https://your-domain.atlassian.net- Example:
https://mycompany.atlassian.net
- Example:
- Self-hosted:
https://your-jira-server.com
To find your URL:
- Open your Jira or Confluence instance in a browser
- Look at the URL bar - extract the base domain
- Example: If your Jira URL is
https://mycompany.atlassian.net/browse/PROJ-123, your base URL ishttps://mycompany.atlassian.net
Each Atlassian service supports its own environment variables that override the shared ATLASSIAN_* variables:
| Service | Service-Specific Variables | Fallback Variables |
|---|---|---|
| Jira | JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN |
ATLASSIAN_* |
| Confluence | CONFLUENCE_BASE_URL, CONFLUENCE_EMAIL, CONFLUENCE_API_TOKEN |
ATLASSIAN_* |
| Bitbucket | BITBUCKET_USERNAME, BITBUCKET_APP_PASSWORD |
(uses app passwords) |
Why service-specific variables? Atlassian may require different API tokens for different services. Use service-specific variables when your Jira and Confluence tokens differ.
If you use the same credentials for Jira and Confluence:
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export ATLASSIAN_BASE_URL="https://your-domain.atlassian.net"
export ATLASSIAN_EMAIL="your-email@company.com"
export ATLASSIAN_API_TOKEN="your-api-token-here"If you need different credentials for each service:
# Shared fallback (optional if setting all service-specific vars)
export ATLASSIAN_BASE_URL="https://your-domain.atlassian.net"
export ATLASSIAN_EMAIL="your-email@company.com"
export ATLASSIAN_API_TOKEN="your-default-token"
# Jira-specific overrides (takes precedence)
export JIRA_BASE_URL="https://your-jira.atlassian.net"
export JIRA_EMAIL="jira-user@company.com"
export JIRA_API_TOKEN="your-jira-specific-token"
# Confluence-specific overrides (takes precedence)
export CONFLUENCE_BASE_URL="https://your-confluence.atlassian.net"
export CONFLUENCE_EMAIL="confluence-user@company.com"
export CONFLUENCE_API_TOKEN="your-confluence-specific-token"Create a .env file in your project root:
# Shared credentials
ATLASSIAN_BASE_URL=https://your-domain.atlassian.net
ATLASSIAN_EMAIL=your-email@company.com
ATLASSIAN_API_TOKEN=your-api-token-here
# Service-specific overrides (optional)
JIRA_API_TOKEN=your-jira-specific-token
CONFLUENCE_API_TOKEN=your-confluence-specific-tokenThen load it before running commands:
source .env
mcptools atlassian jira search "project = PROJ"Bitbucket uses app passwords (not API tokens):
export BITBUCKET_USERNAME="your-bitbucket-username"
export BITBUCKET_APP_PASSWORD="your-app-password-here"Important: Your Bitbucket username is NOT your email address. Find it in your Bitbucket profile settings.
Test your Jira configuration with a simple query:
mcptools atlassian jira search "project IS NOT EMPTY" --limit 5Expected output (if successful):
Found N issue(s):
+----------+-------------------+--------+----------+
| Key | Summary | Status | Assignee |
+==========+===================+========+==========+
| PROJ-123 | Issue title | Open | John Doe |
+----------+-------------------+--------+----------+
...
If you get an error like ATLASSIAN_BASE_URL environment variable not set, ensure all three environment variables are correctly configured.
Test your Bitbucket configuration by listing PRs:
mcptools atlassian bitbucket pr list --repo "your-workspace/your-repo" --limit 5Expected output (if successful):
Found N pull request(s):
+----+------------------------+----------+-------+----------------+------------------+
| ID | Title | Author | State | Source Branch | Dest Branch |
+====+========================+==========+=======+================+==================+
| 42 | Add new feature | johndoe | OPEN | feature/new | main |
+----+------------------------+----------+-------+----------------+------------------+
...
If you get an authentication error, verify your BITBUCKET_USERNAME and BITBUCKET_APP_PASSWORD are correct.
Search for open issues in a project:
mcptools atlassian jira search "project = PROJ AND status = Open"Search for issues assigned to you:
mcptools atlassian jira search "assignee = currentUser()"Search with JQL and limit results:
mcptools atlassian jira search "text ~ 'database' AND status = 'In Progress'" --limit 20Output as JSON:
mcptools atlassian jira search "project = PROJ" --json | jq '.issues[] | {key, summary, status}'Search for pages about a topic:
mcptools atlassian confluence search "text ~ 'deployment'"Search in a specific space:
mcptools atlassian confluence search "space = WIKI AND text ~ 'guide'"Limit results and output as JSON:
mcptools atlassian confluence search "text ~ 'api'" --limit 5 --jsonList open pull requests:
mcptools atlassian bitbucket pr list --repo "myworkspace/myrepo"Filter by state:
mcptools atlassian bitbucket pr list --repo "myworkspace/myrepo" --state OPEN
mcptools atlassian bitbucket pr list --repo "myworkspace/myrepo" --state MERGED --state DECLINEDRead PR details with diff:
mcptools atlassian bitbucket pr read --repo "myworkspace/myrepo" 123Limit diff output:
# Truncate to 200 lines
mcptools atlassian bitbucket pr read --repo "myworkspace/myrepo" 123 --line-limit 200
# Skip diff entirely
mcptools atlassian bitbucket pr read --repo "myworkspace/myrepo" 123 --no-diff
# Only show diff (skip PR details)
mcptools atlassian bitbucket pr read --repo "myworkspace/myrepo" 123 --diff-onlyOutput as JSON:
mcptools atlassian bitbucket pr list --repo "myworkspace/myrepo" --jsonThe Atlassian module is also available as MCP tools that Claude can use:
jira_search- Search Jira issues using JQLjira_get- Get detailed information about a Jira ticketjira_create- Create a new Jira ticketjira_update- Update fields on a Jira ticketconfluence_search- Search Confluence pages using CQLbitbucket_pr_list- List pull requests in a repositorybitbucket_pr_read- Read PR details including diff and comments
These tools are automatically available when using mcptools as an MCP server.
Solution: Set either JIRA_BASE_URL or ATLASSIAN_BASE_URL:
# Option 1: Service-specific
export JIRA_BASE_URL="https://your-domain.atlassian.net"
# Option 2: Shared (used as fallback)
export ATLASSIAN_BASE_URL="https://your-domain.atlassian.net"Solution: Set either CONFLUENCE_API_TOKEN or ATLASSIAN_API_TOKEN:
# Option 1: Service-specific
export CONFLUENCE_API_TOKEN="your-confluence-token"
# Option 2: Shared (used as fallback)
export ATLASSIAN_API_TOKEN="your-shared-token"Solution: Make sure either shared or service-specific environment variables are set:
# Check shared variables
echo $ATLASSIAN_BASE_URL
echo $ATLASSIAN_EMAIL
echo $ATLASSIAN_API_TOKEN
# Or service-specific for Jira
echo $JIRA_BASE_URL
echo $JIRA_EMAIL
echo $JIRA_API_TOKENIf any are missing, configure them using one of the methods above.
Solution: Your authentication credentials are incorrect. Check:
- API token is correct (copy it again from https://id.atlassian.com/manage-profile/security/api-tokens)
- Email address matches the one associated with the token
- Base URL is correct
Solution: Your user account doesn't have permission to perform this action. Check:
- Your account has permission to view the projects/issues you're querying
- Your token has appropriate scopes (should have
read:jira-workandsearch:jira)
Solution: The resource doesn't exist or your base URL is incorrect. Verify:
- Base URL is correct (should NOT include
/browseor/wiki) - The project or issue exists
If commands are timing out:
- Check your internet connection
- Verify your Atlassian instance is accessible from your network
- Try with a simpler query to isolate the issue
Solution: Make sure both Bitbucket environment variables are set:
echo $BITBUCKET_USERNAME
echo $BITBUCKET_APP_PASSWORDIf missing, configure them as shown in Step 3.
Solution: Your Bitbucket credentials are incorrect. Check:
- App password is correct (create a new one if needed)
- Username is your Bitbucket username, NOT your email address
- App password has the required permissions (Repositories: Read, Pull requests: Read)
Solution: Verify:
- Repository format is correct:
workspace/repo_slug(e.g.,mycompany/my-repo) - You have access to the repository
- Repository name is spelled correctly (case-sensitive)
-
Never commit credentials to version control:
- Add
.envto your.gitignore - Don't hardcode tokens in scripts
- Add
-
Use environment variables:
- Keep tokens out of command history
- Use shell profiles to auto-load on session start
-
Rotate tokens regularly:
- Review and revoke old tokens
- Create new tokens for different use cases
-
Limit token scope:
- Only grant necessary permissions
- Atlassian API tokens have broad permissions by default
-
Monitor token usage:
- Check Atlassian's security log for token usage
- Revoke tokens immediately if compromised