# Bitbucket MCP Server [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/lawp09/bitbucket-mcp  
**GitHub Stars:** 4  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bitbucket-mcp-server-2

## Description
MCP server for Bitbucket API - manage repositories, pull requests, comments, pipelines and more

## Tools
Capabilities this server exposes over MCP:

- **list_repositories** — 
    List repositories in workspace with pagination support.

    Args:
        workspace: Workspace name (optional, defaults to configured workspace)
        name: Filter by repository name (partial match supported)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of repositories

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_repository** — 
    Get repository details.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Repository information
    
- **get_repository_tags** — 
    List repository tags ordered by most recent target date.

    Note: "target date" is the date of the tag's target commit, not the tag
    creation date — a tag placed on an old commit will not sort first.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of repository tags
    
- **get_pull_requests** — 
    Get pull requests for a repository with pagination support.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        state: Pull request state (OPEN, MERGED, DECLINED, SUPERSEDED) (default: OPEN)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of pull requests

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pull_requests_pending_review** — 
    Get open pull requests where the current user is a reviewer.

    Use this to find PRs that need your review attention.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of pull requests pending your review
    
- **get_pull_request** — 
    Get details for a specific pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Pull request details with comment statistics:
        - comment_stats: Object containing:
          - total (int): Total number of comments
          - resolved (int): Number of resolved comments
          - unresolved (int): Number of unresolved comments
        - source_commit / destination_commit (string or null): full 40-character
          hash of the PR head and of the destination branch tip, unlike the
          12-character hashes elsewhere. null when the commit cannot be resolved
          (e.g. a deleted source branch, or a fork outside the allowed workspaces).
          Only this tool returns them.
        - participants[].state (string or null): "approved", "changes_requested"
          or null — the participant's current review status
    
- **create_pull_request** — 
    Create a new pull request.

    Args:
        repo_slug: Repository slug
        title: Pull request title
        description: Pull request description
        source_branch: Source branch name
        target_branch: Target branch name
        workspace: Workspace name (optional, defaults to configured workspace)
        reviewers: List of reviewer UUIDs (optional)
        draft: Whether to create the pull request as a draft (default: False)

    Returns:
        Created pull request details
    
- **update_pull_request** — 
    Update a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        title: New pull request title (optional)
        description: New pull request description (optional)
        reviewers: Complete list of reviewer UUIDs to set on the PR (optional).
            WARNING: this REPLACES the entire reviewer list — include all existing reviewers
            you want to keep, plus any new ones. Use get_pull_request first to retrieve
            current reviewer UUIDs. Pass [] to clear all reviewers.

    Returns:
        Updated pull request details
    
- **approve_pull_request** — 
    Approve a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Approval details
    
- **unapprove_pull_request** — 
    Remove approval from a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **request_changes_pull_request** — 
    Request changes on a pull request (sets reviewer status to 'needs work').

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Participant details with updated state
    
- **unrequest_changes_pull_request** — 
    Remove 'request changes' status from a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **decline_pull_request** — 
    Decline a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        message: Reason for declining (optional)

    Returns:
        Updated pull request details
    
- **merge_pull_request** — 
    Merge a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        message: Merge commit message (optional)
        strategy: Merge strategy (merge_commit, squash, fast_forward) (default: merge_commit)

    Returns:
        Merged pull request details
    
- **get_pull_request_comments** — 
    List comments on a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        unresolved_only: If true, returns only unresolved comments (default: False)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of comments enriched with resolution status:
        - is_resolved (bool): True if comment is resolved
        - resolved_by (string or null): User display name who resolved the comment
        - resolved_on (string or null): Timestamp when comment was resolved

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **add_pull_request_comment** — 
    Add a comment to a pull request (general or inline).

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        content: Comment content in markdown format
        workspace: Workspace name (optional, defaults to configured workspace)
        inline_path: Path to the file in the repository (for inline comments)
        inline_from: Line number in the old version of the file (for deleted or modified lines)
        inline_to: Line number in the new version of the file (for added or modified lines)
        pending: Whether to create this comment as a pending comment (draft state) (default: False)
        parent_id: ID of the comment to reply to (creates a threaded reply)

    Returns:
        Created comment details
    
- **get_pull_request_comment** — 
    Get a specific comment on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Comment details with resolution status
    
- **update_pull_request_comment** — 
    Update a comment on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comment_id: Comment ID
        content: New comment content in markdown format
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated comment details
    
