> For the complete documentation index, see [llms.txt](https://www.cakewalk.security/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-connections/bitbucket.md).

# Bitbucket

Connect your company's Bitbucket Cloud workspace to Cakewalk's MCP Gateway. Every agent tool call against Bitbucket passes through the gateway and is evaluated against your Policies.

Atlassian serves Bitbucket through its Rovo MCP server, the same server behind your Jira and Confluence Connections. Bitbucket is a separate Connection because it uses a different credential.

## Requirements

* An Atlassian organization admin who can create a service account and generate an API key.
* A Bitbucket Cloud workspace linked to your Atlassian organization. Bitbucket is unavailable for workspaces that are not linked.

## Step 1: Create a Service Account and API Key

1. Go to [Atlassian Administration](https://admin.atlassian.com) and select your organization if you have more than one.
2. Create a service account. \[VERIFY: exact menu path and button label]
3. Generate an API key for that service account.
4. Copy the key and store it somewhere safe. \[VERIFY: whether Atlassian shows the key once only]

## Step 2: Grant the Bitbucket Scopes

Grant the service account the scopes for the actions you want to allow. Scopes are granted per tool, so a narrower set means fewer tools. Reading pipelines needs `read:pipeline:bitbucket`. Creating and reviewing pull requests needs `write:pullrequest:bitbucket`. \[VERIFY: full scope list against the Bitbucket MCP doc]

## Step 3: Turn On API Key Authentication

1. In Atlassian Administration, expand **Rovo**.
2. Select **Rovo MCP server**.
3. Open the **Authentication** tab. \[VERIFY: tab label]
4. Turn on API token authentication.

\[VERIFY: whether this setting is exclusive with OAuth 2.1. If it is, turning it on here changes how your Jira and Confluence Connections authenticate.]

## Step 4: Paste the API Key Into Cakewalk

1. Open <https://app.getcakewalk.io>.
2. Go to All Connections.
3. Find Bitbucket.
4. Paste the API key. \[VERIFY: label of the credential field for token Connections]
5. Save.

## Verifying It Works

The Bitbucket Connection card flips to Active on All Connections. From an agent platform connected to Cakewalk, ask the agent to list the open pull requests in one of your repositories. If Bitbucket returns results, the Connection is live.

## Troubleshooting

* No Bitbucket tools appear: confirm the workspace is linked to your Atlassian organization. Bitbucket is unavailable for workspaces that are not linked.
* Some actions fail while others work: the service account is missing the scope for that action. Scopes are granted per tool.
* Jira or Confluence stops working after setup: check the authentication setting on the Rovo MCP server. \[VERIFY: pending the exclusivity question in Step 3]

## Learn More

* [Interacting with Bitbucket via MCP](https://support.atlassian.com/bitbucket-cloud/docs/interacting-with-bitbucket-via-mcp/)
* [Configuring authentication via API token](https://support.atlassian.com/atlassian-rovo-mcp-server/docs/configuring-authentication-via-api-token/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-connections/bitbucket.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
