> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Bitbucket

> Connect Bitbucket Cloud workspaces to Cake Agents so agents can clone repositories and push commits as each user, with their own Bitbucket access.

Administrators connect one or more Bitbucket Cloud workspaces to Cake Agents. After that, each user connects their own Bitbucket account, and agents in their sessions clone and push to `bitbucket.org` as that user.

> [!NOTE]
>
> The Bitbucket integration is in beta.

## What this enables

Once a workspace and a user's account are connected, agents in that user's sessions can:

* clone repositories in the connected workspace over HTTPS
* push commits to those repositories

Bitbucket enforces the connecting user's own repository permissions. Agents use the Bitbucket account of the last user who sent a message to the session.

Pull requests and pipelines go through Atlassian's MCP server, not through this integration. Connecting Bitbucket adds Atlassian's MCP server to `Settings → Organization → MCP Connectors` under the name `atlassian` if it isn't there yet. See [Set up Jira](https://docs.cake.ai/admin/jira-setup.md) for how the Atlassian MCP server works and the domain authorization it needs.

## Requirements

* You need the **admin** role in Cake Agents.
* Your Cake Agents instance must be registered with Cake Console. Instances set up through [Getting Started with the Console](https://docs.cake.ai/admin/getting-started-console.md) are registered when you finish setup. If the instance isn't registered, the Bitbucket card shows "Bitbucket needs this instance to be registered with Cake Console, which happens when setup is finalized through Cake Console."
* You must be an admin of the Bitbucket Cloud workspace you connect.

## Connect a workspace

1. In Cake Agents, go to `Settings → Organization → Integrations`.
2. Next to **Bitbucket**, select **Connect Bitbucket**. Cake Console opens in a new tab.
3. On the **Connect a Bitbucket workspace** page, check that the instance URL is yours, then continue.
4. Sign in to Bitbucket as a workspace admin.
5. Install the Cake Agents app in the workspace you want to connect.

If you already installed the Cake Agents app on one or more workspaces, Cake Console shows **Choose a Bitbucket workspace** instead. Select **Connect** followed by the workspace slug, or select **Install on another workspace**.

Return to the Cake Agents tab. The Bitbucket card checks for the new workspace while its dialog is open and lists it once the install finishes. Each connected workspace shows its slug and a link to it on Bitbucket.

Each connect links one workspace. Repeat the steps to connect more.

> [!WARNING]
>
> Only continue on the Cake Console page if you started the connection yourself. If someone sent you the link, cancel.

## Connect your Bitbucket account

Each user connects their own account after an admin connects at least one workspace.

1. In the top right of Cake Agents, click your name → **User settings**.
2. Open the **Git** tab. Under **Bitbucket**, select **Connect Bitbucket account**.
3. In the new tab, confirm the instance URL on the **Connect your Bitbucket account** page, then sign in to Bitbucket.

After you connect, Cake Agents may send you on to sign in to Atlassian's MCP server, so agents can open pull requests as you.

Your Bitbucket connection lasts 90 days and renews each time an agent uses it, for up to one year from when you signed in. After that, connect your account again.

To disconnect, select **Disconnect** under **Bitbucket** in the **Git** tab.

## Remove a workspace

Select **Disconnect** next to a workspace on the Bitbucket card to unlink it from this instance. The Cake Agents app stays installed in the workspace. To end the app's access entirely, uninstall it from the workspace in Bitbucket.

## Troubleshooting

### "An admin must connect a Bitbucket workspace first"

No workspace is connected to this instance yet. Ask an admin to [connect a workspace](#connect-a-workspace).

### The Cake Console page says the link is invalid or expired

Each connect link works once and expires after about ten minutes. Start again from Cake Agents settings.

### Agents can't clone or push

Check that the repository belongs to a connected workspace and that your own Bitbucket account has access to it. If your connection expired, connect your Bitbucket account again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.