- **delete_pull_request_comment** — 
    Delete a comment on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **resolve_pull_request_comment** — 
    Resolve a comment on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Resolution details
    
- **reopen_pull_request_comment** — 
    Reopen (unresolve) a comment on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **get_pull_request_tasks** — 
    List tasks on a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of tasks with state, content, creator info
    
- **get_pull_request_task** — 
    Get a specific task on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        task_id: Task ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Task details with state, content, creator, resolution info
    
- **create_pull_request_task** — 
    Create a task on a pull request, optionally linked to a specific comment.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        content: Task content in markdown format
        comment_id: Optional comment ID to link the task to a specific comment
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created task details
    
- **update_pull_request_task** — 
    Update a pull request task (content and/or state).

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        task_id: Task ID
        content: New task content in markdown format (optional)
        state: New task state: UNRESOLVED or RESOLVED (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated task details
    
- **delete_pull_request_task** — 
    Delete a task on a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        task_id: Task ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **get_pull_request_diff** — 
    Get diff for a pull request.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        path: Filter diff to a specific file path to reduce token usage (optional).
              Example: "src/middlewares/authorizationMiddleware.ts"

    Returns:
        Unified diff as string
    
- **get_pull_request_patch** — 
    Get the patch for a pull request (git format-patch style).

    The patch includes full commit metadata and can be applied with git am.
    Use get_pull_request_diff for a simpler unified diff.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Dictionary with patch content as string
    
- **get_pull_request_activity** — 
    Get activity log for a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Activity log with all events. Each entry has a ``type``: update, comment,
        approval, changes_requested (date + user) or unknown. The log is history:
        a participant's current review status is ``participants[].state`` from
        get_pull_request. Comment objects enriched with resolution status:
        - is_resolved (bool): True if comment is resolved
        - resolved_by (string or null): User display name who resolved the comment
        - resolved_on (string or null): Timestamp when comment was resolved

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pull_request_commits** — 
    Get commits on a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of commits

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pull_request_statuses** — 
    Get build/CI statuses for a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of build statuses (Jenkins, CI/CD, tests, etc.)
        Each status contains:
        - state: SUCCESSFUL, FAILED, INPROGRESS, STOPPED
        - key: Unique identifier for the build
        - name: Build name/description
        - url: Link to the build details
        - created_on: Timestamp of the status

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_commit_statuses** — 
    Get build/CI statuses for a specific commit (e.g. Jenkins, CI/CD).

    Use this to check the Jenkins build status for any branch commit
    without needing to create a Pull Request first.

    Args:
        repo_slug: Repository slug
        commit_hash: Commit hash (full or short, e.g. "abc1234")
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of build statuses (Jenkins, CI/CD, tests, etc.)
        Each status contains:
        - state: SUCCESSFUL, FAILED, INPROGRESS, STOPPED
        - key: Unique identifier for the build
        - name: Build name/description
        - description: Build result description
        - url: Link to the Jenkins build details
        - created_on: Timestamp of the status
        - updated_on: Timestamp of last update

    Note:
        Requires Jenkins Bitbucket Build Status Notifier plugin to post statuses.
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pull_request_diffstat** — 
    Get file modification statistics for a pull request with pagination support.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Statistics with lines added/removed per file
        Each file entry contains:
        - status: modified, added, removed, renamed
        - lines_added: Number of lines added
        - lines_removed: Number of lines removed
        - new.path: File path after changes

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **list_pipeline_runs** — 
    List pipeline runs for a repository with pagination support.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        status: Filter pipelines by status (PENDING, IN_PROGRESS, SUCCESSFUL, FAILED, ERROR, STOPPED)
        target_branch: Filter pipelines by target branch
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of pipeline runs

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pipeline_run** — 
    Get details for a specific pipeline run.

    Args:
        repo_slug: Repository slug
        pipeline_uuid: Pipeline UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Pipeline run details
    
- **get_pipeline_steps** — 
    List steps for a pipeline run with pagination support.

    Args:
        repo_slug: Repository slug
        pipeline_uuid: Pipeline UUID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of pipeline steps

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_pipeline_step_logs** — 
    Get logs for a specific pipeline step.

    Raw step logs are routinely multi-MB, so only the last `max_bytes` (100 KiB by
    default) are returned. Check the `truncated` flag in the response and page
    through the rest with `start`/`end` if you need more.

    Reading the tail costs two requests: one to establish the log's size, one to
    fetch the tail. Passing an explicit `start`/`end` window skips the first.

    Args:
        repo_slug: Repository slug
        pipeline_uuid: Pipeline UUID, e.g. "{adab6a1f-...}". Unlike get_pipeline_run,
            this endpoint is not documented to accept a build number — resolve the
            UUID first via get_pipeline_run if you only have a number.
        step_uuid: Step UUID (from get_pipeline_steps)
        workspace: Workspace name (optional, defaults to configured workspace)
        log_uuid: Optional log UUID. Omit for the main build container; pass a
            service container UUID to read that service's log instead.
        start: First byte to return (absolute, inclusive)
        end: Last byte to return (absolute, inclusive). start/end are an absolute
            byte window, not a "last N bytes" convention.
        max_bytes: Size of the trailing slice returned when no start/end is given
            (default: 100 KiB). Pass null for the whole log.

    Returns:
        Dict with the log `content`, whether it was `truncated`, `returned_bytes`
        and `total_bytes` (null when the server did not disclose the full size)
    
- **run_pipeline** — 
    Trigger a new pipeline run on a branch.

    Args:
        repo_slug: Repository slug
        branch: Branch name to run the pipeline on
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created pipeline run details
    
- **stop_pipeline** — 
    Stop a running pipeline.

    Args:
        repo_slug: Repository slug
        pipeline_uuid: Pipeline UUID to stop
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Success message
    
- **get_effective_default_reviewers** — 
    Get effective default reviewers for a repository.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        List of default reviewers for the repository

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **create_draft_pull_request** — 
    Create a new pull request as draft. Draft PRs are not ready for review.

    Args:
        repo_slug: Repository slug
        title: Pull request title
        description: Pull request description
        source_branch: Source branch name
        target_branch: Target branch name
        workspace: Workspace name (optional, defaults to configured workspace)
        reviewers: List of reviewer UUIDs (optional)

    Returns:
        Created draft pull request details
    
- **publish_draft_pull_request** — 
    Publish a draft pull request (convert DRAFT to OPEN).

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated pull request details
    
- **convert_pull_request_to_draft** — 
    Convert an open pull request to draft state.

    Note: This operation is NOT supported by the Bitbucket Cloud API.
    Bitbucket only supports creating PRs as drafts or publishing drafts to open.
    Converting an open PR back to draft is only available in the Bitbucket web UI.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Error message explaining the limitation
    
- **submit_pull_request_batch_review** — 
    Submit a batch review on a pull request: post multiple comments and optionally approve or request changes.

    Note: Bitbucket API does not support pending/draft comments in batch. Each comment is posted immediately.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        comments: List of comment objects. Each comment has:
            - content (str, required): Comment text in markdown
            - inline (dict, optional): For inline comments: {"path": str, "to": int, "from": int}
        review_action: Action after posting comments: "approve", "request_changes", or "comment_only" (default: "comment_only")
        review_message: General review message posted as a top-level comment (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Summary with comments_posted count, action taken, and PR details
    
- **get_pull_request_review_summary** — 
    Get a comprehensive review summary for a pull request.

    Fetches PR details first, then aggregates diffstat, unresolved comments,
    and CI statuses in parallel for efficient AI-assisted code review.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Structured summary with pr details, diffstat, unresolved comments,
        CI statuses, and review readiness assessment.
        review_readiness: merged | declined | draft | ci_failing | ci_pending |
                          has_unresolved_comments | ready
    
- **suggest_pull_request_reviewers** — 
    Suggest reviewers for a pull request based on default reviewers and recent PR history.

    Combines default reviewers with frequent approvers from recently merged PRs to
    suggest the most relevant reviewers.

    Args:
        repo_slug: Repository slug
        pull_request_id: Pull request ID
        max_suggestions: Maximum number of reviewer suggestions (default: 5)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Suggested reviewers with scores and reasons, already-assigned reviewers, and data sources
    
- **list_issues** — 
    List issues in a repository's issue tracker, with filtering and pagination.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        state: Filter by state (new, open, resolved, on hold, invalid, duplicate, wontfix, closed)
        kind: Filter by kind (bug, enhancement, proposal, task)
        priority: Filter by priority (trivial, minor, major, critical, blocker)
        assignee: Filter by assignee uuid
        q: Raw BBQL query, combined with the other filters using AND
           (e.g. 'created_on > 2024-01-01'). Passed through verbatim (not escaped).
        sort: Sort field (default: -created_on for most recent first)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)
        max_items: Maximum total items to fetch (default: None)

    Returns:
        Paginated list of issues. If the repository has no issue tracker, returns
        {"error": "issue_tracker_disabled", ...}.

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_issue** — 
    Get details for a specific issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Issue details. If the repository has no issue tracker, returns
        {"error": "issue_tracker_disabled", ...}.
    
- **create_issue** — 
    Create a new issue in a repository's issue tracker.

    Args:
        repo_slug: Repository slug
        title: Issue title
        content: Issue description in markdown (optional)
        kind: Issue kind: bug, enhancement, proposal, task (optional)
        priority: Issue priority: trivial, minor, major, critical, blocker (optional)
        assignee: Assignee uuid (optional)
        state: Initial state (optional, e.g. new, open)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created issue details. If the repository has no issue tracker, returns
        {"error": "issue_tracker_disabled", ...}.
    
- **update_issue** — 
    Update an issue (only the provided fields are changed).

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        title: New title (optional)
        content: New description in markdown (optional)
        state: New state: new, open, resolved, on hold, invalid, duplicate, wontfix, closed (optional)
        kind: New kind: bug, enhancement, proposal, task (optional)
        priority: New priority: trivial, minor, major, critical, blocker (optional)
        assignee: New assignee uuid (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated issue details. If the repository has no issue tracker, returns
        {"error": "issue_tracker_disabled", ...}.
    
- **delete_issue** — 
    Delete an issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "issue_id": ...}. If the repository has no
        issue tracker, returns {"error": "issue_tracker_disabled", ...}.
    
- **get_issue_comments** — 
    List comments on an issue with pagination support.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20, max recommended: 100)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)
        max_items: Maximum total items to fetch (default: None)

    Returns:
        Paginated list of issue comments. If the repository has no issue tracker,
        returns {"error": "issue_tracker_disabled", ...}.

    Note:
        Fetching more than 10 pages or 300 items will trigger a warning.
    
