Integrations
Enables interaction with Bitbucket Cloud and Server APIs, providing tools for listing and retrieving repositories, managing pull requests, and working with repository content.
Supports working with Git repositories stored in Bitbucket, allowing access to repository content and version control operations.
Bitbucket MCP
A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs. This MCP server enables AI assistants like Cursor to interact with your Bitbucket repositories, pull requests, and other resources.
Safety First
This is a safe and responsible package — no DELETE operations are used, so there’s no risk of data loss. Every pull request is analyzed with CodeQL to ensure the code remains secure.
Overview
Checkout out the official npm package This server implements the Model Context Protocol standard to provide AI assistants with access to Bitbucket data and operations. It includes tools for:
- Listing and retrieving repositories
- Getting repository details
- Fetching pull requests
- And more...
Installation
Using NPX (Recommended)
The easiest way to use this MCP server is via NPX, which allows you to run it without installing it globally:
Manual Installation
Alternatively, you can install it globally or as part of your project:
Then run it with:
Configuration
Environment Variables
Configure the server using the following environment variables:
Variable | Description | Required |
---|---|---|
BITBUCKET_URL | Bitbucket base URL (e.g., "https://bitbucket.org/your-workspace") | Yes |
BITBUCKET_USERNAME | Your Bitbucket username | Yes* |
BITBUCKET_PASSWORD | Your Bitbucket app password | Yes* |
BITBUCKET_TOKEN | Your Bitbucket access token (alternative to username/password) | No |
BITBUCKET_WORKSPACE | Default workspace to use when not specified | No |
* Either BITBUCKET_TOKEN
or both BITBUCKET_USERNAME
and BITBUCKET_PASSWORD
must be provided.
Creating a Bitbucket App Password
- Log in to your Bitbucket account
- Go to Personal Settings > App Passwords
- Create a new app password with the following permissions:
- Repositories: Read
- Pull requests: Read, Write
- Copy the generated password and use it as the
BITBUCKET_PASSWORD
environment variable
Integration with Cursor
To integrate this MCP server with Cursor:
- Open Cursor
- Go to Settings > Extensions
- Click on "Model Context Protocol"
- Add a new MCP configuration:
- Save the configuration
- Use the "/bitbucket" command in Cursor to access Bitbucket repositories and pull requests
Using a Local Build with Cursor
If you're developing locally and want to test your changes:
Available Tools
This MCP server provides tools for interacting with Bitbucket repositories and pull requests. Below is a comprehensive list of the available operations:
Repository Operations
listRepositories
Lists repositories in a workspace.
Parameters:
workspace
(optional): Bitbucket workspace namelimit
(optional): Maximum number of repositories to return
getRepository
Gets details for a specific repository.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slug
Pull Request Operations
getPullRequests
Gets pull requests for a repository.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugstate
(optional): Pull request state (OPEN
,MERGED
,DECLINED
,SUPERSEDED
)limit
(optional): Maximum number of pull requests to return
createPullRequest
Creates a new pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugtitle
: Pull request titledescription
: Pull request descriptionsourceBranch
: Source branch nametargetBranch
: Target branch namereviewers
(optional): List of reviewer usernames
getPullRequest
Gets details for a specific pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
updatePullRequest
Updates a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID- Various optional update parameters (title, description, etc.)
getPullRequestActivity
Gets the activity log for a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
approvePullRequest
Approves a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
unapprovePullRequest
Removes an approval from a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
declinePullRequest
Declines a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDmessage
(optional): Reason for declining
mergePullRequest
Merges a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDmessage
(optional): Merge commit messagestrategy
(optional): Merge strategy (merge-commit
,squash
,fast-forward
)
requestChanges
Requests changes on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
removeChangeRequest
Removes a change request from a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
Pull Request Comment Operations
getPullRequestComments
Lists comments on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
createPullRequestComment
Creates a comment on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcontent
: Comment contentinline
(optional): Inline comment information
getPullRequestComment
Gets a specific comment on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcomment_id
: Comment ID
updatePullRequestComment
Updates a comment on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcomment_id
: Comment IDcontent
: Updated comment content
deletePullRequestComment
Deletes a comment on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcomment_id
: Comment ID
resolveComment
Resolves a comment thread on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcomment_id
: Comment ID
reopenComment
Reopens a resolved comment thread on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcomment_id
: Comment ID
Pull Request Diff Operations
getPullRequestDiff
Gets the diff for a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
getPullRequestDiffStat
Gets the diff statistics for a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
getPullRequestPatch
Gets the patch for a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
Pull Request Task Operations
getPullRequestTasks
Lists tasks on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
createPullRequestTask
Creates a task on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDcontent
: Task contentcomment
(optional): Comment ID to associate with the taskpending
(optional): Whether the task is pending
getPullRequestTask
Gets a specific task on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDtask_id
: Task ID
updatePullRequestTask
Updates a task on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDtask_id
: Task IDcontent
(optional): Updated task contentstate
(optional): Updated task state
deletePullRequestTask
Deletes a task on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request IDtask_id
: Task ID
Other Pull Request Operations
getPullRequestCommits
Lists commits on a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
getPullRequestStatuses
Lists commit statuses for a pull request.
Parameters:
workspace
: Bitbucket workspace namerepo_slug
: Repository slugpull_request_id
: Pull request ID
Development
Prerequisites
- Node.js 18 or higher
- npm or yarn
Setup
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables AI assistants to interact with Bitbucket repositories, pull requests, and other resources through Bitbucket Cloud and Server APIs.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI models to interact with GitHub's API, allowing for repository creation and management with descriptions, topics, and website URLs through natural language commands.Last updated -1JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with GitHub repositories, issues, and pull requests.Last updated -129Python
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to perform GitHub operations including repository management, file operations, issue tracking, and pull request creation.Last updated -1TypeScript
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -16TypeScript