A Bitbucket MCP built around the pull request lifecycle
Connect an Atlassian account email and a scoped API token (app passwords were permanently retired in July 2026) and repositories, branches, commits, pull requests, issues, and pipelines become workflow steps for visual automations and AI agents. The pull request lifecycle is the centerpiece: create, review, comment inline, approve, and merge, with the merge kept a deliberate step you can gate behind a person.
What the Bitbucket MCP connector does
The Bitbucket connector for Mattering Automations is 49 nodes across the Bitbucket Cloud REST API 2.0: workspaces and their members, repositories, branches and tags, commits with raw diffs and per-file diffstats, the full pull request lifecycle (create, update, approve, unapprove, request changes, comment including inline comments, merge, decline, plus activity, commit, and diffstat reads), the repository issue tracker, Bitbucket Pipelines with deployments and environments, source browsing with capped file reads, and webhook management.
Every node speaks MCP, the open protocol for connecting AI assistants to tools, so Claude, ChatGPT, and any MCP-capable assistant can use them, alongside Matter, the AI assistant built into the platform. An assistant can read a pull request's diff, summarize what it touches file by file, leave an inline comment on the exact line, and record an approval or a change request, without anyone opening the Bitbucket UI.
Because Mattering is a work platform rather than middleware, repository work lands somewhere useful by default: a scheduled pull request sweep can open review tasks in Mattering Productivity for anything sitting without reviewer activity, and issue triage can write into a Mattering database next to the rest of the work. GitHub and GitLab connectors exist too, so mixed-host teams can run the same patterns everywhere.
The safety modeling is honest about git. Of the 49 nodes, 30 are read-side and 19 act, and four of those are flagged destructive: branch delete, pull request merge, pull request decline, and webhook delete. Merging changes real code state and the only undo is new revert commits; a declined pull request cannot be reopened on Bitbucket Cloud. Bitbucket: Run Pipeline consumes real build minutes on the workspace plan, so it is documented as a spend action with Bitbucket: Stop Pipeline as the brake. Repository deletion is deliberately not shipped at all: it is permanent, with no trash and no restore.
One connection, three surfaces
- Visual automations. Drag Bitbucket nodes onto the canvas and wire them to triggers, conditions, and other apps.
- AI agents, yours or ours. These nodes speak MCP, the open protocol, so Claude, ChatGPT, and any MCP-capable assistant can use them, and Matter, the agent built into the platform, uses them natively.
- The whole platform. Combine with native tasks, projects, and other connectors, no middleware in between.
Every Bitbucket node, ready to drop on the canvas
49 nodes, generated from the connector itself so this list always matches what ships. Expand a category to browse.
Read and query nodes 30
Bitbucket: Browse Source
List a directory in the repository at a given revision (leave path blank for the repository root): entries come back as commit_file and commit_directory objects with paths and sizes. For a FILE path, set format to meta to get its metadata as JSON; raw file text belongs to the Get File Content node.
Bitbucket: Compare Commits (Diff)
Return the unified diff between two commits as raw text (data.content), capped at 200,000 characters with a truncation flag. Ideal for feeding a code change to an AI node. Defaults to a three-dot diff (source against the merge base); set topic false for a plain two-dot diff.
Bitbucket: Compare Commits (Diffstat)
Summarize the change between two commits per file: status (added, removed, modified, renamed), lines added, and lines removed. The bounded JSON alternative to the raw diff.
Bitbucket: Get Branch
Fetch one branch by name, including its head commit and the merge strategies configured for it. Branch names with slashes (feature/login) are URL-encoded for you.
Bitbucket: Get Commit
Fetch one commit by hash: message, author, date, and parents. Note the path segment is commit (singular), unlike the commits list; that is Bitbucket's own naming.
Bitbucket: Get Current User
Return the authenticated Bitbucket account: display name, nickname, account_id, and uuid. Zero-parameter Safe Read, so it doubles as the credential health check: 401 means the email or API token is wrong, 200 proves the connection.
Bitbucket: Get File Content
Fetch the raw contents of one TEXT file at a revision into data.content, capped at 200,000 characters with a truncation flag. Binary files decode to garbage (check the size and type with Browse Source first) and files stored in Git LFS return a redirect instead of content.
Bitbucket: Get Issue
Fetch one issue: title, state, kind, priority, assignee, and content. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: Get Pipeline
Fetch one pipeline run: state, result, target ref and commit, trigger, and build seconds used. Poll this after Run Pipeline to watch a build finish.
Bitbucket: Get Pull Request
Fetch one pull request: title, state, source and destination branches, reviewers, participants with approval state, and counts.
Bitbucket: Get Pull Request Diffstat
Per-file change summary for a pull request: status, lines added, lines removed. The bounded way to see what a pull request touches.
Bitbucket: Get Repository
Fetch one repository: full_name, main branch, language, size, privacy, project, and clone links.
Bitbucket: Get Tag
Fetch one tag by name, including its target commit, tagger, and message.
Bitbucket: Get Workspace
Fetch one workspace by slug or UUID: name, slug, privacy settings, forking mode, and links.
Bitbucket: List Branches
List open branches in a repository, each with its head commit. Sorting by name uses natural sort order.
Bitbucket: List Commits
List commits in reverse chronological order, like git log. Filter the DAG with include and exclude refs and narrow to commits touching a file or directory with path. This endpoint paginates by opaque cursors, not page numbers: to get the next page, call again with the URL from data.next (or raise pagelen).
Bitbucket: List Deployments
List Bitbucket Pipelines deployments for a repository: which release went to which environment, with state and commit.
Bitbucket: List Environments
List the deployment environments configured for a repository (for example Test, Staging, Production) with their UUIDs.
Bitbucket: List Issue Comments
List comments on an issue, oldest first. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: List Issues
List issues in the repository's issue tracker, filterable by state, kind, priority, and assignee via the q field. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: List Pipelines
List pipeline runs for a repository, filterable by status, target branch, and trigger type. Sort by -created_on for newest first.
Bitbucket: List Pull Request Activity
The audit trail of a pull request: updates, approvals, change requests, and comments, newest first. Each value has one of an update, approval, changes_requested, or comment key. This endpoint paginates by opaque cursors, not page numbers: to get the next page, call again with the URL from data.next (or raise pagelen).
Bitbucket: List Pull Request Comments
List comments on a pull request, both general and inline (inline ones carry the file path and line).
Bitbucket: List Pull Request Commits
List the commits a pull request would merge, newest first. This endpoint paginates by opaque cursors, not page numbers: to get the next page, call again with the URL from data.next (or raise pagelen).
Bitbucket: List Pull Requests
List pull requests, filterable by state (OPEN, MERGED, DECLINED, SUPERSEDED) and by query expressions. Defaults to open pull requests when no state is given.
Bitbucket: List Repositories
List repositories in a workspace, filterable by the authenticated user's role and by Bitbucket query expressions (name, language, updated_on and more).
Bitbucket: List Tags
List tags in a repository, each with its target commit and tag message.
Bitbucket: List Webhooks
List webhook subscriptions on a repository: target URL, subscribed events, active flag, and whether a signing secret is set (the secret itself is never echoed).
Bitbucket: List Workspace Members
List all members of a workspace as user objects. Workspace administrators can additionally filter by email address with the q field.
Bitbucket: List Workspaces
List every workspace the authenticated user can access, each with an administrator flag saying whether the user is a workspace admin. Uses the supported /2.0/user/workspaces endpoint (the old /2.0/workspaces list is deprecated by Atlassian).
Action nodes 19
Bitbucket: Approve Pull Request
Approve a pull request as the authenticated user. Reversed by the Unapprove node.
Bitbucket: Create Branch
Create a branch pointing at a commit. The vendor docs recommend a full commit hash as the target; a branch name or an unambiguous short hash also works (an ambiguous prefix returns 400).
Bitbucket: Create Issue
Create an issue in the repository's issue tracker. Only title is required. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: Create Issue Comment
Comment on an issue as the authenticated user. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: Create Pull Request
Open a pull request from a source branch. Destination defaults to the repository's main branch when left blank. The authenticated user becomes the author.
Bitbucket: Create Pull Request Comment
Comment on a pull request. Fill inline_path (and optionally inline_line) to attach the comment to a specific file and line of the diff; leave both blank for a general comment.
Bitbucket: Create Repository
Create a git repository in a workspace. The repo_slug in the URL becomes the repository's slug. On workspaces that require projects, set project_key or Bitbucket assigns the oldest project automatically.
Bitbucket: Create Webhook
Subscribe a URL to repository events (repo:push, pullrequest:created, and more). When a secret is set, Bitbucket signs each delivery with an HMAC digest in the X-Hub-Signature header. The URL must be publicly routable.
Bitbucket: Decline Pull Request
DESTRUCTIVE: decline (reject) a pull request. The record survives, but a declined pull request cannot be reopened on Bitbucket Cloud; the recovery path is opening a new pull request from the same branches. No code is changed.
Bitbucket: Delete Branch
DESTRUCTIVE: delete a branch. Commits only reachable from this branch become unreferenced and are eventually garbage collected; there is no undelete. Recreate the branch from its old head hash immediately if this was a mistake.
Bitbucket: Delete Webhook
DESTRUCTIVE: delete a webhook subscription. Deliveries stop immediately and the subscription cannot be restored; it must be recreated (and a signing secret re-entered) if removed by mistake.
Bitbucket: Merge Pull Request
DESTRUCTIVE-ADJACENT: merge a pull request into its destination branch. This changes real code state; the only undo is new revert commits. Runs synchronously (long merges can time out server-side; Bitbucket's async mode is not exposed here).
Bitbucket: Request Changes on Pull Request
Mark a pull request as changes requested by the authenticated user. The matching remove endpoint is not built; approving the pull request supersedes the request in practice.
Bitbucket: Run Pipeline
COSTS BUILD MINUTES: trigger a Bitbucket Pipelines run on a branch or tag. Build minutes are a metered, paid resource on the workspace's plan, so treat this like a spend action. Set selector_type custom plus selector_pattern to run a custom pipeline; add variables for parameterized runs. Stop Pipeline cancels a run in progress.
Bitbucket: Stop Pipeline
Stop (halt) a pipeline that is pending or in progress. Stops billing for the run; the pipeline shows as stopped. Returns 204 with no body.
Bitbucket: Unapprove Pull Request
Withdraw the authenticated user's own approval from a pull request. Returns 204 with no body.
Bitbucket: Update Issue
Edit an issue: title, body, kind, priority, workflow state, or assignee. Fields left blank keep their current value; to clear a field, send null for it via extra_body. Requires the repository's issue tracker to be enabled (Repository settings > Features); a repo without it returns 404.
Bitbucket: Update Pull Request
Edit an open pull request: title, description, destination branch, draft flag, or the reviewer list. Only open pull requests can be edited. Fields left blank are not touched, but note a reviewers value REPLACES the whole reviewer list.
Bitbucket: Update Repository
Update repository settings: description, privacy, language, issue tracker and wiki toggles, fork policy, or project. Careful with name: renaming a repository also changes its slug, which breaks existing clone URLs and any automations pointing at the old slug. Fields left blank are not touched.
Connecting Bitbucket takes one credential
Atlassian permanently retired Bitbucket app passwords in July 2026; the current mechanism is a scoped API token created in your Atlassian account settings under Security > API tokens (id.atlassian.com/manage-profile/security/api-tokens). The connector authenticates with HTTP Basic auth: your Atlassian account email is the username and the API token is the password. Tokens carry the scopes you select and an expiry chosen at creation, and an old app password now returns a 401 on every request.
Sign in at id.atlassian.com, open Security > API tokens, and create an API token with scopes, selecting the Bitbucket scopes your automations need (for example read:repository:bitbucket and write:repository:bitbucket) and an expiry date.
In Mattering Automations, open Connectors, click Add Connector, choose Bitbucket, and create a credential with your Atlassian account email as the username and the API token as the password.
Click Test Connection. Mattering calls Bitbucket's authenticated user endpoint and confirms the credential works: a 200 proves the connection, a 401 means the email or token is wrong.
All 49 Bitbucket nodes appear in the canvas palette. Run Bitbucket: List Workspaces first: nearly every other node needs the workspace slug it returns.
Common uses for the Bitbucket MCP
Pull request review an agent can run
Bitbucket: List Pull Requests finds what is open, Bitbucket: Get Pull Request Diffstat summarizes what each one touches file by file, and Bitbucket: List Pull Request Activity shows who has already weighed in. The agent then acts with real review verbs: Bitbucket: Create Pull Request Comment attaches a comment to a specific file and line when inline_path is set, and Bitbucket: Approve Pull Request or Bitbucket: Request Changes on Pull Request records the verdict as the authenticated user.
Merges that wait for a person
Bitbucket: Merge Pull Request supports all six of Bitbucket's merge strategies, from merge commit to squash to rebase fast forward. It also changes real code state on the destination branch, and the only undo is new revert commits, so the natural pattern is gating it behind an approval task in Mattering Productivity: the sweep finds the ready pull request, a person clears the task, and only then does the merge run.
Code an AI node can actually read
Bitbucket: Get File Content returns raw file text capped at 200,000 characters with a truncation flag, sized for feeding straight into an AI step; binary files decode to garbage and Git LFS files return a redirect, so check size and type with Bitbucket: Browse Source first. Bitbucket: Compare Commits (Diff) ships the unified diff under the same cap, and Bitbucket: Compare Commits (Diffstat) is the bounded JSON alternative when the summary is enough.
Pipelines with the cost stated plainly
Bitbucket: Run Pipeline triggers a build on a branch or tag, and it consumes real build minutes, a metered, paid resource on the workspace plan, so treat it like a spend action. Bitbucket: Get Pipeline polls the run to completion, Bitbucket: Stop Pipeline is the brake that halts a pending or in-progress run, and Bitbucket: List Deployments with Bitbucket: List Environments shows which release went to which environment.
Issue triage next to the work
Bitbucket: List Issues filters the repository tracker by state, kind, priority, and assignee, and Bitbucket: Create Issue, Bitbucket: Update Issue, and Bitbucket: Create Issue Comment handle the write side. The tracker is a per-repository feature that must be enabled in Repository settings > Features; a repository without it returns 404 on every issue node. Triage results route naturally into Mattering databases or tasks.
Repository and webhook housekeeping
Bitbucket: Create Repository and Bitbucket: Create Branch set up new work, Bitbucket: Update Repository manages settings like the issue tracker toggle, and the webhook nodes manage subscriptions: Bitbucket: List Webhooks, Bitbucket: Create Webhook with HMAC signing when a secret is set, and a destructive-flagged Bitbucket: Delete Webhook. There is no inbound Bitbucket trigger in this connector, so reacting to repository events means polling on a schedule.
Example: Open pull requests become review tasks, and the merge waits for a person
Built on the Automations canvas in a few minutes, or described in plain language to Matter and built for you.
Trigger: a schedule runs the sweep each morning. There is no inbound Bitbucket trigger, so polling is the honest pattern.
Bitbucket: List Pull Requests returns the open pull requests in the repository.
Bitbucket: Get Pull Request Diffstat summarizes what each one touches, file by file, without shipping the whole diff.
Bitbucket: List Pull Request Activity filters the sweep to pull requests with no reviewer activity yet, and each of those opens a review task in Mattering Productivity with the diffstat summary attached.
Bitbucket: Create Pull Request Comment leaves a note on the pull request linking its review task.
When the approval task completes, a separately gated Bitbucket: Merge Pull Request merges with the strategy you chose. Merging changes real code state and the only undo is revert commits, which is exactly why it sits behind the approval.
Bitbucket MCP questions, answered
What Bitbucket operations are supported?
49 nodes on the Bitbucket Cloud REST API 2.0: 30 query nodes and 19 action nodes covering workspaces and members, repositories, branches and tags, commits with diffs and diffstats, the full pull request lifecycle (create, update, approve, unapprove, request changes, comments including inline, merge, decline, activity, commits, diffstat), the issue tracker, Pipelines (list, get, run, stop) plus deployments and environments, source browsing with capped file reads, and webhook management. Deliberately not shipped: repository deletion, tag writes, snippets and downloads, pipeline admin plumbing like schedules and variables, and OAuth flows.
Does this work with Claude, ChatGPT, or other AI assistants?
Yes. Mattering exposes these nodes over MCP, an open protocol for connecting AI assistants to tools, so any MCP-capable assistant, including Claude and ChatGPT, can connect to your workspace and use them. Matter, the assistant built into the platform, uses the same nodes natively.
Why does my app password return a 401?
Because Atlassian removed app passwords permanently in July 2026, after a year of staged deprecation. Any request authenticated with an app password now fails with a 401 that looks like a wrong-token error but is really a retired credential class. The fix is to create a scoped API token in your Atlassian account settings under Security > API tokens and use it with your Atlassian account email; this connector authenticates only that way.
Can a declined pull request be reopened?
No. Declining is flagged destructive on this connector for exactly that reason: the pull request record survives and no code changes, but a declined pull request cannot be reopened on Bitbucket Cloud. The recovery path is opening a new pull request from the same source and destination branches, which Bitbucket: Create Pull Request does in one step.
Can a merge be undone?
Not by the API, and not by this connector. Bitbucket: Merge Pull Request changes real code state on the destination branch, and the only undo git offers is writing new revert commits. All six merge strategies are supported (merge commit, squash, fast forward, squash fast forward, rebase fast forward, rebase merge), and the node is flagged so it is easy to gate behind a condition, an approval task, or a manual run rather than a bare trigger.
Does running a pipeline cost money?
It consumes Bitbucket Pipelines build minutes, which are a metered resource on the workspace's Bitbucket plan, so a scheduled workflow that triggers builds is spending a real allowance. The connector says this plainly on the node rather than burying it: treat Bitbucket: Run Pipeline like a spend action, poll with Bitbucket: Get Pipeline, and use Bitbucket: Stop Pipeline to halt a pending or in-progress run, which also stops the billing for it.
Can this connector delete a repository?
No, deliberately. Deleting a Bitbucket Cloud repository is permanent: there is no trash, no archive, and no restore, and it destroys the entire git history along with issues and pull requests. That risk class stays off the canvas entirely. The destructive operations that did ship (branch delete, merge, decline, webhook delete) are all flagged so workflows can gate them.
Can a Bitbucket event trigger a workflow?
Not as a trigger node in this connector. The webhook nodes manage a repository's webhook subscriptions (list, create with HMAC signing, delete) rather than receiving events, so there is no inbound Bitbucket trigger. The honest pattern today is polling: run Bitbucket: List Pull Requests or Bitbucket: List Pipelines on a schedule and act on what changed. The webhooks you manage can point Bitbucket's events at any URL you operate.
Put Bitbucket to work inside your workspace
Connect once, then use every node in visual automations and AI agent workflows across the Mattering platform.
All product names, logos, and brands are property of their respective owners and are used for identification purposes only. Use of these names, logos, and brands does not imply endorsement or affiliation. Bitbucket is a product of its respective owner; Mattering is an independent platform.