- **get_issue_comment** — 
    Get a specific comment on an issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Issue comment details. If the repository has no issue tracker, returns
        {"error": "issue_tracker_disabled", ...}.
    
- **add_issue_comment** — 
    Add a comment to an issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        content: Comment content in markdown
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created issue comment details. If the repository has no issue tracker,
        returns {"error": "issue_tracker_disabled", ...}.
    
- **update_issue_comment** — 
    Update a comment on an issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        comment_id: Comment ID
        content: New comment content in markdown
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated issue comment details. If the repository has no issue tracker,
        returns {"error": "issue_tracker_disabled", ...}.
    
- **delete_issue_comment** — 
    Delete a comment on an issue.

    Args:
        repo_slug: Repository slug
        issue_id: Issue ID
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "comment_id": ...}. If the repository has no
        issue tracker, returns {"error": "issue_tracker_disabled", ...}.
    
- **list_commits** — 
    List commits for a repository, optionally scoped to a revision or path.

    Args:
        repo_slug: Repository slug
        revision: Branch, tag or commit hash to start from (optional; defaults to all
            branches). A branch name containing '/' is ambiguous here — resolve it to a
            commit hash first (e.g. via get_branch) if listing fails.
        workspace: Workspace name (optional, defaults to configured workspace)
        path: Restrict history to commits touching this file/directory path
        include: Only commits reachable from this ref
        exclude: Exclude commits reachable from this ref
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of commits
    
