Bitbucket MCP
v0.2.0Bitbucket 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.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository 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.
| Parameter | Type | Description |
|---|---|---|
draft | boolean | Only drafts (true) or only ready PRs (false); repository listing only |
filter_text | string | Match title or description; repository listing only |
limit | integer | |
project | string | Project key; omit with repository to list your dashboard across all repositories |
repository | string | Repository slug |
role | string | Your role; dashboard listing only |
start | integer | |
state | string |
get_pull_request_diff Get pull request diff
Get a pull request's unified diff as raw text, optionally for one file.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
context_lines | integer | |
full | boolean | Return the whole diff even when large; otherwise a large diff returns a per-file summary |
ignore_whitespace | boolean | |
path | string | Limit the diff to one file path |
create_pull_request Create pull request
Create a pull request, optionally as a draft.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
repository * | string | Repository slug |
source_branch * | string | Branch name or full ref |
target_branch * | string | Branch name or full ref |
title * | string | |
description | string | |
draft | boolean | Create as draft (DC 8.18+) |
reviewers | array | Reviewer usernames |
source_project | string | Fork project key when the source branch lives in a fork |
source_repository | string | Fork 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.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
description | string | |
draft | boolean | Mark as draft or ready for review (DC 8.18+) |
reviewers | array | Replaces the reviewer list |
target_branch | string | |
title | string |
merge_pull_request Merge pull request
Merge a pull request now, or with auto_merge once its merge checks pass.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
auto_merge | boolean | Merge automatically once checks pass instead of now (DC 8.15+) |
message | string | Merge commit message |
strategy | string | Merge 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.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
text * | string | Markdown comment text |
line | integer | Line for an inline comment; the last line of a range |
line_type | string | Diff segment of line; required with line |
parent_id | integer | Reply to this comment |
path | string | File path for a file or inline comment |
pending | boolean | Add to your draft review; publish with submit_review |
severity | string | BLOCKER creates a task |
start_line | integer | First line of a multi-line range (DC 9.2+) |
start_line_type | string | Diff segment of start_line; defaults to line_type |
suggestion | string | Replacement 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.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
comment_id * | integer | |
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
commit_message | string | Commit message; apply_suggestion only |
emoticon | string | Reaction name, e.g. thumbsup; react and unreact only |
suggestion_index | integer | Which suggestion block to apply |
text | string | New 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.
| Parameter | Type | Description |
|---|---|---|
project * | string | Project key, e.g. PROJ (use ~user for a personal project) |
pull_request_id * | integer | Pull request ID |
repository * | string | Repository slug |
action | string | |
comment | string | Overall review comment; publish only |
status | string | Your review status; publish only |
search Search the REST API spec
Search the Bitbucket Data Center REST API spec. $refs are resolved inline; paths start with /rest/ and are ready for execute. Types: type Schema = { type?: string; enum?: unknown[]; required?: string[]; readOnly?: boolean; description?: string; properties?: Record<string, Schema>; items?: Schema; ref?: string; // a named schema not expanded here (cycle or depth limit) }; type Operation = { summary?: string; description?: string; tags?: string[]; parameters?: Array<{ name: string; in: "path" | "query" | "header"; required?: boolean; description?: string; schema: Schem…
| Parameter | Type | Description |
|---|---|---|
code * | string | JavaScript async arrow function to search the OpenAPI spec |
truncate | boolean | Cap the result at ~6,000 tokens (default true). Set false only when the result goes straight to a file, not into the conversation. |
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…
| Parameter | Type | Description |
|---|---|---|
code * | string | JavaScript async arrow function to execute |
truncate | boolean | Cap the result at ~6,000 tokens (default true). Set false only when the result goes straight to a file, not into the conversation. |