bitbucket-mcp-server
Provides read-only access to Bitbucket Server resources including projects, repositories, branches, commits, pull requests, and code search.
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-mcp-server Show me my pending pull request reviews."
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 MCP Server (Custom, Read-Only)
A custom MCP server for Bitbucket Server that exposes only read-only operations.
Built with the official @modelcontextprotocol/sdk — no third-party Bitbucket MCP packages.
Tools
Tool | Description |
| Get user profile by username |
| List users with optional filter |
| List visible projects |
| List repos in a project |
| Get repo details |
| Get default branch of a repo |
| List branches |
| List tags |
| Browse files/directories |
| Get raw file content |
| List commits |
| Get commit details |
| Get diff for a commit |
| Get PRs in your review inbox |
| List PRs for a repo |
| Get full PR details |
| Get changed files in a PR |
| Get PR diff (full or per-file) |
| Get structured file diff |
| Get PR activity feed |
| Get PR commits |
| Check PR merge preconditions |
| Get PR tasks/blockers |
| Search code across repos |
Related MCP server: stash-mcp
Setup
npm install
npm run buildEnvironment Variables
Variable | Required | Description |
| Yes | Your Bitbucket Server URL (e.g., |
| Yes | Personal access token with read permissions |
MCP Configuration
Add to ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/absolute/path/to/bitbucket-mcp-server/dist/index.js"],
"env": {
"BITBUCKET_URL": "https://bitbucket.example.com",
"BITBUCKET_TOKEN": "your-token-here"
}
}
}
}Available Tools
24 toolsbrowse_filesC
Browse files/directories in a repository at a given path and ref.
Inputs: projectKey (required), repositorySlug (required), at, path, +2 more.
get_all_usersA
Retrieve a page of users, optionally filtered by search term
Inputs: filter.
get_commitA
Get details of a specific commit.
Inputs: commitId (required), projectKey (required), repositorySlug (required).
get_commit_diffA
Get the diff for a specific commit.
Inputs: commitId (required), projectKey (required), repositorySlug (required), contextLines.
get_default_branchB
Get the default branch of a repository.
Inputs: projectKey (required), repositorySlug (required).
get_file_contentC
Get the raw content of a file in a repository.
Inputs: path (required), projectKey (required), repositorySlug (required), at.
get_inbox_pull_requestsA
Returns pull requests in the authenticated user's inbox where they are assigned as a reviewer.
Inputs: limit, start.
get_pull_requestA
Get full details for a pull request including title, description, author, state, branches, reviewers, and participants.
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required).
get_pull_request_activitiesC
Get activity on a pull request including comments, approvals, merges, reviews, and updates. Can filter by activity types.
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required), limit, +1 more.
get_pull_request_changesA
Get list of all changed files in a pull request with file-level metadata (paths, change types like ADD/MODIFY/DELETE).
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required), limit.
get_pull_request_commitsB
Get the commits for a pull request.
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required), limit, +1 more.
get_pull_request_diffB
Get diff for a pull request. Omit path for full PR diff, or specify a file path for a specific file. Supports text and JSON formats.
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required), path, +5 more.
get_pull_request_file_diffA
Get structured line-by-line diff for a specific file in a pull request. Returns JSON with hunks, segments, and exact line numbers.
Inputs: path (required), projectKey (required), pullRequestId (required), repositorySlug (required), +1 more.
get_pull_request_merge_statusC
Check if a pull request can be merged (merge preconditions).
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required).
get_pull_request_tasksB
Get tasks/blockers on a pull request.
Inputs: projectKey (required), pullRequestId (required), repositorySlug (required), limit, +1 more.
get_repositoryB
Get details of a specific repository.
Inputs: projectKey (required), repositorySlug (required).
get_user_profileA
Get Bitbucket Server user profile by username
Inputs: username (required).
list_branchesB
List branches for a repository.
Inputs: projectKey (required), repositorySlug (required), limit, start, +1 more.
list_commitsC
List commits for a repository, optionally filtered by branch/tag/commit.
Inputs: projectKey (required), repositorySlug (required), path, limit, +3 more.
list_projectsA
List projects visible to the authenticated user. Can filter by name or permission.
Inputs: name, limit, start, permission.
list_pull_requestsA
List pull requests for a repository. Can filter by state, direction, and branch.
Inputs: projectKey (required), repositorySlug (required), at, limit, +3 more.
list_repositoriesB
List all repositories in a Bitbucket Server project
Inputs: projectKey (required).
list_tagsC
List tags for a repository.
Inputs: projectKey (required), repositorySlug (required), limit, start, +1 more.
search_codeB
Search for code across repositories.
Inputs: query (required), limit, start, projectKey, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools clearly target distinct resources or specific aspects (e.g., PR activities vs. commits). The only real ambiguity is between get_pull_request_diff and get_pull_request_file_diff, which both involve diffs but with different output structures, so an agent could be unsure which to use.
The naming pattern is largely consistent, using get_ for single items and list_ for collections. However, get_inbox_pull_requests and get_all_users are list operations that use get_ instead of list_, which is a minor deviation from the dominant verb convention.
With 24 tools, this server is on the heavy side, fitting the borderline range of 16-25. The count is driven by 10 pull-request-related tools, which feel numerous even though each has a distinct purpose. A more consolidated set would be more appropriate.
The server is entirely read-only, lacking any create, update, delete, merge, or comment capabilities for repositories or pull requests. This is a significant gap for a Bitbucket integration, preventing agents from completing common lifecycle workflows like approving or merging a PR.
Related MCP Connectors
Provides read access to your GKE and Kubernetes resources.
Read-only access to your CodeMouse accounts, repositories, and AI pull-request reviews.
Read-only delivery, dispatch, route and fleet tools for Lastmile workspaces.
Read-only access to your Infrly services, deploys, logs, metrics and billing.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables retrieval of pull request metadata and diffs from Bitbucket Cloud and Server/Data Center, with optional comment creation.31MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Bitbucket Server/Data Center (Stash) for project and repository discovery, pull request management, code review, and code search.10 npmMIT
- AlicenseBqualityCmaintenanceA read-only MCP server that provides secure access to Bitbucket repositories, pull requests, issues, and more.38129 npm3MIT
- FlicenseNot gradedqualityCmaintenanceExposes Bitbucket Cloud repository and pull request data as tools consumable by any MCP-compatible client, with per-request authentication via the caller's own Bitbucket API token.-