Bitbucket Server MCP
Provides tools for interacting with the Bitbucket Server API to manage pull requests, including creating, retrieving, merging, declining, commenting on, diffing, and reviewing PRs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bitbucket Server MCP Create a PR in repo web-app from feature/login to main titled Add login"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: Bitbucket MCP Server
Installation
Manual Installation
npm installBuild
npm run buildFeatures
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:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-server/build/index.js"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
// Authentication (choose one):
// Option 1: Personal Access Token
"BITBUCKET_TOKEN": "your-access-token",
// Option 2: Username/Password
"BITBUCKET_USERNAME": "your-username",
"BITBUCKET_PASSWORD": "your-password",
// Optional: Default project
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}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.
Available Tools
7 toolsadd_commentC
Add a comment to a pull request
Inputs: prId (required), text (required), repository (required), project, +1 more.
create_pull_requestC
Create a new pull request
Inputs: title (required), repository (required), sourceBranch (required), targetBranch (required), +3 more.
decline_pull_requestC
Decline a pull request
Inputs: prId (required), repository (required), message, project.
get_diffB
Get pull request diff
Inputs: prId (required), repository (required), project, contextLines.
get_pull_requestB
Get pull request details
Inputs: prId (required), repository (required), project.
get_reviewsC
Get pull request reviews
Inputs: prId (required), repository (required), project.
merge_pull_requestC
Merge a pull request
Inputs: prId (required), repository (required), message, project, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool maps to a distinct action on the pull request resource (create, get, merge, decline, diff, reviews, comment) with no overlapping verbs. The server is narrowly scoped to PRs, so even shorter names like get_diff and get_reviews are unambiguous in context.
All tools use snake_case verb_noun patterns, which is consistent and predictable. Minor deviation: three tools (add_comment, get_diff, get_reviews) omit the pull_request noun while the rest include it, creating slight asymmetry.
Seven tools is a well-scoped size for a PR-focused MCP server. Each tool covers a meaningful lifecycle operation and none appear redundant or trivial.
Core PR lifecycle actions are covered (create, get, merge, decline, diff, reviews, comment), but there is no list_pull_requests tool and no way to update or approve a PR or edit/delete comments. The inability to discover PRs is a notable gap that forces agents to work around the surface.
Maintenance
Related MCP Connectors
Read pull requests, builds and work items, and create work items or PR comments in Azure DevOps.
Read repositories, pull requests, issues and CI runs; create issues and comments in GitHub.
Assess pull requests and read verdicts, findings, evidence and suggested fixes from coding agents.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Related MCP Servers
- AlicenseAqualityAmaintenanceFacilitates interaction with Bitbucket Server for pull request management using the MCP protocol, supporting operations such as creating, merging, commenting, and reviewing pull requests.28161 npm70Apache 2.0
- AlicenseAqualityDmaintenanceEnables management of Bitbucket Cloud pull requests through natural language, including creating, reviewing, approving, and commenting on PRs with automatic default reviewer support.791MIT
- AlicenseAqualityDmaintenanceEnables retrieval of pull request metadata and diffs from Bitbucket Cloud and Server/Data Center, with optional comment creation.31MIT
- AlicenseBqualityCmaintenanceEnables interaction with Bitbucket Server/Data Center (Stash) for project and repository discovery, pull request management, code review, and code search.18MIT