Skip to main content
Glama
Upendrasengar

bitbucket-server-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BITBUCKET_URLYesBase URL of your Bitbucket Server instance
BITBUCKET_TOKENNoPersonal access token
BITBUCKET_PASSWORDNoPassword for basic auth
BITBUCKET_USERNAMENoUsername for basic auth
BITBUCKET_CACHE_TTLNoCache duration in seconds (default: 300). Set to 0 to disable caching.
BITBUCKET_READ_ONLYNoSet to true to disable all write operations
BITBUCKET_ENABLED_TOOLSNoComma-separated list of tool names to enable. If not set, all tools are available.
BITBUCKET_CUSTOM_HEADERSNoExtra headers for all requests (Key=Value,Key2=Value2)
BITBUCKET_DEFAULT_PROJECTNoDefault project key when not specified in tool calls
BITBUCKET_STARTUP_HEALTHCHECKNoSet to true to run a connectivity check against Bitbucket on startup (default: false).
BITBUCKET_DIFF_MAX_LINES_PER_FILENoMax lines per file in diffs. Set to 0 for no limit.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_projectsA

List all Bitbucket projects you have access to. Use this first to discover project keys. Supports custom field selection via the fields param ('*all' for full raw response, 'key,name' for a custom subset).

list_repositoriesA

List repositories in a project. Use this to find repository slugs for other operations. Supports custom field selection via the fields param ('*all' for full raw response, 'slug,name' for a custom subset).

browse_repositoryC

Browse files and directories in a repository to understand project structure.

get_file_contentA

Read file contents from a repository with pagination support for large files.

upload_attachmentB

Upload a file attachment to a repository. Returns a markdown reference to embed in PR comments or descriptions.

edit_fileA

Edit a file in a repository by committing a new version via the Bitbucket REST API. Returns the commit metadata.

get_file_blameA

Get blame/history information for a file. Returns line-by-line commit authorship data.

create_repositoryB

Create a new repository in a project.

delete_repositoryA

Delete a repository. This action is irreversible.

list_forksA

List forks of a repository. Supports custom field selection via the fields param ('*all' for full raw response, 'slug,name' for a custom subset).

fork_repositoryA

Fork a repository into a target project. Creates a copy of the source repository in the specified target project.

list_branch_restrictionsA

List branch restrictions for a repository. These control which users/groups can push to or delete specific branches or branch patterns.

list_branchesA

List branches in a repository. Also returns the default branch when available. Supports custom field selection via the fields param ('*all' for full raw response, 'displayId,latestCommit' for a custom subset).

list_commitsA

List commits in a repository, optionally filtered by branch and author. Supports custom field selection via the fields param ('*all' for full raw response, 'id,message,author.name' for a custom subset).

manage_branchesA

Manage branches in a repository. Actions: "create" (create a new branch), "delete" (delete a branch). Refuses to delete the default branch.

get_commitA

Get details of a specific commit by its ID. Supports custom field selection via the fields param ('*all' for full raw response, 'id,message,author.name' for a custom subset).

compare_refsA

Compare two refs and list commits accessible from to but not from from. Supports custom field selection via the fields param ('*all' for full raw response, 'id,message,author.name' for a custom subset).

list_tagsA

List tags in a repository. Supports custom field selection via the fields param ('*all' for full raw response, 'id,displayId,hash' for a custom subset).

get_tagA

Get details of a specific tag by its name. Supports custom field selection via the fields param ('*all' for full raw response, 'id,displayId,hash' for a custom subset).

manage_tagsB

Manage tags in a repository. Actions: "create" (create a new tag pointing to a commit), "delete" (delete a tag by name).

create_pull_requestA

Create a new pull request. Supports cross-repo PRs via sourceProject/sourceRepository and automatic default reviewer merging.

get_pull_requestA

Get details of a specific pull request including status, reviewers, and metadata. Supports custom field selection via the fields param ('*all' for full raw response, 'id,title,state' for a custom subset).

update_pull_requestA

Update a pull request (title, description, target branch, or reviewers). Only changed fields are applied; reviewers are preserved if not provided.

merge_pull_requestA

Merge an approved pull request. Fetches the current version automatically for optimistic locking.

decline_pull_requestA

Decline a pull request. Fetches the current version automatically for optimistic locking.

list_pull_requestsA

List pull requests in a repository. Supports filtering by state, direction, order, and client-side author filtering. Supports custom field selection via the fields param ('*all' for full raw response, 'id,title,state' for a custom subset).

list_dashboard_pull_requestsA

Get pull requests from the authenticated user dashboard. No project/repo needed. Supports custom field selection via the fields param ('*all' for full raw response, 'id,title,state' for a custom subset).

