mcp-bitbucket-config

devopsxvn-svg/mcp-bitbucket-config Checked 23 minutes ago

Bitbucket MCP Server configuration for Kiro IDE - Easy setup guide for integrating Bitbucket with Kiro

This repository provides a ready-to-use configuration for integrating Bitbucket with Kiro IDE using the @aashari/mcp-server-atlassian-bitbucket MCP server. With this setup, you can interact with Bitbucket directly from Kiro: - πŸ“ List repositories in your workspaces - πŸ”€ View and manage pull requests - πŸ“ Read PR diffs and comments - 🌿 List branches and commits - πŸ” Search across your Bitbucket workspace ⚠️ Important: Bitbucket App Passwords are deprecated and will be removed on July 28, 2026. Use the new API tokens with scopes instead.

Summary extracted from the README.

Bitbucket MCP Server for Kiro

This repository provides a ready-to-use configuration for integrating Bitbucket with Kiro IDE using the @aashari/mcp-server-atlassian-bitbucket MCP server.

What You Get

With this setup, you can interact with Bitbucket directly from Kiro:

  • πŸ“ List repositories in your workspaces
  • πŸ”€ View and manage pull requests
  • πŸ“ Read PR diffs and comments
  • 🌿 List branches and commits
  • πŸ” Search across your Bitbucket workspace

Prerequisites

  • Kiro IDE installed
  • Bitbucket Cloud account
  • Node.js installed (for npx)

Setup Instructions

1. Generate a Bitbucket API Token

⚠️ Important: Bitbucket App Passwords are deprecated and will be removed on July 28, 2026. Use the new API tokens with scopes instead.

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Click Create API token
  3. Give it a name (e.g., "Kiro MCP")
  4. The token will automatically have access to all your Atlassian products (Jira, Confluence, Bitbucket)
  5. Copy the generated token (format: ATATT3xFfGF0...)

Required Scopes:

Your token needs these Bitbucket permissions:

  • βœ… read:repository:bitbucket β€” View repos, branches, commits
  • βœ… read:pipeline:bitbucket β€” View pipeline status
  • βœ… read:issue:bitbucket β€” View issues (optional)
  • βœ… write:repository:bitbucket β€” Create PRs, push branches (optional)
  • βœ… write:pipeline:bitbucket β€” Trigger pipelines (optional)

2. Add Configuration to Kiro

Option A: User-level config (Recommended)

Works across all your workspaces.

Edit ~/.kiro/settings/mcp.json and add the Bitbucket server configuration:

{
  "mcpServers": {
    "bitbucket": {
      "command": "npx",
      "args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
      "env": {
        "ATLASSIAN_USER_EMAIL": "your-email@company.com",
        "ATLASSIAN_API_TOKEN": "ATATT3xFfGF0..."
      },
      "disabled": false,
      "autoApprove": [
        "bb_list_repositories",
        "bb_get_repository",
        "bb_list_pull_requests",
        "bb_get_pull_request",
        "bb_get_pull_request_diff",
        "bb_list_repository_branches",
        "bb_list_pull_request_comments"
      ]
    }
  }
}

Option B: Workspace-level config

Only applies to the current workspace.

Create or edit .kiro/settings/mcp.json in your project root with the same configuration.

3. Reconnect the MCP Server

  1. Open Kiro IDE
  2. Go to the MCP Server view in the Kiro panel
  3. Find bitbucket in the list
  4. Click Reconnect
  5. Or simply restart Kiro

4. Test the Connection

Ask Kiro:

List all repositories in my Bitbucket workspace

If you see your repos, you're all set! πŸŽ‰

Available Commands

Once connected, you can ask Kiro to:

What to Ask What It Does
"List all repos in workspace X" Shows all repositories
"Show open PRs in repo Y" Lists pull requests
"Get the diff for PR #42" Shows code changes
"List branches in repo Z" Shows all branches
"Show comments on PR #15" Displays PR discussion

Configuration Reference

Environment Variables

Variable Required Description
ATLASSIAN_USER_EMAIL Yes Your Bitbucket account email
ATLASSIAN_API_TOKEN Yes API token from Atlassian

Auto-Approved Tools

The config includes autoApprove for read-only operations:

  • bb_list_repositories
  • bb_get_repository
  • bb_list_pull_requests
  • bb_get_pull_request
  • bb_get_pull_request_diff
  • bb_list_repository_branches
  • bb_list_pull_request_comments

Write operations (creating PRs, commenting) will prompt for confirmation.

Troubleshooting

401 Unauthorized Error

Cause: Invalid or expired token, or missing Bitbucket scopes.

Fix:

  1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
  2. Check your token has Bitbucket scopes (click "View scopes")
  3. If missing scopes, revoke and create a new token
  4. Update your mcp.json with the new token
  5. Reconnect the MCP server in Kiro

404 Workspace Not Found

Cause: Incorrect workspace name.

Fix: Use the workspace slug (lowercase, dashes), not the display name.

Example:

  • ❌ "Devopsx Vietnam" (display name)
  • βœ… "devopsx-vietnam" (slug)

410 Deprecated API Endpoint

Cause: The MCP server may use deprecated Bitbucket APIs.

Fix: The server should handle this automatically by using newer endpoints. If you still see this error, report it to the MCP server maintainer.

Token Shows as Expired

Atlassian API tokens expire after 1 year. Check the "Expires" column at https://id.atlassian.com/manage-profile/security/api-tokens and generate a new one if needed.

Security Best Practices

⚠️ Never commit your API token to Git!

  • Keep tokens in ~/.kiro/settings/mcp.json (outside your repo)
  • If using workspace-level config, add to .gitignore:
    .kiro/settings/mcp.json
    
  • Revoke tokens you're no longer using
  • Use separate tokens for different tools/environments

Example Workflow

Here's a typical workflow using Kiro + Bitbucket:

  1. List repos: "Show me all repos in the esoft-vietnam workspace"
  2. Check PRs: "Are there any open PRs in the esoft-core repo?"
  3. Review code: "Show me the diff for PR #23"
  4. Read discussion: "What are the comments on PR #23?"
  5. Check branches: "List all branches in esoft-payment"

Resources

Contributing

Found an issue or have a suggestion? Open an issue or submit a pull request!

License

MIT License - see LICENSE for details.

Author

Created by @devopsxvn-svg


⭐ If this helped you, consider giving it a star!