- **get_commit** — 
    Get details for a single commit.

    Args:
        repo_slug: Repository slug
        commit: Commit hash (a simple branch/tag name also works)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Commit details
    
- **get_commit_comments** — 
    List comments on a commit with pagination support.

    Args:
        repo_slug: Repository slug
        commit: Commit hash
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 10)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of commit comments
    
- **get_commit_comment** — 
    Get a specific comment on a commit.

    Args:
        repo_slug: Repository slug
        commit: Commit hash
        comment_id: Comment ID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Commit comment details
    
- **add_commit_comment** — 
    Add a comment to a commit (general or inline).

    Args:
        repo_slug: Repository slug
        commit: Commit hash
        content: Comment content in markdown format
        workspace: Workspace name (optional, defaults to configured workspace)
        inline_path: Path to the file in the repository (for inline comments)
        inline_from: Line number in the old version of the file
        inline_to: Line number in the new version of the file

    Returns:
        Created comment details
    
- **get_file_content** — 
    Get the raw text content of a file at a given commit or branch.

    A metadata pre-check rejects directories, oversized files (> max_bytes) and
    binary files before downloading, to protect the token budget.

    Args:
        repo_slug: Repository slug
        commit: Commit hash (a simple branch/tag name also works; a branch name
            containing '/' is ambiguous on /src — resolve it to a hash first)
        path: File path within the repository
        workspace: Workspace name (optional, defaults to configured workspace)
        max_bytes: Maximum file size to return (default: 262144 = 256 KiB)

    Returns:
        File content as text
    
