# Bitbucket

```json
{
  "name": "Bitbucket",
  "slug": "bitbucket",
  "url": "https://composio.dev/toolkits/bitbucket",
  "markdown_url": "https://composio.dev/toolkits/bitbucket.md",
  "logo_url": "https://logos.composio.dev/api/bitbucket",
  "categories": [
    "developer tools & devops"
  ],
  "is_composio_managed": true,
  "updated_at": "2026-05-12T10:03:09.411Z"
}
```

![Bitbucket logo](https://logos.composio.dev/api/bitbucket)

## Description

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Bitbucket MCP or direct API to create repositories, manage pull requests, review code, and automate issue tracking through natural language.

## Summary

Bitbucket is a Git-based code hosting and collaboration platform for teams. It enables secure repository management and streamlined code reviews.

## Categories

- developer tools & devops

## Toolkit Details

- Tools: 105
- Managed auth: Managed by Composio

## Images

- Logo: https://logos.composio.dev/api/bitbucket

## Authentication

- **Oauth2**
  - Type: `oauth2`
  - Description: Oauth2 authentication for Bitbucket.
  - Setup:
    - Configure Oauth2 credentials for Bitbucket.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- Create a new branch off main
- Open a pull request for my feature
- Comment on the latest open issue
- Fetch README file from repository

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `BITBUCKET_APPROVE_PULL_REQUEST` | Approve Pull Request | Tool to approve a pull request as the authenticated user. Use when you need to formally approve changes in a pull request review process. |
| `BITBUCKET_BROWSE_REPOSITORY_PATH` | Browse repository path | Tool to retrieve content for a file path or browse directory contents at a specified revision in a Bitbucket repository. Use when you need flexible access to repository content - returns raw file data for files or paginated directory listings for directories. |
| `BITBUCKET_CREATE_BRANCH` | Create a branch | Creates a new branch in a Bitbucket repository from a target commit hash; the branch name must be unique, adhere to Bitbucket's naming conventions, and not include the 'refs/heads/' prefix. |
| `BITBUCKET_CREATE_ISSUE` | Create an issue | Creates a new issue in a Bitbucket repository, setting the authenticated user as reporter; ensures assignee (if provided) has repository access, and that any specified milestone, version, or component IDs exist. |
| `BITBUCKET_CREATE_ISSUE_COMMENT` | Create an issue comment | Adds a new comment with markdown support to an existing Bitbucket issue. |
| `BITBUCKET_CREATE_PULL_REQUEST` | Create a pull request | Creates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch. |
| `BITBUCKET_CREATE_PULL_REQUEST_COMMENT` | Create pull request comment | Creates a new comment on a Bitbucket pull request. Supports top-level comments, threaded replies, and inline code comments. Use when providing feedback on a PR, replying to existing comments, or commenting on specific code lines. |
| `BITBUCKET_CREATE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` | Create commit report annotations | Adds multiple annotations to a commit report in bulk. Use when you need to add code analysis findings (vulnerabilities, code smells, bugs) to a report attached to a specific commit. |
| `BITBUCKET_CREATE_REPOSITORIES_COMMITS2` | List commits from revision (POST) | Tool to list commits from a revision using POST method. Identical to GET endpoint but allows sending include/exclude parameters in request body to avoid URL length limits. Use when include/exclude parameters are too long for query strings. |
| `BITBUCKET_CREATE_REPOSITORY` | Create repository | Creates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if `project_key` is not provided. |
| `BITBUCKET_CREATE_SNIPPET_COMMENT` | Create snippet comment | Posts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet. |
| `BITBUCKET_CREATE_TEAMS_PIPELINES_CONFIG_VARIABLES` | Create team pipeline variable | Creates a team-level pipeline configuration variable in Bitbucket. Use when you need to add environment variables or configuration values that should be available to all pipelines within a team. |
| `BITBUCKET_CREATE_USERS_PIPELINES_CONFIG_VARIABLES` | Create user pipeline variable | Creates a user-level pipeline variable for Bitbucket pipelines. Use when you need to create account-level configuration variables that can be used across all repositories owned by the user. |
| `BITBUCKET_DELETE_COMMIT_COMMENT` | Delete commit comment | Permanently deletes a specific comment on a commit. Use when removing outdated, incorrect, or unwanted feedback on a commit. |
| `BITBUCKET_DELETE_ISSUE` | Delete issue | Permanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`. |
| `BITBUCKET_DELETE_PULL_REQUEST_COMMENT` | Delete pull request comment | Permanently deletes a specific pull request comment (top-level, inline, or threaded reply). Use when removing outdated, incorrect, or unwanted feedback from a pull request. |
| `BITBUCKET_DELETE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` | Delete commit report annotation | Deletes a single annotation matching the provided ID from a commit report. Use when you need to remove a specific annotation from a code analysis report. |
| `BITBUCKET_DELETE_REPOSITORY` | Delete repository | Permanently deletes a specified Bitbucket repository; this action is irreversible and does not affect forks. |
| `BITBUCKET_DELETE_SNIPPETS_WATCH` | Delete snippet watch | Stops watching a specific snippet. Use when you want to unsubscribe from notifications for a snippet. |
| `BITBUCKET_DELETE_USER_PIPELINE_VARIABLE` | Delete user pipeline variable | Permanently deletes a user-level pipeline configuration variable identified by its UUID. Use this to remove pipeline variables that are no longer needed at the account level. |
| `BITBUCKET_GET_BRANCH` | Get branch | Retrieves detailed information about a specific branch in a Bitbucket repository. Use when you need to get branch metadata, the commit it points to, or verify a branch exists. |
| `BITBUCKET_GET_COMMIT_BUILD_STATUS` | Get Commit Build Status | Get a specific build status for a commit in Bitbucket. Use when you need to check the status of a particular build/CI run for a commit. |
| `BITBUCKET_GET_COMMIT_CHANGES` | Get Commit Changes | Tool to retrieve a page of changes made in a specified commit, showing all changed files with their change statistics (lines added/removed, status). Use when you need to enumerate files modified in a specific commit or commit range. |
| `BITBUCKET_GET_COMMIT_COMMENT` | Get commit comment | Retrieves a specific comment from a commit by its ID. Use when you need to fetch details of a particular commit comment including content, author, timestamps, and inline location. |
| `BITBUCKET_GET_COMMIT_DIFF` | Get Commit Diff | Tool to retrieve the unified diff between two provided revisions or for a single commit in a Bitbucket repository. Use when you need to see the actual code changes in a commit or between two commits. Supports filtering by file path and various diff options. |
| `BITBUCKET_GET_CURRENT_USER2` | Get current user (v2) | Tool to retrieve complete profile information for the currently authenticated Bitbucket user. Use when you need comprehensive user details including account_id, username, nickname, and other profile fields. |
| `BITBUCKET_GET_DEPLOYMENT_ENVIRONMENT_VARIABLES` | Get deployment environment variables | Retrieves deployment environment level variables for a specific Bitbucket repository environment. Use when you need to view or audit environment-specific configuration variables for deployments. |
| `BITBUCKET_GET_FILE_FROM_REPOSITORY` | Get file from repository | Retrieves a specific file's content from a Bitbucket repository at a given commit (hash, branch, or tag), failing if the file path is invalid for that commit. |
| `BITBUCKET_GET_HOOK_EVENTS` | Get hook events | Retrieves a paginated list of all valid webhook events for a specified entity type (repository or workspace). Use when you need to discover available webhook event types for subscription or webhook configuration. |
| `BITBUCKET_GET_OPENID_CONFIGURATION` | Get OpenID configuration for OIDC in Pipelines | Retrieves the OpenID Connect discovery configuration for Bitbucket Pipelines OIDC. Use when integrating Bitbucket Pipelines with resource servers (AWS, GCP, Vault) using OpenID Connect authentication. Returns issuer URL, JWKS URI, and supported capabilities. |
| `BITBUCKET_GET_PULL_REQUEST` | Get Pull Request | Get a single pull request by ID with complete details. |
| `BITBUCKET_GET_PULL_REQUEST_COMMENT` | Get pull request comment | Tool to retrieve a specific comment from a pull request by its ID. Use when you need to fetch details of a particular pull request comment including content, author, timestamps, and inline location. |
| `BITBUCKET_GET_PULL_REQUEST_COMMITS` | Get Pull Request Commits | Tool to retrieve commits for a specified pull request. Use when reviewing the commit history of a PR or analyzing changes included in a pull request. |
| `BITBUCKET_GET_PULL_REQUEST_DIFF` | Get Pull Request Diff | Tool to fetch the unified diff for a Bitbucket pull request (follows 302 redirect to repository diff). Use when reviewing code changes in a PR. Supports optional truncation for large diffs via max_chars parameter. |
| `BITBUCKET_GET_PULL_REQUEST_DIFFSTAT` | Get Pull Request Diffstat | Tool to get the diffstat for a Bitbucket pull request, showing all changed files with their change statistics (lines added/removed, status). Use when you need to enumerate files modified in a PR. |
| `BITBUCKET_GET_REPOSITORIES_BRANCHING_MODEL` | Get Repository Branching Model | Return the branching model as applied to the repository. Use when you need to understand the repository's branch workflow configuration, including development/production branches and branch type prefixes. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT` | Get Repository Commit | Tool to retrieve detailed information about a specific commit in a Bitbucket repository. Use when you need to get complete commit details including author, message, date, parents, and related links. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT_COMMENTS` | Get commit comments | Retrieves all comments on a specific commit in a Bitbucket repository. Returns both global and inline code comments. Use when you need to view feedback, discussions, or notes left on a specific commit. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORT` | Get commit report | Returns a single report matching the provided ID from a commit. Use when you need to retrieve details of a specific analysis report (e.g., security scan, code coverage, test results, or bug report) for a commit. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORTS` | Get Commit Reports | Tool to get reports linked to a specific commit. Use when you need to retrieve analysis results, test reports, security scans, or code coverage data associated with a commit. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` | Get commit report annotation | Returns a single annotation matching the provided ID from a commit report. Use when you need to retrieve details of a specific code analysis finding (e.g., vulnerability, code smell, or bug) identified in a commit. |
| `BITBUCKET_GET_REPOSITORIES_COMMIT_STATUSES` | Get commit statuses | Returns all build statuses (e.g., CI/CD pipeline results) for a specific commit. Use when you need to check build status, verify test results, or monitor deployment pipelines for a particular commit. |
| `BITBUCKET_GET_REPOSITORIES_EFFECTIVE_BRANCHING_MODEL` | Get effective branching model | Retrieves the effective branching model for a Bitbucket repository, showing which branching model is currently applied (including any inheritance from project-level settings). Use when you need to understand the repository's branch workflow configuration, including development and production branches and branch type prefixes. |
| `BITBUCKET_GET_REPOSITORIES_ENVIRONMENTS2` | Get Repository Environment | Retrieve detailed information about a specific deployment environment in a Bitbucket repository. Use when you need to get environment configuration, deployment settings, or check environment properties like locks and restrictions. |
| `BITBUCKET_GET_REPOSITORIES_FILEHISTORY` | Get file commit history | Returns a paginated list of commits that modified the specified file. Use when you need to track file changes over time, find who modified a file, or determine when a file was created or last changed. |
| `BITBUCKET_GET_REPOSITORIES_ISSUES_VOTE` | Check if user voted for issue | Tool to check whether the authenticated user has voted for a specific issue in a Bitbucket repository. Use when you need to verify if the current user has already voted on an issue before attempting to vote or unvote. |
| `BITBUCKET_GET_REPOSITORIES_MERGE_BASE` | Get Repositories Merge Base | Get the merge base (best common ancestor) between two commits in a Bitbucket repository. Use when you need to find the common ancestor commit between two branches or commits for comparison or merge operations. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES2` | Get specific pipeline | Retrieve a specified pipeline from a Bitbucket repository. Use when you need to get detailed information about a specific pipeline execution including its status, build number, and results. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_CACHES` | Get repository pipelines caches | Retrieves the repository pipelines caches. Use when you need to list all caches configured for Bitbucket Pipelines in a specific repository. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_RUNNERS` | Get repository pipeline runners | Retrieves the list of self-hosted runners configured for a repository's pipelines. Use when you need to view available runners for pipeline execution. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_SCHEDULES` | Get repository pipeline schedules | Retrieves configured pipeline schedules for a Bitbucket repository. Use when you need to view scheduled pipeline runs and their cron patterns. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_SSH_KNOWN_HOSTS` | Get repository SSH known hosts | Retrieves repository-level SSH known hosts configured for Bitbucket Pipelines. Use when you need to list or verify SSH known hosts that Pipelines can connect to during builds. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_CONFIG_VARIABLES` | Get repository pipeline variables | Retrieves repository-level pipeline variables for a specific Bitbucket repository. Use when you need to view or audit pipeline configuration variables that are scoped to a repository. |
| `BITBUCKET_GET_REPOSITORIES_PIPELINES_STEPS` | Get pipeline steps | Retrieves all steps for a given pipeline. Use when you need to inspect the individual steps of a pipeline execution, including their state, duration, and commands. |
| `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_ACTIVITY` | Get pull requests activity log | Get paginated activity log for all pull requests in a repository. Returns comments, updates, approvals, and request changes. Use when you need to track pull request activity history. |
| `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_COMMENTS` | Get pull request comments | Retrieves a paginated list of comments on a specific pull request in a Bitbucket repository. Returns global, inline, and threaded comments. Use when you need to view feedback, discussions, or reviews left on a pull request. |
| `BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_STATUSES` | Get pull request statuses | Returns all build statuses (e.g., CI/CD pipeline results) for a specific pull request. Use when you need to check build status, verify test results, or monitor deployment pipelines for a pull request. |
| `BITBUCKET_GET_REPOSITORIES_REFS` | Get repository refs | Returns the branches and tags in the repository. Use when you need to list all refs (both branches and tags) in a single API call with optional filtering by type, name pattern, or commit hash. |
| `BITBUCKET_GET_REPOSITORIES_REFS_TAGS` | Get tag | Retrieves detailed information about a specific tag in a Bitbucket repository. Use when you need to get tag metadata, target commit details, or verify a tag exists. |
| `BITBUCKET_GET_REPOSITORIES_SRC` | Get repositories src | Lists the contents of the root directory on the repository's main branch without needing to specify a commit or branch. This endpoint redirects to the main branch automatically. |
| `BITBUCKET_GET_REPOSITORIES_WATCHERS` | Get repository watchers | Retrieves a paginated list of all the watchers on the specified repository. Use when you need to see who is watching a particular repository. |
| `BITBUCKET_GET_REPOSITORY` | Get repository | Retrieves detailed information about a specific repository in a Bitbucket workspace. Use when you need to get repository metadata, settings, or details. |
| `BITBUCKET_GET_REPOSITORY_PATCH` | Get Repository Patch | Tool to retrieve the git patch content for a Bitbucket repository at a specified revision or commit range. Use when you need to review code changes, generate diffs, or analyze modifications between commits. Returns raw patch in unified diff format. |
| `BITBUCKET_GET_SNIPPET` | Get snippet | Retrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure. |
| `BITBUCKET_GET_SNIPPETS_WATCH` | Get snippet watch status | Checks if the current user is watching a specific snippet. Use when you need to verify watch status for a snippet. |
| `BITBUCKET_GET_SSH_LATEST_KEYS` | Get SSH keys for user | Retrieves a paginated list of SSH keys for a specified Bitbucket user. Use when you need to view or audit SSH keys configured for a user account. |
| `BITBUCKET_GET_USER` | Get user | Retrieves public profile information for a specific Bitbucket user by username or UUID. Use when you need to get user details like display name, avatar, creation date, and links to related resources. |
| `BITBUCKET_GET_USER_EMAILS` | Get user emails | Returns all the authenticated user's email addresses, both confirmed and unconfirmed. Use when you need to retrieve all email addresses associated with the current user's account. |
| `BITBUCKET_GET_USER_EMAILS2` | Get user email details | Retrieves details about a specific email address for the authenticated user. Use when you need to check if an email is primary, confirmed, or verify email ownership. |
| `BITBUCKET_GET_USER_PERMISSIONS_REPOSITORIES` | Get user permissions for repositories | Returns an object for each repository the caller has explicit access to, including their permission level. Use when you need to discover which repositories the authenticated user can access and their specific permissions. |
| `BITBUCKET_GET_USER_PERMISSIONS_WORKSPACES` | Get user permissions for workspaces | Retrieves workspace memberships and permission levels for the authenticated user. Returns an object for each workspace the caller is a member of, along with their effective role (highest privilege level). Use when you need to determine which workspaces a user can access and their permission level in each. |
| `BITBUCKET_GET_USER_WORKSPACES` | Get user workspaces | Tool to retrieve all workspaces accessible to the authenticated user. Use when you need to list workspaces the current user can access, optionally filtered by workspace slug or permission level. |
| `BITBUCKET_GET_WORKSPACE` | Get workspace | Retrieves detailed information about a specific Bitbucket workspace. Use when you need to get workspace metadata, settings, or details. |
| `BITBUCKET_GET_WORKSPACES_PULLREQUESTS` | Get Workspace Pull Requests by User | Tool to get all workspace pull requests authored by a specified user. Use when you need to retrieve pull requests created by a specific user across all repositories in a workspace. |
| `BITBUCKET_GET_WORKSPACES_SEARCH_CODE` | Search code in workspace | Tool to search for code in the repositories of the specified workspace. Use when you need to find specific code patterns, function definitions, or text across all repositories in a workspace. |
| `BITBUCKET_LIST_BRANCHES` | List branches | Lists branches in a Bitbucket repository with optional server-side filtering by name pattern (BBQL) and sorting. Use when you need to discover available branches, search for specific branch patterns, or navigate repository branch structure. |
| `BITBUCKET_LIST_COMMITS` | List commits | Tool to retrieve a page of commits from a Bitbucket repository. Returns commits in reverse chronological order (newest first), similar to git log. Use when you need to browse commit history, filter commits by branch/tag, or restrict to commits affecting a specific path. |
| `BITBUCKET_LIST_COMMITS_FROM_REVISION` | List commits from revision | Tool to list commits starting from a specific revision in a Bitbucket repository. Commits are paginated and returned in reverse chronological order. Use when you need to retrieve commit history from a specific commit, branch, or tag. |
| `BITBUCKET_LIST_COMMITS_ON_MASTER` | List commits on master | Lists commits on the master branch of a Bitbucket repository. Use when you need to retrieve the commit history for the master branch, including commit messages, authors, dates, and parent relationships. |
| `BITBUCKET_LIST_DEPLOYMENTS` | List deployments | Lists deployments for a specified Bitbucket repository. Use when you need to view deployment history and status across environments. |
| `BITBUCKET_LIST_ISSUES` | List issues in a repository | Lists issues in a Bitbucket repository with optional filtering by state, priority, kind, or assignee. Use when you need to discover issue IDs or get an overview of repository issues. |
| `BITBUCKET_LIST_PIPELINES` | List pipelines | Tool to find pipelines in a Bitbucket repository. Returns pipeline metadata including state, trigger, and duration. Use when you need to browse pipeline history or check pipeline status. |
| `BITBUCKET_LIST_PULL_REQUESTS` | List pull requests | Lists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED). |
| `BITBUCKET_LIST_PULL_REQUEST_TASKS` | List pull request tasks | Lists all tasks associated with a pull request in a Bitbucket repository. Use when you need to view or track tasks on a PR. |
| `BITBUCKET_LIST_REPOSITORIES` | List all public repositories | Retrieves a paginated list of all public repositories on Bitbucket. Use when you need to discover or search across public repositories, optionally filtered by role, query string, creation date, or sorted by various fields. |
| `BITBUCKET_LIST_REPOSITORIES_ENVIRONMENTS` | List repository environments | List all deployment environments configured for a Bitbucket repository. Use when you need to view available environments for deployments, check environment configurations, or select an environment for deployment operations. |
| `BITBUCKET_LIST_REPOSITORIES_IN_WORKSPACE` | List repositories in workspace | Lists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results. Responses are paginated; iterate using the `next` field in each response until it is absent to retrieve all repositories. |
| `BITBUCKET_LIST_REPOSITORY_PATHS` | List repository paths | Lists file and directory entries under a repository path at a given revision, with optional breadth-first recursion via max_depth for repository traversal and scanning. Fails if the path points to a file rather than a directory. |
| `BITBUCKET_LIST_SNIPPETS` | List snippets | Returns all snippets accessible to the authenticated user. Use when you need to discover or list snippets, optionally filtered by role (owner, contributor, or member). |
| `BITBUCKET_LIST_TAGS` | List tags | Lists tags in a Bitbucket repository with optional server-side filtering by name pattern or commit hash (BBQL) and sorting. Use when you need to discover available tags, search for specific tag patterns, or find tags pointing to specific commits. |
| `BITBUCKET_LIST_VERSIONS` | List versions | Lists versions (milestones) in a Bitbucket repository's issue tracker. Use when you need to discover available versions for associating with issues, or to retrieve version IDs for use with create_issue. |
| `BITBUCKET_LIST_WORKSPACE_MEMBERS` | List workspace members | Lists all members of a specified Bitbucket workspace; the workspace must exist. |
| `BITBUCKET_LIST_WORKSPACE_PROJECTS` | List workspace projects | Lists projects in a specified Bitbucket workspace. Use when you need to retrieve all projects belonging to a workspace. |
| `BITBUCKET_LIST_WORKSPACES` | List workspaces | Lists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted. Results are paginated; follow the `next` field in each response to retrieve subsequent pages until `next` is absent. When multiple workspaces are returned, verify the correct `slug` or UUID before passing to downstream tools. |
| `BITBUCKET_MERGE_PULL_REQUEST` | Merge Pull Request | Tool to merge a Bitbucket Cloud pull request via the REST API. Use when you need to complete a PR merge after approval and checks pass. Supports custom merge messages, merge strategies, and source branch deletion. |
| `BITBUCKET_REQUEST_PULL_REQUEST_CHANGES` | Request Pull Request Changes | Tool to request changes on a pull request as the authenticated user. Use when you need to formally request changes in a pull request review process, indicating the PR needs modifications before approval. |
| `BITBUCKET_RESOLVE_PULL_REQUEST_COMMENT` | Resolve pull request comment | Tool to resolve or reopen a pull request comment thread. Use when marking a comment as addressed during review or reopening a previously resolved thread. |
| `BITBUCKET_SEARCH_USER_REPOSITORIES_CODE` | Search code in user repositories | Tool to search for code in the repositories of a specified user. Use when you need to find specific code patterns, functions, or text across all repositories owned by a user. |
| `BITBUCKET_UPDATE_INSIGHTS_PROJECTS_REPOS_COMMITS_REPORTS` | Update commit insight report | Create or update an insight report for a commit. Creates a new report if it doesn't exist, or replaces the existing one if a report already exists for the given repository, commit, and report key. Note: replacing an existing report will be rejected if the authenticated user was not the creator of the specified report. |
| `BITBUCKET_UPDATE_ISSUE` | Update an issue | Updates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update. |
| `BITBUCKET_UPDATE_PULL_REQUEST` | Update Pull Request | Tool to update an existing pull request's editable fields (e.g., title, description, reviewers) via the Bitbucket Cloud API. Use when you need to modify a pull request without creating a new one. Only sends fields that are explicitly provided to avoid accidental overwrites. |
| `BITBUCKET_UPDATE_REPOSITORIES_COMMIT_COMMENTS` | Update commit comment | Updates the contents of a comment on a commit. Use when you need to modify an existing comment's text on a commit. |
| `BITBUCKET_UPDATE_REPOSITORIES_COMMIT_REPORTS_ANNOTATIONS` | Update commit report annotation | Creates or updates an individual annotation for a commit report. Use when you need to add or modify code analysis findings (vulnerabilities, code smells, or bugs) identified in a commit. |
| `BITBUCKET_UPDATE_TEAMS_PIPELINES_CONFIG_VARIABLES` | Update team pipeline variable | Updates a team-level pipeline configuration variable in Bitbucket. Use when you need to modify existing environment variables or configuration values that are available to all pipelines within a team. |
| `BITBUCKET_UPDATE_USERS_PIPELINES_CONFIG_VARIABLES` | Update user pipeline variable | Updates a user-level pipeline variable for Bitbucket pipelines. Use when you need to modify account-level configuration variables such as changing the value, key name, or security status. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK
```python
pip install composio_openai
```