get_pull_request_activityA

Get activity feed for a pull request. Optionally filter to only reviews or comments.

get_diffA

Get the diff of a pull request. Use stat=true for a lightweight summary of changed files (and line counts if the server supports it) instead of the full diff.

get_pull_request_commitsA

List commits for a specific pull request. Returns the commits that are part of the pull request with pagination support.

get_commit_pull_requestsA

List pull requests that contain a specific commit. Returns the PRs that include the given commit.

manage_commentA

Manage pull request comments. Actions: "create" (general, inline, threaded, or tasks), "edit" (update text/severity/state/threadResolved), "delete", "react" (add emoji reaction), "unreact" (remove reaction). state: RESOLVED toggles the task checkbox on a BLOCKER comment; threadResolved: true closes the conversation (the "Resolve" button in the UI). They are independent and can be passed together.

search_emoticonsA

Search available emoticons for comment reactions. Returns matching shortcut names to use with manage_comment react/unreact.

manage_reviewA

Approve, unapprove, or publish a review on a pull request. Use "approve" to approve, "unapprove" to remove your approval, and "publish" to submit a review with an optional overview comment and status.

searchA

Search for code or files across Bitbucket repositories. Supports filtering by project, repository, and search type. Supports custom field selection via the fields param ('*all' for full raw response, 'file,hitCount' for a custom subset).

get_code_insightsA

Get code insight reports and their annotations for a pull request. Shows build results, code quality, and other analysis.

get_build_statusA

Get CI build status for a commit or pull request. When prId is provided, automatically resolves the latest commit. Returns build state (SUCCESSFUL, FAILED, INPROGRESS), name, and URL to the CI build.

get_server_infoA

Get Bitbucket Server version and properties. Useful to check connectivity and server version.

list_default_reviewer_conditionsA

List default reviewer conditions for a repository. These conditions determine which users are automatically added as reviewers to pull requests.

get_user_profileA

Get a Bitbucket user profile by user slug. Returns user details including display name, email, and active status.

search_usersA

Search Bitbucket users by filter query. Returns matching users.

list_labelsB

List labels for a repository.

manage_labelsB

Manage repository labels. Actions: "add" (create a new label), "remove" (delete a label).

list_webhooksA

List webhooks configured for a repository.

manage_webhooksC

Manage repository webhooks. Actions: "create" (add a new webhook), "update" (modify an existing webhook), "delete" (remove a webhook).

list_commit_commentsA

Get comments for a specific commit. Returns all comments on the commit with pagination support.

manage_commit_commentsC

Manage comments on a commit. Actions: "create" (add a new comment), "edit" (update an existing comment), "delete" (remove a comment).

list_repository_hooksA

List repository hooks and their enabled/disabled state.

manage_repository_hooksA

Manage repository hook settings. Actions: "enable" (enable a hook), "disable" (disable a hook), "configure" (set hook settings).

list_merge_checksA

List merge check configurations for a repository. Merge checks control conditions that must be met before a pull request can be merged.

manage_merge_checksB

Configure merge check settings for a repository.

list_reviewer_groupsA

List reviewer groups configured for a repository.

manage_reviewer_groupsC

Manage reviewer groups for a repository. Actions: "create" (create a group), "delete" (remove a group).

list_secret_scanning_rulesA

List secret scanning allowlist rules for a repository. Requires Bitbucket Server 8.5+.

list_ssh_keysA

List SSH keys for the authenticated user.

manage_ssh_keysA

Manage SSH keys for the authenticated user. Actions: "add" (add a key), "delete" (remove a key).

list_gpg_keysA

List GPG keys for the authenticated user.

manage_gpg_keysB

Manage GPG keys for the authenticated user. Actions: "add" (add a key), "delete" (remove a key).

manage_deploymentsA

Manage deployments for a commit. Actions: "get" (retrieve a deployment), "create" (record a new deployment), "delete" (remove a deployment). GET requires key, environmentKey, and deploymentSequenceNumber. POST body requires deploymentSequenceNumber, description, displayName, environment (with displayName, key, optional type), key, state, and optional url. DELETE requires key, environmentKey, and deploymentSequenceNumber.

Prompts

Interactive templates invoked by user choice

NameDescription
review-prStep-by-step workflow for reviewing a Bitbucket pull request.

Resources

Contextual data attached and managed by the client

NameDescription
projectsList of all accessible Bitbucket projects with their keys and names
schema-fieldsEntity types available for the fields param
schema-prAvailable fields for pr
schema-projectAvailable fields for project
schema-repoAvailable fields for repo
schema-branchAvailable fields for branch
schema-commitAvailable fields for commit

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Upendrasengar/bitbucket-server-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server