← Back to directory
B

Bitbucket MCP Server

Community
A Model Context Protocol (MCP) server for Bitbucket Cloud and Server API integration.
GitHub source repository ↗
★ 165 Stars Category · Dev Tools Popular Source revision d3594e2cfaae
52FMRS · D
Reliability
4/20
Security and permissions
10/20
Maintenance
10/20
Documentation
14/20
Setup experience
14/20

bitbucket-mcp is a feature-rich MCP server for Bitbucket Cloud and Server integration, offering a wide range of repository, pull request, and pipeline operations. It emphasizes safety by disabling delete tools by default and includes code scanning. Installation is straightforward with clear environment variable configuration, and it supports Cursor among other clients.

Read the FMRS scoring method →

bitbucket-mcp is a Model Context Protocol (MCP) server that integrates AI assistants like Cursor with Bitbucket repositories, pull requests, and pipelines. It provides tools to list and retrieve repositories, manage pull requests (create, update, approve, merge, etc.), handle pull request comments, tasks, diffs, and pipelines. The server uses stdio transport and relies on environment variables for authentication.

Tools

listRepositories
Lists repositories in a workspace, with optional name filter and pagination.
getRepository
Gets details for a specific repository.
getPullRequests
Gets pull requests for a repository, optionally filtered by state.
createPullRequest
Creates a new pull request with source/target branches, reviewers, and draft option.
getPullRequest
Gets details for a specific pull request.
updatePullRequest
Updates a pull request (title, description, etc.).
getPullRequestActivity
Gets the activity log for a pull request.
approvePullRequest
Approves a pull request.
unapprovePullRequest
Removes approval from a pull request.
declinePullRequest
Declines a pull request, optionally with a reason.
mergePullRequest
Merges a pull request with optional merge strategy and message.
requestChanges
Requests changes on a pull request.
removeChangeRequest
Removes a change request from a pull request.
createDraftPullRequest
Creates a draft pull request.
publishDraftPullRequest
Publishes a draft pull request to make it ready for review.
convertTodraft
Converts a regular pull request to draft status.
getPullRequestComments
Lists comments on a pull request.
addPullRequestComment
Adds a comment to a pull request, either general or inline.
getPullRequestComment
Gets a specific pull request comment.
updatePullRequestComment
Updates a pull request comment.
deletePullRequestComment
Deletes a pull request comment.
resolveComment
Resolves a comment thread on a pull request.
reopenComment
Reopens a resolved comment thread.
getPullRequestDiff
Gets the diff for a pull request.
getPullRequestDiffStat
Gets diff statistics for a pull request.
getPullRequestPatch
Gets the patch for a pull request.
getPullRequestTasks
Lists tasks on a pull request.
createPullRequestTask
Creates a task on a pull request.
getPullRequestTask
Gets a specific task on a pull request.
updatePullRequestTask
Updates a task's content or state.
deletePullRequestTask
Deletes a task.
getPullRequestCommits
Lists commits on a pull request.
getPullRequestStatuses
Lists commit statuses for a pull request.
listPipelineRuns
Lists pipeline runs for a repository, with optional filters.
getPipelineRun
Gets details for a specific pipeline run.
runPipeline
Triggers a new pipeline run.
stopPipeline
Stops a running pipeline.
getPipelineSteps
Lists steps for a pipeline run.
getPipelineStep
Gets details for a specific pipeline step.
getPipelineStepLogs
Gets logs for a specific pipeline step.

Setup

  1. Ensure Node.js 18 or higher.
  2. Recommended: use npx with environment variables (BITBUCKET_URL, BITBUCKET_USERNAME, BITBUCKET_PASSWORD, optionally BITBUCKET_WORKSPACE) and run npx -y bitbucket-mcp@latest.
  3. Alternatively, install globally: npm install -g bitbucket-mcp and run bitbucket-mcp.
  4. In a supported client like Cursor, add an MCP configuration with the npx command and required env vars.
claude_desktop_config.json
{
  "mcpServers": {
    "bitbucket": {
      "command": "npx",
      "args": [
        "-y",
        "bitbucket-mcp@latest"
      ],
      "env": {
        "BITBUCKET_URL": "https://api.bitbucket.org/2.0",
        "BITBUCKET_WORKSPACE": "your-workspace",
        "BITBUCKET_USERNAME": "your-username",
        "BITBUCKET_PASSWORD": "your-app-password"
      }
    }
  }
}

Fit and risk

Best for

  • Developers using Bitbucket Cloud or Server who want AI assistant integration.
  • Teams that need to interact with Bitbucket repos and PRs programmatically or via natural language.
  • Users leveraging MCP standard to operate Bitbucket within tools like Cursor.

Not for

  • Users who need delete operations on Bitbucket resources (delete tools are disabled by default).
  • Users who need a GUI instead of CLI or AI integration.
  • Users without Bitbucket credentials.

Required permissions

  • Requires Bitbucket app password or access token.
  • Needs at least 'Repositories: Read' for most operations.
  • For pipeline operations, 'Pipelines: Read' is required.
  • For write operations (e.g., create/update PRs), 'Pull requests: Write' is required.

Risks and side effects

  • Using app passwords or tokens may lead to unauthorized access if leaked.
  • Overly permissive credentials might allow unintended modifications or deletions (though delete tools are disabled by default).
  • Misconfiguration could expose sensitive information (e.g., incorrect logging levels).

Troubleshooting

  1. 401 authentication errors: ensure you are using an app password, not your regular password, and check permissions.
  2. Use API URL format: if you get 401, try setting `BITBUCKET_URL=https://api.bitbucket.org/2.0`.
  3. Test API access with curl: `curl -u "username:app-password" "https://api.bitbucket.org/2.0/repositories/workspace"`.
  4. For Atlassian API keys, put the key in `BITBUCKET_PASSWORD` and use your Bitbucket email as username.

Use cases

Manage Bitbucket repositories and pull requests via AI assistants: list repos, view PRs, create PRs, review and merge.
Automate workflows, such as triggering actions based on PR activity or running pipelines.
Get repository info, PR comments, and diffs in a conversational interface.

Supported clients

CursorFull support
Claude DesktopFull support