```typescript
npm install @composio/openai
```

#### Path 1, Step 2: Initialize Composio and Create Tool Router Session

Import and initialize Composio client, then create a Tool Router session
```python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
```

```typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
```

#### Path 1, Step 3: Execute Bitbucket Tools via Tool Router with Your Agent

Get tools from Tool Router session and execute Bitbucket actions with your Agent
```python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'Create a pull request from feature branch to main in my repository'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
```

```typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'Create a pull request from feature branch to main in my repository'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK and Claude Agent SDK
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
```

#### Path 2, Step 2: Create Tool Router Session

Initialize the Composio client and create a Tool Router session
```python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
```

```typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });

console.log("Creating Tool Router session...");
const { mcp } = await composio.create('your-user-id');
console.log(`Tool Router session created: ${mcp.url}`);
```

#### Path 2, Step 3: Connect to AI Agent

Use the MCP server with your AI agent
```python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Bitbucket tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Create a pull request from feature branch to main')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
```

```typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText, stepCountIs } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: mcp.url,
    headers: { 'x-api-key': 'your-composio-api-key' }
  }
});

const tools = await client.tools();

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{ role: 'user', content: 'Create a pull request from feature branch to main' }],
  stopWhen: stepCountIs( 5 )
});

console.log(`Agent: ${text}`);
```