- **list_directory** — 
    List the entries (files and sub-directories) of a directory at a commit/branch.

    Args:
        repo_slug: Repository slug
        commit: Commit hash (a simple branch/tag name also works)
        path: Directory path within the repository (empty = repository root)
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 50)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated directory listing (path, type, size, mimetype per entry)
    
- **get_pipeline_config** — 
    Get the repository pipelines configuration (enabled flag, next build number).

    Note: this endpoint requires the `admin:repository` scope. A read-only token
    receives a 403 listing the missing privilege.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Pipelines configuration (enabled, next_build_number)
    
- **list_pipeline_variables** — 
    List repository-level pipeline variables.

    Secured variables never expose their value (returned as null).

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of pipeline variables
    
- **get_pipeline_variable** — 
    Get a single repository-level pipeline variable.

    Args:
        repo_slug: Repository slug
        variable_uuid: Variable UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Pipeline variable (value is null if secured)
    
- **create_pipeline_variable** — 
    Create a repository-level pipeline variable.

    Args:
        repo_slug: Repository slug
        key: Variable name
        value: Variable value
        secured: Whether the value is secured/masked (default: False)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created variable (value is null if secured)
    
- **update_pipeline_variable** — 
    Update a repository-level pipeline variable (partial update).

    Args:
        repo_slug: Repository slug
        variable_uuid: Variable UUID
        key: New variable name (optional)
        value: New variable value (optional)
        secured: New secured flag (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated variable (value is null if secured)
    
- **delete_pipeline_variable** — 
    Delete a repository-level pipeline variable.

    Args:
        repo_slug: Repository slug
        variable_uuid: Variable UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "variable_uuid": ...}
    
- **list_pipeline_schedules** — 
    List pipeline schedules for a repository.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of pipeline schedules
    
- **get_pipeline_schedule** — 
    Get a single pipeline schedule.

    Args:
        repo_slug: Repository slug
        schedule_uuid: Schedule UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Pipeline schedule
    
- **list_pipeline_schedule_executions** — 
    List the executions of a pipeline schedule.

    Args:
        repo_slug: Repository slug
        schedule_uuid: Schedule UUID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of schedule executions
    
- **create_pipeline_schedule** — 
    Create a pipeline schedule on a branch.

    Args:
        repo_slug: Repository slug
        branch: Branch the scheduled pipeline runs on
        cron_pattern: Cron expression (Bitbucket 7-field format, e.g. "0 0 6 * * ? *")
        workspace: Workspace name (optional, defaults to configured workspace)
        enabled: Whether the schedule is enabled (default: True)
        selector_pattern: Pipeline selector pattern (defaults to the branch name)

    Returns:
        Created schedule
    
- **update_pipeline_schedule** — 
    Update a pipeline schedule (partial update).

    Args:
        repo_slug: Repository slug
        schedule_uuid: Schedule UUID
        enabled: New enabled flag (optional)
        cron_pattern: New cron expression (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated schedule
    
- **delete_pipeline_schedule** — 
    Delete a pipeline schedule.

    Args:
        repo_slug: Repository slug
        schedule_uuid: Schedule UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "schedule_uuid": ...}
    
- **list_pipeline_caches** — 
    List pipeline caches for a repository.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of pipeline caches
    
- **delete_pipeline_cache** — 
    Delete a pipeline cache.

    Args:
        repo_slug: Repository slug
        cache_uuid: Cache UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "cache_uuid": ...}
    
- **list_environments** — 
    List deployment environments (staging, production, etc.) for a repository.

    Requires the `deployment` OAuth scope.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of environments
    
