Bitbucket MCP

v0.2.0
io.github.adarshba/bitbucket-mcp Checked 12 hours ago Published 21 hours ago

Bitbucket MCP for Data Center: PR review with multi-line comments, plus Code Mode over the REST API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_pull_request Get pull request

Get a pull request with reviewers, merge checks, auto-merge state, open tasks, comment threads and your pending review comments.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug

list_pull_requests List pull requests

List pull requests in a repository, or across all repositories on your dashboard when project and repository are omitted.

ParameterTypeDescription
draftbooleanOnly drafts (true) or only ready PRs (false); repository listing only
filter_textstringMatch title or description; repository listing only
limitinteger
projectstringProject key; omit with repository to list your dashboard across all repositories
repositorystringRepository slug
rolestringYour role; dashboard listing only
startinteger
statestring

get_pull_request_diff Get pull request diff

Get a pull request's unified diff as raw text, optionally for one file.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
context_linesinteger
fullbooleanReturn the whole diff even when large; otherwise a large diff returns a per-file summary
ignore_whitespaceboolean
pathstringLimit the diff to one file path

create_pull_request Create pull request

Create a pull request, optionally as a draft.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
repository *stringRepository slug
source_branch *stringBranch name or full ref
target_branch *stringBranch name or full ref
title *string
descriptionstring
draftbooleanCreate as draft (DC 8.18+)
reviewersarrayReviewer usernames
source_projectstringFork project key when the source branch lives in a fork
source_repositorystringFork repository slug

update_pull_request Update pull request

Update a pull request's title, description, target branch, reviewers or draft state. Omitted fields are kept.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
descriptionstring
draftbooleanMark as draft or ready for review (DC 8.18+)
reviewersarrayReplaces the reviewer list
target_branchstring
titlestring

merge_pull_request Merge pull request

Merge a pull request now, or with auto_merge once its merge checks pass.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
auto_mergebooleanMerge automatically once checks pass instead of now (DC 8.15+)
messagestringMerge commit message
strategystringMerge strategy ID, e.g. no-ff, squash, rebase-no-ff

add_comment Add comment

Comment on a pull request: general, reply (parent_id), file (path), inline (path, line, line_type) or a multi-line range (start_line, DC 9.2+). Optional suggestion block, BLOCKER task, or pending draft-review comment.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
text *stringMarkdown comment text
lineintegerLine for an inline comment; the last line of a range
line_typestringDiff segment of line; required with line
parent_idintegerReply to this comment
pathstringFile path for a file or inline comment
pendingbooleanAdd to your draft review; publish with submit_review
severitystringBLOCKER creates a task
start_lineintegerFirst line of a multi-line range (DC 9.2+)
start_line_typestringDiff segment of start_line; defaults to line_type
suggestionstringReplacement code for the anchored line(s), sent as a suggestion block

manage_comment Manage comment

Edit, delete, resolve or reopen a thread or task, apply a suggestion, or add or remove a reaction on a pull request comment.

ParameterTypeDescription
action *string
comment_id *integer
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
commit_messagestringCommit message; apply_suggestion only
emoticonstringReaction name, e.g. thumbsup; react and unreact only
suggestion_indexintegerWhich suggestion block to apply
textstringNew text; edit only

submit_review Submit review

Publish your pending review comments with an optional status (approved, needs_work, unapproved) and summary comment, or discard them.

ParameterTypeDescription
project *stringProject key, e.g. PROJ (use ~user for a personal project)
pull_request_id *integerPull request ID
repository *stringRepository slug
actionstring
commentstringOverall review comment; publish only
statusstringYour review status; publish only

execute Execute REST API code

Execute JavaScript that calls the Bitbucket Data Center REST API through bitbucket.request(). Use search first to find endpoints. Available in your code: type BitbucketRequest = { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; path: string; // starts with /rest/, e.g. /rest/api/latest/projects/PROJ/repos/app/branches query?: Record<string, string | number | boolean>; body?: unknown; // sent as JSON accept?: string; // defaults to application/json; use text/plain for raw diffs and file content }; // Paged GET responses: { values: T[], size, limit, isLastPage, start, nextPageS…

ParameterTypeDescription
code *stringJavaScript async arrow function to execute
truncatebooleanCap the result at ~6,000 tokens (default true). Set false only when the result goes straight to a file, not into the conversation.