## Why Use Composio?

### 1. AI Native Bitbucket Integration

- Supports both Bitbucket MCP and direct API based integrations
- Structured, LLM-friendly schemas for reliable tool execution
- Rich coverage for reading, writing, and querying your Bitbucket data

### 2. Managed Auth

- Built-in OAuth handling with automatic token refresh and rotation
- Central place to manage, scope, and revoke Bitbucket access
- Per user and per environment credentials instead of hard-coded keys

### 3. Agent Optimized Design

- Tools are tuned using real error and success rates to improve reliability over time
- Comprehensive execution logs so you always know what ran, when, and on whose behalf

### 4. Enterprise Grade Security

- Fine-grained RBAC so you control which agents and users can access Bitbucket
- Scoped, least privilege access to Bitbucket resources
- Full audit trail of agent actions to support review and compliance

## Use Bitbucket with any AI Agent Framework

Choose a framework you want to connect Bitbucket with:

- [ChatGPT](https://composio.dev/toolkits/bitbucket/framework/chatgpt)
- [Antigravity](https://composio.dev/toolkits/bitbucket/framework/antigravity)
- [OpenAI Agents SDK](https://composio.dev/toolkits/bitbucket/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/bitbucket/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/bitbucket/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/bitbucket/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/bitbucket/framework/codex)
- [Cursor](https://composio.dev/toolkits/bitbucket/framework/cursor)
- [VS Code](https://composio.dev/toolkits/bitbucket/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/bitbucket/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/bitbucket/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/bitbucket/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/bitbucket/framework/cli)
- [Google ADK](https://composio.dev/toolkits/bitbucket/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/bitbucket/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/bitbucket/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/bitbucket/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/bitbucket/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/bitbucket/framework/crew-ai)
- [Pydantic AI](https://composio.dev/toolkits/bitbucket/framework/pydantic-ai)
- [AutoGen](https://composio.dev/toolkits/bitbucket/framework/autogen)

## Related Toolkits

- [Supabase](https://composio.dev/toolkits/supabase) - Supabase is an open-source backend platform offering scalable Postgres databases, authentication, storage, and real-time APIs. It lets developers build modern apps without managing infrastructure.
- [Codeinterpreter](https://composio.dev/toolkits/codeinterpreter) - Codeinterpreter is a Python-based coding environment with built-in data analysis and visualization. It lets you instantly run scripts, plot results, and prototype solutions inside supported platforms.
- [GitHub](https://composio.dev/toolkits/github) - GitHub is a code hosting platform for version control and collaborative software development. It streamlines project management, code review, and team workflows in one place.
- [Ably](https://composio.dev/toolkits/ably) - Ably is a real-time messaging platform for live chat and data sync in modern apps. It offers global scale and rock-solid reliability for seamless, instant experiences.
- [Abuselpdb](https://composio.dev/toolkits/abuselpdb) - Abuselpdb is a central database for reporting and checking IPs linked to malicious online activity. Use it to quickly identify and report suspicious or abusive IP addresses.
- [Alchemy](https://composio.dev/toolkits/alchemy) - Alchemy is a blockchain development platform offering APIs and tools for Ethereum apps. It simplifies building and scaling Web3 projects with robust infrastructure.
- [Algolia](https://composio.dev/toolkits/algolia) - Algolia is a hosted search API that powers lightning-fast, relevant search experiences for web and mobile apps. It helps developers deliver instant, typo-tolerant, and scalable search without complex infrastructure.
- [Anchor browser](https://composio.dev/toolkits/anchor_browser) - Anchor browser is a developer platform for AI-powered web automation. It transforms complex browser actions into easy API endpoints for streamlined web interaction.
- [Apiflash](https://composio.dev/toolkits/apiflash) - Apiflash is a website screenshot API for programmatically capturing web pages. It delivers high-quality screenshots on demand for automation, monitoring, or reporting.
- [Apiverve](https://composio.dev/toolkits/apiverve) - Apiverve delivers a suite of powerful APIs that simplify integration for developers. It's designed for reliability and scalability so you can build faster, smarter applications without the integration headache.
- [Appcircle](https://composio.dev/toolkits/appcircle) - Appcircle is an enterprise-grade mobile CI/CD platform for building, testing, and publishing mobile apps. It streamlines mobile DevOps so teams ship faster and with more confidence.
- [Appdrag](https://composio.dev/toolkits/appdrag) - Appdrag is a cloud platform for building websites, APIs, and databases with drag-and-drop tools and code editing. It accelerates development and iteration by combining hosting, database management, and low-code features in one place.
- [Appveyor](https://composio.dev/toolkits/appveyor) - AppVeyor is a cloud-based continuous integration service for building, testing, and deploying applications. It helps developers automate and streamline their software delivery pipelines.
- [Backendless](https://composio.dev/toolkits/backendless) - Backendless is a backend-as-a-service platform for mobile and web apps, offering database, file storage, user authentication, and APIs. It helps developers ship scalable applications faster without managing server infrastructure.
- [Baserow](https://composio.dev/toolkits/baserow) - Baserow is an open-source no-code database platform for building collaborative data apps. It makes it easy for teams to organize data and automate workflows without writing code.
- [Bench](https://composio.dev/toolkits/bench) - Bench is a benchmarking tool for automated performance measurement and analysis. It helps you quickly evaluate, compare, and track your systems or workflows.
- [Better stack](https://composio.dev/toolkits/better_stack) - Better Stack is a monitoring, logging, and incident management solution for apps and services. It helps teams ensure application reliability and performance with real-time insights.
- [Blazemeter](https://composio.dev/toolkits/blazemeter) - Blazemeter is a continuous testing platform for web and mobile app performance. It empowers teams to automate and analyze large-scale tests with ease.
- [Blocknative](https://composio.dev/toolkits/blocknative) - Blocknative delivers real-time mempool monitoring and transaction management for public blockchains. Instantly track pending transactions and optimize blockchain interactions with live data.
- [Bolt iot](https://composio.dev/toolkits/bolt_iot) - Bolt IoT is a platform for building and managing IoT projects with cloud-based device control and monitoring. It makes connecting sensors and actuators to the internet seamless for automation and data insights.

## Frequently Asked Questions

### Do I need my own developer credentials to use Bitbucket with Composio?

No, you can get started immediately using Composio's built-in Bitbucket app. For production, we recommend configuring your own OAuth credentials.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
