
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A Model Context Protocol server that exposes tools and resources for interacting with the Bitbucket Server API to manage pull requests and related repository operations.
MCP server for Bitbucket Server pull request management is cataloged as an MCP server attributed to garc33. A Model Context Protocol server that exposes tools and resources for interacting with the Bitbucket Server API to manage pull requests and related repository operations. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for MCP server for Bitbucket Server pull request management are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, setting the BITBUCKET_READ_ONLY environment variable to true restricts the server to safe, non-modifying operations.
README.md · 3b061bc8c3ab · Fetched 2026-11-13 09:02:55 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
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.
BITBUCKET_CUSTOM_HEADERS environment variable (useful for Zero Trust tokens or proxies)list_pull_requests (fixes #14)list_branches, delete merged branches with delete_branchlist_commitsapprove_pull_request and unapprove_pull_requestsearch toolget_file_content and browse_repositoryget_comments toollist_projectslist_repositoriesBITBUCKET_DEFAULT_PROJECTTo install Bitbucket Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude
The server is published on npm as @garc33/bitbucket-server-mcp-server. You can run it directly with npx:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@garc33/bitbucket-server-mcp-server"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token"
}
}
}
}
Or install it globally and use the bitbucket-server-mcp command:
npm install -g @garc33/bitbucket-server-mcp-server
npm install
npm run build
The server provides the following tools for comprehensive Bitbucket Server integration:
list_projectsDiscover and explore Bitbucket projects: Lists all accessible projects with their details. Essential for project discovery and finding the correct project keys to use in other operations.
Use cases:
Parameters:
limit: Number of projects to return (default: 25, max: 1000)start: Start index for pagination (default: 0)list_repositoriesBrowse and discover repositories: Explore repositories within specific projects or across all accessible projects. Returns comprehensive repository information including clone URLs and metadata.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)limit: Number of repositories to return (default: 25, max: 1000)start: Start index for pagination (default: 0)create_pull_requestPropose code changes for review: Creates a new pull request to submit code changes, request reviews, or merge feature branches. Automatically handles branch references and reviewer assignments.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugtitle (required): Clear, descriptive PR titledescription: Detailed description with context (supports Markdown)sourceBranch (required): Source branch containing changestargetBranch (required): Target branch for mergingreviewers: Array of reviewer usernamessourceProject: Project key of the source repository (for cross-repo PRs from forks)sourceRepository: Slug of the source repository (for cross-repo PRs from forks)includeDefaultReviewers: Automatically fetch and include default reviewers configured for the target branch (default: true)update_pull_requestSafely update a pull request: Modify the title, description, or reviewers of an existing pull request without losing any metadata. Uses a read-modify-write pattern to preserve all fields not explicitly changed.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request ID to updatetitle: New title (if omitted, current title is preserved)description: New description (if omitted, current description is preserved)reviewers: New reviewer list as array of usernames (if omitted, current reviewers are preserved)get_pull_requestComprehensive PR information: Retrieves detailed pull request information including status, reviewers, commits, and all metadata. Essential for understanding PR state before taking actions.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDget_build_statusRead build states and CI build URLs, including Jenkins links, for a commit. Uses the existing Bitbucket credentials and supports read-only mode.
Parameters:
commitHash (required): Full 40-character commit hash; use the PR's fromRef.latestCommit.limit: Statuses per page (default: 25, max: 100).start: Page offset (default: 0); use nextPageStart to fetch the next page.Calls GET /rest/build-status/1.0/commits/{commitHash} and returns the
Bitbucket response, including each build's state and url. An empty list
means no build statuses are recorded. API/authentication failures are reported
as errors, not empty lists.
After rebuilding a local installation with npm run build, restart its MCP
connection in your client to discover the new tool. No credential changes are needed.
merge_pull_requestIntegrate approved changes: Merges an approved pull request into the target branch. Supports different merge strategies based on your workflow preferences.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDmessage: Custom merge commit messagestrategy: Merge strategy:
merge-commit (default): Creates merge commit preserving historysquash: Combines all commits into onefast-forward: Moves branch pointer without merge commitdecline_pull_requestReject unsuitable changes: Declines a pull request that should not be merged, providing feedback to the author.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDmessage: Reason for declining (helpful for author feedback)add_commentParticipate in code review: Adds comments to pull requests for review feedback, discussions, and collaboration. Supports threaded conversations.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDtext (required): Comment content (supports Markdown)parentId: Parent comment ID for threaded repliesstate: Comment state: OPEN (default, published immediately) or PENDING (draft, visible only to you until review is published)get_diffAnalyze code changes: Retrieves the code differences showing exactly what was added, removed, or modified in the pull request. Supports per-file truncation to manage large diffs effectively.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDcontextLines: Context lines around changes (default: 10)maxLinesPerFile: Maximum lines to show per file (optional, uses BITBUCKET_DIFF_MAX_LINES_PER_FILE env var if not specified, set to 0 for no limit)Large File Handling:
When a file exceeds the maxLinesPerFile limit, it shows:
get_reviewsTrack review progress: Fetches review history, approval status, and reviewer feedback to understand the review state.
Use cases:
get_activitiesRetrieve pull request activities: Gets the complete activity timeline for a pull request including comments, reviews, commits, and other events.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDget_commentsExtract PR comments only: Filters pull request activities to return only the comments, making it easier to focus on discussion content without reviews or other activities.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDsearchAdvanced code and file search: Search across repositories using the Bitbucket search API with support for project/repository filtering and query optimization. Searches both file contents and filenames. Note: Search only works on the default branch of repositories.
Use cases:
Parameters:
query (required): Search query stringproject: Bitbucket project key to limit search scoperepository: Repository slug for repository-specific searchtype: Query optimization - "file" (wraps query in quotes for exact filename matching) or "code" (default search behavior)limit: Number of results to return (default: 25, max: 100)start: Start index for pagination (default: 0)Query syntax examples:
"README.md" - Find exact filenameconfig ext:yml - Find config in YAML filesfunction project:MYPROJECT - Search for "function" in specific projectbug fix repo:PROJ/my-repo - Search in specific repositoryget_file_contentRead file contents with pagination: Retrieve the content of specific files from repositories with support for large files through pagination.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugfilePath (required): Path to the file in the repositorybranch: Branch or commit hash (optional, defaults to main/master)limit: Maximum lines per request (default: 100, max: 1000)start: Starting line number for pagination (default: 0)browse_repositoryExplore repository structure: Browse files and directories in repositories to understand project organization and locate specific files.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugpath: Directory path to browse (optional, defaults to root)branch: Branch or commit hash (optional, defaults to main/master)limit: Maximum items to return (default: 50)list_pull_requestsDiscover and filter pull requests: List pull requests in a repository with filtering by state, author, and direction. Returns PR metadata including title, author, branches, reviewers, and status.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugstate: Filter by PR state — OPEN (default), MERGED, DECLINED, or ALLauthor: Filter by author username (exact match)direction: INCOMING (PRs targeting this repo, default) or OUTGOING (PRs from this repo)limit: Number of PRs to return (default: 25, max: 1000)start: Start index for pagination (default: 0)list_branchesExplore repository branches: List branches in a repository with optional filtering. Identifies the default branch and shows latest commit information for each branch.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugfilterText: Filter branches by name (case-insensitive partial match)limit: Number of branches to return (default: 25, max: 1000)start: Start index for pagination (default: 0)list_commitsBrowse commit history: List commits in a repository with optional branch and author filtering. Use this to review changes, track contributions, or understand the evolution of a branch.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugbranch: Branch name to list commits from (defaults to the repository's default branch)author: Filter by author name or email (case-insensitive partial match, applied client-side)limit: Number of commits to return (default: 25, max: 1000)start: Start index for pagination (default: 0)delete_branchClean up merged branches: Delete a branch from a repository. Includes a safety check to prevent deletion of the default branch.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugbranch (required): Branch name to deleteapprove_pull_requestApprove code changes: Approve a pull request as the current authenticated user. Records your approval on the PR, signaling that changes are ready to merge.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request ID to approveunapprove_pull_requestRetract approval: Remove your approval from a pull request. Use this when you need to retract a previous approval after discovering issues or when the PR has changed.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request ID to remove approval fromedit_commentEdit an existing comment: Modify the text of a comment on a pull request. Works with both published and pending (draft) comments. Requires the comment version for optimistic locking.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request ID the comment belongs tocommentId (required): ID of the comment to edittext (required): New text content (supports Markdown)version (required): Current version of the comment for optimistic locking (from get_comments or add_comment response)delete_commentDelete a comment: Remove a comment from a pull request. Requires the comment version for optimistic locking.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request ID the comment belongs tocommentId (required): ID of the comment to deleteversion (required): Current version of the comment for optimistic lockingpublish_reviewPublish a batch review: Publish all pending (draft) comments at once, optionally setting your review status and adding an overview comment. This is the equivalent of clicking "Finish review" in the Bitbucket UI.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDcommentText: Optional overview comment for the reviewparticipantStatus: Optional review status: APPROVED (ready to merge) or NEEDS_WORK (changes required). Omit for general feedback.get_code_insightsRetrieve CI/CD analysis results: Fetch Code Insights reports (SonarQube, security scans, etc.) and their annotations for a pull request.
Use cases:
Parameters:
project: Bitbucket project key (optional, uses BITBUCKET_DEFAULT_PROJECT if not provided)repository (required): Repository slugprId (required): Pull request IDget_dashboard_pull_requestsCross-repository PR dashboard: List pull requests across all repositories for the authenticated user. Use this to see PRs you need to review, PRs you authored, or PRs you are participating in, without needing to specify each project and repository.
Use cases:
Parameters:
state: Filter by PR state: OPEN (default), MERGED, DECLINED, or ALLrole: Filter by your role: AUTHOR, REVIEWER, or PARTICIPANTparticipantStatus: Filter by your review status: APPROVED, UNAPPROVED, or NEEDS_WORKorder: Sort order: OLDEST or NEWEST (default)closedSince: Only include closed PRs updated after this timestamp (epoch ms)limit: Number of PRs to return (default: 25)start: Start index for pagination (default: 0)# List all accessible projects
list_projects
# List repositories in the default project (if BITBUCKET_DEFAULT_PROJECT is set)
list_repositories
# List repositories in a specific project
list_repositories --project "MYPROJECT"
# List projects with pagination
list_projects --limit 10 --start 0
# Search for README files across all projects
search --query "README" --type "file" --limit 10
# Search for specific code patterns in a project
search --query "function getUserData" --type "code" --project "MYPROJECT"
# Search with file extension filter
search --query "config ext:yml" --project "MYPROJECT"
# Browse repository structure
browse_repository --project "MYPROJECT" --repository "my-repo"
# Browse specific directory
browse_repository --project "MYPROJECT" --repository "my-repo" --path "src/components"
# Read file contents
get_file_content --project "MYPROJECT" --repository "my-repo" --filePath "package.json" --limit 20
# Read specific lines from a large file
get_file_content --project "MYPROJECT" --repository "my-repo" --filePath "docs/CHANGELOG.md" --start 100 --limit 50
# Create a pull request (using default project)
create_pull_request --repository "my-repo" --title "Feature: New functionality" --sourceBranch "feature/new-feature" --targetBranch "main"
# Create a pull request with specific project
create_pull_request --project "MYPROJECT" --repository "my-repo" --title "Bugfix: Critical issue" --sourceBranch "bugfix/critical" --targetBranch "develop" --description "Fixes critical issue #123"
# Get pull request details
get_pull_request --repository "my-repo" --prId 123
# Get only comments from a PR (no reviews/commits)
get_comments --project "MYPROJECT" --repository "my-repo" --prId 123
# Get full PR activity timeline
get_activities --repository "my-repo" --prId 123
# Merge a pull request with squash strategy
merge_pull_request --repository "my-repo" --prId 123 --strategy "squash" --message "Feature: New functionality (#123)"
# List open PRs in a repository (default state: OPEN)
list_pull_requests --repository "my-repo"
# List all PRs regardless of state
list_pull_requests --repository "my-repo" --state "ALL"
# Find PRs by a specific author
list_pull_requests --repository "my-repo" --author "john.doe"
# List merged PRs with pagination
list_pull_requests --repository "my-repo" --state "MERGED" --limit 10 --start 0
# List all branches in a repository
list_branches --repository "my-repo"
# Filter branches by name
list_branches --project "MYPROJECT" --repository "my-repo" --filterText "feature"
# Delete a merged branch
delete_branch --repository "my-repo" --branch "feature/completed-work"
# List recent commits on the default branch
list_commits --repository "my-repo"
# List commits on a specific branch
list_commits --repository "my-repo" --branch "develop" --limit 10
# Filter commits by author
list_commits --repository "my-repo" --author "john.doe"
# Combine branch and author filters
list_commits --project "MYPROJECT" --repository "my-repo" --branch "main" --author "jane"
# Approve a pull request
approve_pull_request --repository "my-repo" --prId 123
# Remove your approval
unapprove_pull_request --repository "my-repo" --prId 123
# Full workflow: review diff, approve, merge
get_diff --repository "my-repo" --prId 123
approve_pull_request --repository "my-repo" --prId 123
merge_pull_request --repository "my-repo" --prId 123 --strategy "squash"
@modelcontextprotocol/sdk - SDK for MCP protocol implementationaxios - HTTP client for API requestswinston - Logging frameworkThe 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"
}
}
}
}
BITBUCKET_URL (required): Base URL of your Bitbucket Server instanceBITBUCKET_TOKEN: Personal access tokenBITBUCKET_USERNAME and BITBUCKET_PASSWORD: Basic authentication credentialsBITBUCKET_DEFAULT_PROJECT (optional): Default project key to use when not specified in tool callsBITBUCKET_DIFF_MAX_LINES_PER_FILE (optional): Default maximum lines to show per file in diffs. Set to prevent large files from overwhelming output. Can be overridden by the maxLinesPerFile parameter in get_diff calls.BITBUCKET_LOG_PATH (optional): Custom path for the log file (default: ~/.bitbucket-server-mcp/bitbucket.log)BITBUCKET_READ_ONLY (optional): Set to true to enable read-only modeBITBUCKET_CUSTOM_HEADERS (optional): Comma-separated list of custom HTTP headers to add to all requests (format: Header-Name=value,Another-Header=value2). Useful for Zero Trust tokens or proxy headersNote: With the new optional project support, you can now:
BITBUCKET_DEFAULT_PROJECT to work with a specific project by defaultlist_projects to discover available projectslist_repositories to browse repositories across projectsproject parameter in any tool callThe server supports a read-only mode for deployments where you want to prevent any modifications to your Bitbucket repositories. When enabled, only safe, non-modifying operations are available.
To enable read-only mode: Set the environment variable BITBUCKET_READ_ONLY=true
Available tools in read-only mode:
list_projects - Browse and list projectslist_repositories - Browse and list repositoriesget_pull_request - View pull request detailslist_pull_requests - List and filter pull requestsget_diff - View code changes and diffsget_reviews - View review history and statusget_activities - View pull request timelineget_comments - View pull request commentssearch - Search code and files across repositoriesget_file_content - Read file contentsbrowse_repository - Browse repository structurelist_branches - List repository brancheslist_commits - Browse commit historyget_code_insights - Retrieve CI/CD analysis reports and annotationsget_dashboard_pull_requests - List PRs across all repositories for the authenticated userDisabled tools in read-only mode:
create_pull_request - Creating new pull requestsupdate_pull_request - Updating pull request title, description, or reviewersmerge_pull_request - Merging pull requestsdecline_pull_request - Declining pull requestsadd_comment - Adding comments to pull requestsadd_comment_inline - Adding inline comments to pull requestsedit_comment - Editing existing commentsdelete_comment - Deleting commentspublish_review - Publishing batch reviewsdelete_branch - Deleting branchesapprove_pull_request - Approving pull requestsunapprove_pull_request - Removing PR approvalsBehavior:
BITBUCKET_READ_ONLY is not set or set to any value other than true, all tools function normally (backward compatible)BITBUCKET_READ_ONLY=true, write operations are filtered out and will return an error if calledThe server logs all operations using Winston for debugging and monitoring purposes.
Log file location (in order of priority):
BITBUCKET_LOG_PATH environment variable — custom path~/.bitbucket-server-mcp/bitbucket.log — default locationThe log directory is created automatically if it doesn't exist.
Example: Set a custom log path in your MCP configuration:
{
"env": {
"BITBUCKET_LOG_PATH": "/var/log/bitbucket-mcp/server.log"
}
}
You can add custom HTTP headers to all API requests using the BITBUCKET_CUSTOM_HEADERS environment variable. This is useful for Zero Trust security tokens, proxy headers, or any other headers required by your infrastructure.
Format: Comma-separated key-value pairs where values can contain equals signs:
Header-Name=value,Another-Header=value2
Single header example:
{
"env": {
"BITBUCKET_CUSTOM_HEADERS": "X-Zero-Trust-Token=your-token-here"
}
}
Multiple headers example:
{
"env": {
"BITBUCKET_CUSTOM_HEADERS": "X-Custom-Header=value1,X-Proxy-Auth=token123"
}
}
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for MCP server for Bitbucket Server pull request management from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/bitbucket-server-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.