MCP-Mirror/aashari_mcp-server-atlassian-bitbucket
If you are the rightful owner of aashari_mcp-server-atlassian-bitbucket 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 Atlassian Bitbucket MCP Server is a bridge between AI assistants and Bitbucket, enabling secure, real-time access to repositories, pull requests, and workspaces.
Tools
Functions exposed to the LLM to take actions
bb_ls_workspaces
Lists workspaces within your Bitbucket account. Returns a formatted Markdown list showing workspace slugs, names, and membership role. Requires Bitbucket credentials to be configured.
bb_get_workspace
Retrieves detailed information for a workspace identified by workspaceSlug
. Returns comprehensive workspace details as formatted Markdown, including membership, projects, and key metadata. Requires Bitbucket credentials to be configured.
bb_ls_repos
Lists repositories within a workspace. If workspaceSlug
is not provided, uses your default workspace (either configured via BITBUCKET_DEFAULT_WORKSPACE or the first workspace in your account). Filters repositories by the users
role, project key
projectKey, or a
querystring (searches name/description). Supports sorting via
sortand pagination via
limitand
cursor`. Pagination details are included at the end of the text content. Returns a formatted Markdown list with comprehensive details. Requires Bitbucket credentials.
bb_get_repo
Retrieves detailed information for a specific repository identified by workspaceSlug
and repoSlug
. Returns comprehensive repository details as formatted Markdown, including owner, main branch, comment/task counts, recent pull requests, and relevant links. Requires Bitbucket credentials.
bb_get_commit_history
Retrieves the commit history for a repository identified by workspaceSlug
and repoSlug
. Supports pagination via limit
(number of commits per page) and cursor
(which acts as the page number for this endpoint). Optionally filters history starting from a specific branch, tag, or commit hash using revision
, or shows only commits affecting a specific file using path
. Returns the commit history as formatted Markdown, including commit hash, author, date, and message. Pagination details are included at the end of the text content. Requires Bitbucket credentials to be configured.
bb_add_branch
Creates a new branch in a specified Bitbucket repository. Requires the workspace slug (workspaceSlug
), repository slug (repoSlug
), the desired new branch name (newBranchName
), and the source branch or commit hash (sourceBranchOrCommit
) to branch from. Requires repository write permissions. Returns a success message.
bb_clone_repo
Clones a Bitbucket repository to your local filesystem using SSH (preferred) or HTTPS. Requires Bitbucket credentials and proper SSH key setup for optimal usage.
Parameters:
workspaceSlug
: The Bitbucket workspace containing the repository (optional - will use default if not provided)repoSlug
: The repository name to clone (required)targetPath
: Parent directory where repository will be cloned (required)
Path Handling:
- Absolute paths are strongly recommended (e.g., "/home/user/projects" or "C:\Users\name\projects")
- Relative paths (e.g., "./my-repos" or "../downloads") will be resolved relative to the server's working directory, which may not be what you expect
- The repository will be cloned into a subdirectory at
targetPath/repoSlug
- Make sure you have write permissions to the target directory
SSH Requirements:
- SSH keys must be properly configured for Bitbucket
- SSH agent should be running with your keys added
- Will automatically fall back to HTTPS if SSH is unavailable
Example Usage:
// Clone a repository to a specific absolute path
bb_clone_repo({repoSlug: "my-project", targetPath: "/home/user/projects"})
// Specify the workspace and use a relative path (less reliable)
bb_clone_repo({workspaceSlug: "my-team", repoSlug: "api-service", targetPath: "./downloads"})
Returns: Success message with clone details or an error message with troubleshooting steps.
bb_get_file
Retrieves the content of a file from a Bitbucket repository identified by workspaceSlug
and repoSlug
. Specify the file to retrieve using the filePath
parameter. Optionally, you can specify a revision
(branch name, tag, or commit hash) to retrieve the file from - if omitted, the repository's default branch is used. Returns the raw content of the file as text. Requires Bitbucket credentials.
bb_list_branches
Lists branches in a repository identified by workspaceSlug
and repoSlug
. Filters branches by an optional text query
and supports custom sort
order. Provides pagination via limit
and cursor
. Pagination details are included at the end of the text content. Returns branch details as Markdown with each branch's name, latest commit, and default merge strategy. Requires Bitbucket credentials.
bb_ls_prs
Lists pull requests within a repository (repoSlug
). If workspaceSlug
is not provided, the system will use your default workspace. Filters by state
(OPEN, MERGED, DECLINED, SUPERSEDED) and supports text search via query
. Supports pagination via limit
and cursor
. Pagination details are included at the end of the text content. Returns a formatted Markdown list with each PR's title, status, author, reviewers, and creation date. Requires Bitbucket credentials to be configured.
bb_get_pr
Retrieves detailed information about a specific pull request identified by prId
within a repository (repoSlug
). If workspaceSlug
is not provided, the system will use your default workspace. Includes PR details, status, reviewers, and diff statistics. Set includeFullDiff
to true (default) for the complete code changes. Set includeComments
to true to also retrieve comments (default: false; Note: Enabling this may increase response time for pull requests with many comments). Returns rich information as formatted Markdown, including PR summary, code changes, and optionally comments. Requires Bitbucket credentials to be configured.
bb_ls_pr_comments
Lists comments on a specific pull request identified by prId
within a repository (repoSlug
). If workspaceSlug
is not provided, the system will use your default workspace. Retrieves both general PR comments and inline code comments, indicating their location if applicable. Supports pagination via limit
and cursor
. Pagination details are included at the end of the text content. Returns a formatted Markdown list with each comment's author, timestamp, content, and location for inline comments. Requires Bitbucket credentials to be configured.
bb_add_pr_comment
Adds a comment to a specific pull request identified by prId
within a repository (repoSlug
). If workspaceSlug
is not provided, the system will use your default workspace. The content
parameter accepts Markdown-formatted text for the comment body. For inline code comments, provide both inline.path
(file path) and inline.line
(line number). Returns a success message as formatted Markdown. Requires Bitbucket credentials with write permissions to be configured.
bb_add_pr
Creates a new pull request in a repository (repoSlug
). If workspaceSlug
is not provided, the system will use your default workspace. Required parameters include title
, sourceBranch
(branch with changes), and optionally destinationBranch
(target branch, defaults to main/master). The description
parameter accepts Markdown-formatted text for the PR description. Set closeSourceBranch
to true to automatically delete the source branch after merging. Returns the newly created pull request details as formatted Markdown. Requires Bitbucket credentials with write permissions to be configured.
bb_update_pr
Updates an existing pull request in a repository (repoSlug
) identified by pullRequestId
. If workspaceSlug
is not provided, the system will use your default workspace. You can update the title
and/or description
fields. At least one field must be provided. The description
parameter accepts Markdown-formatted text. Returns the updated pull request details as formatted Markdown. Requires Bitbucket credentials with write permissions to be configured.
bb_approve_pr
Approves a pull request in a repository (repoSlug
) identified by pullRequestId
. If workspaceSlug
is not provided, the system will use your default workspace. This marks the pull request as approved by the current user, indicating that the changes are ready for merge (pending any other required approvals or checks). Returns an approval confirmation as formatted Markdown. Requires Bitbucket credentials with appropriate permissions to be configured.
bb_reject_pr
Requests changes on a pull request in a repository (repoSlug
) identified by pullRequestId
. If workspaceSlug
is not provided, the system will use your default workspace. This marks the pull request as requiring changes by the current user, indicating that the author should address feedback before the pull request can be merged. Returns a rejection confirmation as formatted Markdown. Requires Bitbucket credentials with appropriate permissions to be configured.
bb_search
Searches Bitbucket for content matching the provided query. Use this tool to find repositories, code, pull requests, or other content in Bitbucket. Specify scope
to narrow your search ("code", "repositories", "pullrequests", or "content"). Filter code searches by language
or extension
. Filter content searches by contentType
. Only searches within the specified workspaceSlug
and optionally within a specific repoSlug
. Supports pagination via limit
and cursor
. Requires Atlassian Bitbucket credentials configured. Returns search results as Markdown.
bb_diff_branches
Shows changes between branches in a repository identified by workspaceSlug
and repoSlug
. Compares changes in sourceBranch
relative to destinationBranch
. Limits the number of files to show with limit
. Returns the diff as formatted Markdown showing file changes, additions, and deletions. Requires Bitbucket credentials to be configured.
bb_diff_commits
Shows changes between commits in a repository identified by workspaceSlug
and repoSlug
. Requires sinceCommit
and untilCommit
to identify the specific commits to compare. Returns the diff as formatted Markdown showing file changes, additions, and deletions between the commits. Requires Bitbucket credentials to be configured.
Prompts
Interactive templates invoked by user choice
No prompts
Resources
Contextual data attached and managed by the client