bitbucket-mcp-tutorial

shibyan-ai-engineer/bitbucket-mcp-tutorial

3.3

If you are the rightful owner of bitbucket-mcp-tutorial and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Bitbucket MCP Server is a comprehensive solution for integrating AI-powered code review bots with Bitbucket repositories, leveraging the Model Context Protocol (MCP) to enhance development workflows.

The Bitbucket MCP Server is designed to transform AI assistants into powerful development companions by connecting them to Bitbucket repositories. This server utilizes the Model Context Protocol (MCP) to facilitate intelligent code review and repository management. With a focus on production-readiness, the server includes 11 tools and 4 resources, making it a robust solution for real-world usage. It supports AI integration with platforms like Claude Desktop and Cursor, enabling automated pull request reviews, repository analytics, and intelligent commenting. The server is built using the FastMCP framework, ensuring a fast setup and seamless integration with Bitbucket's REST API. Whether you're a beginner or an experienced developer, this tutorial provides a step-by-step guide to building and deploying your own MCP server, complete with code snippets and configuration instructions.

Features

  • Production-Ready: Includes 11 tools and 4 resources for comprehensive functionality.
  • Beginner-Friendly: Step-by-step guide with easy-to-follow instructions and code snippets.
  • AI Integration: Compatible with Claude Desktop, Cursor, and other MCP-compatible AI assistants.
  • Real-World Usage: Automates pull request reviews and repository management tasks.
  • Fast Setup: Get your server running in under 10 minutes with minimal configuration.

Usages

usage with Claude Desktop

{
  "mcpServers": {
    "bitbucket": {
      "command": "python",
      "args": ["/absolute/path/to/mcp_server.py"],
      "env": {
        "BITBUCKET_WORKSPACE": "your-workspace",
        "BITBUCKET_USERNAME": "your-username",
        "BITBUCKET_APP_PASSWORD": "your-app-password"
      }
    }
  }
}

Tools

  1. list_repositories

    List user repositories by role.

  2. get_repository_info

    Get detailed information about a specific repository.

  3. list_pull_requests

    List pull requests with filtering options.

  4. get_pull_request_info

    Retrieve detailed information about a specific pull request.

  5. get_pull_request_diff

    Get the code diff for a specific pull request.

  6. add_pr_comment

    Add a comment to a pull request.

  7. approve_pr

    Approve a pull request.

  8. unapprove_pr

    Remove approval from a pull request.

  9. merge_pr

    Merge a pull request using a specified strategy.

  10. decline_pr

    Decline a pull request with a reason.

  11. get_pr_comments

    Retrieve comments from a pull request.