- **get_environment** — 
    Get a single deployment environment.

    Requires the `deployment` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Environment details
    
- **list_deployments** — 
    List deployments for a repository (deployment history, most recent first).

    The Bitbucket API cannot filter deployments by environment server-side; filter
    on the `environment` field of the returned items instead. Requires the
    `deployment` OAuth scope.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of deployments
    
- **get_deployment** — 
    Get a single deployment (state, environment, deployed commit).

    Requires the `deployment` OAuth scope.

    Args:
        repo_slug: Repository slug
        deployment_uuid: Deployment UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Deployment details (state, status, environment, commit)
    
- **list_deployment_variables** — 
    List the variables of a deployment environment.

    Secured variables never expose their value (returned as null). Requires the
    `deployment` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 20)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of deployment variables
    
- **create_environment** — 
    Create a deployment environment.

    Requires the `deployment:write` OAuth scope.

    Args:
        repo_slug: Repository slug
        name: Environment name
        environment_type: One of "Test", "Staging", "Production" (default: "Test")
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created environment
    
- **delete_environment** — 
    Delete a deployment environment.

    Requires the `deployment:write` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "environment_uuid": ...}
    
- **create_deployment_variable** — 
    Create a deployment environment variable.

    Requires the `deployment:write` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        key: Variable name
        value: Variable value
        secured: Whether the value is secured/masked (default: False)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created variable (value is null if secured)
    
- **update_deployment_variable** — 
    Update a deployment environment variable (partial update).

    Requires the `deployment:write` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        variable_uuid: Variable UUID
        key: New variable name (optional)
        value: New variable value (optional)
        secured: New secured flag (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated variable (value is null if secured)
    
- **delete_deployment_variable** — 
    Delete a deployment environment variable.

    Requires the `deployment:write` OAuth scope.

    Args:
        repo_slug: Repository slug
        environment_uuid: Environment UUID
        variable_uuid: Variable UUID
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "variable_uuid": ...}
    
- **list_branch_restrictions** — 
    List branch restrictions (branch protection rules) for a repository.

    Requires the `repository` scope (or `repository:admin` depending on the repo
    configuration).

    Args:
        repo_slug: Repository slug
        kind: Optional filter by restriction type (e.g. `push`, `require_approvals_to_merge`)
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of branch restrictions
    
- **get_branch_restriction** — 
    Get a single branch restriction.

    Args:
        repo_slug: Repository slug
        restriction_id: Numeric restriction id
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Branch restriction details
    
- **create_branch_restriction** — 
    Create a branch restriction (branch protection rule).

    Requires the `repository:admin` scope.

    Args:
        repo_slug: Repository slug
        kind: Restriction type (`push`, `force`, `delete`, `require_approvals_to_merge`, ...)
        pattern: Branch name pattern the restriction applies to
        value: Numeric value where applicable (e.g. minimum approvals)
        users: Optional list of account_ids
        groups: Optional list of group slugs
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Created branch restriction
    
- **update_branch_restriction** — 
    Update a branch restriction.

    The Bitbucket PUT endpoint requires `kind` in the body (it identifies the
    restriction), so pass the existing `kind` along with the field(s) to change.
    Requires the `repository:admin` scope.

    Args:
        repo_slug: Repository slug
        restriction_id: Numeric restriction id
        kind: Restriction type — required by the API on update
        pattern: New branch pattern (optional)
        value: New numeric value (optional)
        users: New list of account_ids (optional)
        groups: New list of group slugs (optional)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Updated branch restriction
    
- **delete_branch_restriction** — 
    Delete a branch restriction.

    Requires the `repository:admin` scope.

    Args:
        repo_slug: Repository slug
        restriction_id: Numeric restriction id
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Confirmation {"deleted": True, "restriction_id": ...}
    
- **list_workspace_members** — 
    List the members of a workspace.

    The members endpoint carries no per-user permission — use
    `list_workspace_permissions` for roles. Requires the `account` scope.

    Args:
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of workspace memberships
    
- **get_workspace_member** — 
    Get a single workspace member.

    Requires the `account` scope.

    Args:
        member_id: Member account_id or brace-wrapped uuid (not a username)
        workspace: Workspace name (optional, defaults to configured workspace)

    Returns:
        Workspace membership details
    
- **list_workspace_permissions** — 
    List the user permissions (roles) of a workspace.

    Requires the `account` scope.

    Args:
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of workspace permissions (permission + user)
    
