# bitbucket-mcp-server [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/droplinkperformance/bitbucket-mcp-server  
**GitHub Stars:** 0  
**npm Downloads (last month):** 584  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bitbucket-mcp-server

## Description
Provider-agnostic, AI-review-first MCP server for Bitbucket Cloud.

## Tools
Capabilities this server exposes over MCP:

- **get_current_user** — Authenticated user.
- **list_pull_requests** — List PRs (filter by state/query).
- **get_pull_request** — Fetch a PR by id.
- **create_pull_request** — Open a PR.
- **update_pull_request** — Edit an open PR title and/or description.
- **get_pull_request_diff** — Raw unified diff.
- **get_pull_request_files** — Changed files + line stats.
- **get_pull_request_comments** — PR comments.
- **comment_pull_request** — Add a (optionally inline) comment.
- **analyze_pull_request** — AI review returning a standard `ReviewResult`.

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

```json
"mcpServers": {
  "bitbucket-mcp-server": {
    "command": "npx",
    "args": ["-y","@droplinkperformance/bitbucket-mcp-server"],
    "env": {
      "MCP_TRANSPORT": "",
      "BITBUCKET_ACCESS_TOKEN": "",
      "BITBUCKET_EMAIL": "",
      "BITBUCKET_USERNAME": "",
      "BITBUCKET_CLIENT_ID": "",
      "BITBUCKET_CLIENT_SECRET": "",
      "BITBUCKET_DEFAULT_WORKSPACE": "",
      "LLM_PROVIDER": ""
    }
  }
}
```

**Requires environment variables:** `MCP_TRANSPORT`, `BITBUCKET_ACCESS_TOKEN`, `BITBUCKET_EMAIL`, `BITBUCKET_USERNAME`, `BITBUCKET_CLIENT_ID`, `BITBUCKET_CLIENT_SECRET`, `BITBUCKET_DEFAULT_WORKSPACE`, `LLM_PROVIDER` — 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 MCP server does

The bitbucket-mcp-server MCP server provides MCP tools for Bitbucket Cloud pull-request workflows. It can identify the authenticated user, list pull requests by state or query, retrieve a pull request, create or update an open pull request, and fetch its diff, changed files, line statistics, and comments.

Agents can also add regular or inline comments with `comment_pull_request`. The `analyze_pull_request` tool runs an AI review and returns a standard `ReviewResult`. The project describes AI review as its primary purpose rather than general CRUD access to Bitbucket.

Every tool accepts a `workspace` value, with `repository` used where relevant. A default workspace can be configured so callers do not need to provide it on every request.

## How it works

The bitbucket-mcp-server MCP server separates MCP adapters from application use cases and Bitbucket-specific repository code. Tool discovery is handled by a `ToolRegistry`, while the Bitbucket client manages authentication injection, pagination, retries, backoff, rate-limit handling, caching, and secret masking.

The review workflow uses a `CodeReviewAgent`. Large pull requests can be split into chunks according to file-count and diff-line thresholds before being sent to the configured language-model provider. Supported provider choices are OpenAI, Anthropic, Gemini, and Bedrock. Cache and token storage can use memory, files, or Redis, depending on configuration.

Two transports are available: stdio for local MCP clients and Streamable HTTP for remote or production deployments. The HTTP mode exposes `/health` and `/mcp` endpoints.

## Setup and configuration

Node.js 23 or newer is required. The published package can be started with:

```bash
npx -y @droplinkperformance/bitbucket-mcp-server
```

For a source checkout, install dependencies and build with `npm install` followed by `npm run build`. Configuration can be loaded from an environment file using Node's `--env-file` option.

Authentication depends on the credential type. Bearer access tokens use `BITBUCKET_ACCESS_TOKEN`; API tokens also require `BITBUCKET_EMAIL`; legacy app passwords use `BITBUCKET_USERNAME`. OAuth requires `BITBUCKET_CLIENT_ID` and `BITBUCKET_CLIENT_SECRET`, with an optional refresh-token seed for headless startup. `MCP_TRANSPORT` selects stdio or HTTP, while `HTTP_HOST` and `HTTP_PORT` control the HTTP listener.

## Tools and capabilities

- Identify the authenticated Bitbucket user.
- List, retrieve, create, and update pull requests.
- Retrieve unified diffs and changed-file statistics.
- Read pull-request comments and add inline or general comments.
- Analyze pull requests with a configured LLM provider.
- Use memory or Redis for caching, and file, memory, or Redis for token storage.

## Limitations and notes

The project is marked Phase 1. Bitbucket Cloud is the implemented SCM target; the provider-agnostic interfaces are intended to support other providers later, but those targets are not established here. Redis and Bedrock dependencies are optional and loaded only when their providers are selected. App-password authentication is described as legacy and supported until June 2026.

AI review requires a configured LLM provider and its corresponding credentials. OAuth token persistence depends on the selected token store. HTTP deployment requires the caller to connect to the configured host and port, while local clients such as Cursor and Claude Desktop can use the stdio transport.

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

