Skip to main content
Glama
bitbucket-mcp-server

bitbucket-mcp-server

by phpl

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

Get user profile by username

get_all_users

List users with optional filter

list_projects

List visible projects

list_repositories

List repos in a project

get_repository

Get repo details

get_default_branch

Get default branch of a repo

list_branches

List branches

list_tags

List tags

browse_files

Browse files/directories

get_file_content

Get raw file content

list_commits

List commits

get_commit

Get commit details

get_commit_diff

Get diff for a commit

get_inbox_pull_requests

Get PRs in your review inbox

list_pull_requests

List PRs for a repo

get_pull_request

Get full PR details

get_pull_request_changes

Get changed files in a PR

get_pull_request_diff

Get PR diff (full or per-file)

get_pull_request_file_diff

Get structured file diff

get_pull_request_activities

Get PR activity feed

get_pull_request_commits

Get PR commits

get_pull_request_merge_status

Check PR merge preconditions

get_pull_request_tasks

Get PR tasks/blockers

search_code

Search code across repos

Related MCP server: stash-mcp

Setup

npm install
npm run build

Environment Variables

Variable

Required

Description

BITBUCKET_URL

Yes

Your Bitbucket Server URL (e.g., https://bitbucket.example.com)

BITBUCKET_TOKEN

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 tools
browse_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

    B3.2/5.0

    Scored across 24 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness2/5

    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

    Related MCP Servers