- **list_repository_permissions** — 
    List the user permissions for a specific repository in the workspace.

    Requires the `account` scope.

    Args:
        repo_slug: Repository slug
        workspace: Workspace name (optional, defaults to configured workspace)
        page_size: Items per page (default: 30)
        max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

    Returns:
        Paginated list of repository permissions (permission + user)
    

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "bitbucket-mcp-server": {
    "command": "uvx",
    "args": ["--from","bitbucket-mcp-py","bitbucket-mcp"],
    "env": {
      "BITBUCKET_USERNAME": "",
      "BITBUCKET_TOKEN": "",
      "BITBUCKET_WORKSPACE": ""
    }
  }
}
```

**Requires environment variables:** `BITBUCKET_USERNAME`, `BITBUCKET_TOKEN`, `BITBUCKET_WORKSPACE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Bitbucket MCP Server does

Bitbucket MCP Server exposes Bitbucket Cloud operations as MCP tools for AI assistants. Its coverage spans repository discovery, pull request management, code review, CI pipelines, issues, commits, source browsing, deployments, branch restrictions, and workspace permissions.

The tool set includes more than 60 operations. Agents can list repositories, inspect files and directories, read commits and diffs, review pull request activity, manage comments and tasks, work with issues, and query build or pipeline status. Write operations cover actions such as creating pull requests, approving or declining them, merging them when enabled, starting pipelines, editing issues, and managing selected configuration resources.

Responses are reduced to remove API noise, which keeps returned data more focused for language-model use. Tools also publish MCP 2025 annotations, including read-only, destructive, idempotent, and open-world hints, along with human-readable titles.

## How it works

The server runs as a local stdio MCP process. The recommended launch command uses `uvx` to fetch the `bitbucket-mcp-py` package and invoke its `bitbucket-mcp` entry point:

```bash
uvx --from bitbucket-mcp-py bitbucket-mcp
```

It connects to Bitbucket Cloud using a Bitbucket email address, API token, and workspace slug supplied through environment variables. Credentials can also be stored in the system keychain. An MCP client starts the process and passes requests to the exposed Bitbucket tools.

Tool availability can be changed through `configs/tools.json` or the `BITBUCKET_TOOLS_CONFIG` environment variable. This allows deployments to limit the operations presented to an assistant.

## Setup and configuration

Install with `uvx` for an isolated execution environment, or use `pip install bitbucket-mcp-py` for a persistent installation. A local editable install is available for project development, and Docker can be used for container-based execution.

Configure these environment variables in the MCP client's server definition:

- `BITBUCKET_USERNAME`: the Bitbucket email address.
- `BITBUCKET_TOKEN`: the Bitbucket API token.
- `BITBUCKET_WORKSPACE`: the workspace slug.

The token should use explicit scopes matching the operations the assistant needs, such as repository read access or pull-request read/write access. The server is listed with setup examples for Claude Code, OpenAI Codex, Cursor, and VS Code with GitHub Copilot.

## Tools and capabilities

Available tool groups include:

- Repository listing, repository details, and tag retrieval.
- Pull request creation, updates, approvals, review requests, draft handling, merging, and status inspection.
- Pull request comments, tasks, activity, diffs, diff statistics, patches, commits, and review summaries.
- Pipeline runs, steps, logs, execution control, configuration, variables, schedules, and caches.
- Issue and issue-comment management, including creation, updates, and deletion.
- Commit lookup and commit comments, plus file-content and directory browsing.
- Deployment environments, deployments, deployment variables, branch restrictions, workspace members, and permission queries.

Several operations are disabled by default because they are destructive, write-oriented, safety-sensitive, unsupported by the Bitbucket API, or unsuitable for AI review. Examples include merging pull requests, stopping pipelines, deleting issues or comments, changing pipeline variables and schedules, modifying deployment variables, and creating or updating branch restrictions. The patch retrieval tool is also disabled by default because it returns a `git am`-formatted patch.

## Limitations and notes

This server targets Bitbucket Cloud and requires credentials with scopes appropriate to the requested actions. Disabled tools can be controlled through the tool configuration, but enabling write or destructive operations changes what an assistant can do in the workspace. The package name on PyPI is `bitbucket-mcp-py`, while the executable name is `bitbucket-mcp`.

_Full upstream README: https://allmcps.com/mcp/bitbucket-mcp-server-2/readme_

