The Bitbucket Server MCP server facilitates interaction with the Bitbucket Server API through the MCP protocol, enabling pull request management and integration tasks. You can:
Create new pull requests with customizable parameters (title, description, branches, reviewers)
Retrieve detailed information about specific pull requests
Merge pull requests with different strategies (merge-commit, squash, fast-forward)
Decline pull requests with a reason message
Add comments to pull requests, including replies
Get pull request diffs with configurable context lines
Fetch review history including approvals and reviews
Provides tools for managing Bitbucket Server pull requests, including creating, retrieving, merging, and declining PRs, adding comments, retrieving diffs, and managing reviews.
Bitbucket Server MCP
MCP (Model Context Protocol) server for Bitbucket Server Pull Request management. This server provides tools and resources to interact with the Bitbucket Server API through the MCP protocol.
Requirements
Node.js >= 16
Related MCP server: GitHub MCP Server
Installation
Installing via Smithery
To install Bitbucket Server for Claude Desktop automatically via Smithery:
Manual Installation
Build
Features
The server provides the following tools for Bitbucket Server integration:
create_pull_request
Creates a new pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugtitle(required): PR titledescription: PR descriptionsourceBranch(required): Source branch nametargetBranch(required): Target branch namereviewers: Array of reviewer usernames
get_pull_request
Retrieves detailed information about a specific pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request ID
merge_pull_request
Merges a pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request IDmessage: Merge commit messagestrategy: One of:merge-commit(default)squashfast-forward
decline_pull_request
Declines a pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request IDmessage: Reason for declining
add_comment
Adds a comment to a pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request IDtext(required): Comment textparentId: Parent comment ID for replies
get_diff
Retrieves the diff for a pull request.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request IDcontextLines: Number of context lines (default: 10)
get_reviews
Fetches the review history of a pull request, including approvals and reviews.
Parameters:
project: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository(required): Repository slugprId(required): Pull request ID
Dependencies
@modelcontextprotocol/sdk- SDK for MCP protocol implementationaxios- HTTP client for API requestswinston- Logging framework
Configuration
The server requires configuration in the VSCode MCP settings file. Here's a sample configuration:
Environment Variables
BITBUCKET_URL(required): Base URL of your Bitbucket Server instanceAuthentication (one of the following is required):
BITBUCKET_TOKEN: Personal access tokenBITBUCKET_USERNAMEandBITBUCKET_PASSWORD: Basic authentication credentials
BITBUCKET_DEFAULT_PROJECT: Default project key to use when not specified in tool calls
Logging
The server logs all operations to bitbucket.log using Winston for debugging and monitoring purposes.