How to connect Bitbucket to Claude Cowork

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Bitbucket logo
Claude Cowork logo
divider

Introduction

Cowork is Anthropic's AI agent for knowledge work. Think of it as Claude Code for everything else. It works autonomously with your computer, local files, and applications to accomplish complex tasks.

This guide walks you through the easiest and most secure way to connect your Bitbucket account to Cowork via Composio Connect, enabling it to create a new branch off main, open a pull request for your feature, comment on the latest open issue, and more such actions on your behalf without compromising your account security.

Also integrate Bitbucket with

Connecting Bitbucket to Claude Cowork

1. Open Customize

In Claude Desktop, click Customize in the left sidebar, then select Connectors and click the + icon at the top.

Claude Desktop connectors screen with Add custom connector selected

2. Add the Composio MCP server

Click Add custom connector and paste in the Composio MCP server URL:

bash
https://connect.composio.dev/mcp
Add custom connector dialog with Composio MCP server URL

3. Authorize in your browser

Click Connect. You'll be redirected to a browser window where you can authorize Composio to continue.

Composio authorization screen for Claude Cowork

4. Connect your Bitbucket account

Back in Cowork, ask the agent to connect to Bitbucket or give it any Bitbucket-related task.

For example, ask Cowork to:

  • "Create a new branch off main"
  • "Open a pull request for your feature"
  • "Comment on the latest open issue"

It will prompt you to authenticate and authorize access.

That's it. Composio's tools are now available in Cowork, and your Bitbucket account is ready to use.

What is Claude Cowork?

Claude Cowork is Anthropic's agent for general knowledge work. It can use your computer, files, and connected applications to complete longer-running tasks across your work tools.

With Composio Connect, Cowork can securely access apps like Bitbucket through MCP without you sharing account credentials directly with the agent.

What is the Bitbucket MCP server, and what's possible with it?

The Bitbucket MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Bitbucket account. It provides structured and secure access to your repositories, issues, and pull requests, so your agent can create branches, manage issues, review code, and handle repository operations for you.

  • Branch and repository management: Let your agent create new branches for feature work or initialize fresh repositories within your Bitbucket workspace—no manual setup required.
  • Automated issue tracking: Have your agent create, comment on, or delete issues to streamline team collaboration and bug tracking directly from your workflows.
  • Pull request automation: Empower your agent to open new pull requests for code review, ensuring changes are properly tracked and integrated.
  • File and snippet operations: Ask your agent to fetch specific files from any branch or commit, or to post comments on code snippets for contextual discussions.
  • User profile and workspace insights: Retrieve your Bitbucket user profile details on demand, making it easy to personalize and audit agent-driven actions.

Supported Tools & Triggers

Tools
Approve Pull RequestTool to approve a pull request as the authenticated user.
Browse repository pathTool to retrieve content for a file path or browse directory contents at a specified revision in a Bitbucket repository.
Create a branchCreates 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.
Create an issueCreates 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.
Create an issue commentAdds a new comment with markdown support to an existing Bitbucket issue.
Create a pull requestCreates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch.
Create pull request commentCreates a new comment on a Bitbucket pull request.
Create commit report annotationsAdds multiple annotations to a commit report in bulk.
List commits from revision (POST)Tool to list commits from a revision using POST method.
Create repositoryCreates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if `project_key` is not provided.
Create snippet commentPosts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet.
Create team pipeline variableCreates a team-level pipeline configuration variable in Bitbucket.
Create user pipeline variableCreates a user-level pipeline variable for Bitbucket pipelines.
Delete commit commentPermanently deletes a specific comment on a commit.
Delete issuePermanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`.
Delete pull request commentPermanently deletes a specific pull request comment (top-level, inline, or threaded reply).
Delete commit report annotationDeletes a single annotation matching the provided ID from a commit report.
Delete repositoryPermanently deletes a specified Bitbucket repository; this action is irreversible and does not affect forks.
Delete snippet watchStops watching a specific snippet.
Delete user pipeline variablePermanently deletes a user-level pipeline configuration variable identified by its UUID.
Get branchRetrieves detailed information about a specific branch in a Bitbucket repository.
Get Commit Build StatusGet a specific build status for a commit in Bitbucket.
Get Commit ChangesTool to retrieve a page of changes made in a specified commit, showing all changed files with their change statistics (lines added/removed, status).
Get commit commentRetrieves a specific comment from a commit by its ID.
Get Commit DiffTool to retrieve the unified diff between two provided revisions or for a single commit in a Bitbucket repository.
Get current user (v2)Tool to retrieve complete profile information for the currently authenticated Bitbucket user.
Get deployment environment variablesRetrieves deployment environment level variables for a specific Bitbucket repository environment.
Get file from repositoryRetrieves 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.
Get hook eventsRetrieves a paginated list of all valid webhook events for a specified entity type (repository or workspace).
Get OpenID configuration for OIDC in PipelinesRetrieves the OpenID Connect discovery configuration for Bitbucket Pipelines OIDC.
Get Pull RequestGet a single pull request by ID with complete details.
Get pull request commentTool to retrieve a specific comment from a pull request by its ID.
Get Pull Request CommitsTool to retrieve commits for a specified pull request.
Get Pull Request DiffTool to fetch the unified diff for a Bitbucket pull request (follows 302 redirect to repository diff).
Get Pull Request DiffstatTool to get the diffstat for a Bitbucket pull request, showing all changed files with their change statistics (lines added/removed, status).
Get Repository Branching ModelReturn the branching model as applied to the repository.
Get Repository CommitTool to retrieve detailed information about a specific commit in a Bitbucket repository.
Get commit commentsRetrieves all comments on a specific commit in a Bitbucket repository.
Get commit reportReturns a single report matching the provided ID from a commit.
Get Commit ReportsTool to get reports linked to a specific commit.
Get commit report annotationReturns a single annotation matching the provided ID from a commit report.
Get commit statusesReturns all build statuses (e.
Get effective branching modelRetrieves the effective branching model for a Bitbucket repository, showing which branching model is currently applied (including any inheritance from project-level settings).
Get Repository EnvironmentRetrieve detailed information about a specific deployment environment in a Bitbucket repository.
Get file commit historyReturns a paginated list of commits that modified the specified file.
Check if user voted for issueTool to check whether the authenticated user has voted for a specific issue in a Bitbucket repository.
Get Repositories Merge BaseGet the merge base (best common ancestor) between two commits in a Bitbucket repository.
Get specific pipelineRetrieve a specified pipeline from a Bitbucket repository.
Get repository pipelines cachesRetrieves the repository pipelines caches.
Get repository pipeline runnersRetrieves the list of self-hosted runners configured for a repository's pipelines.
Get repository pipeline schedulesRetrieves configured pipeline schedules for a Bitbucket repository.
Get repository SSH known hostsRetrieves repository-level SSH known hosts configured for Bitbucket Pipelines.
Get repository pipeline variablesRetrieves repository-level pipeline variables for a specific Bitbucket repository.
Get pipeline stepsRetrieves all steps for a given pipeline.
Get pull requests activity logGet paginated activity log for all pull requests in a repository.
Get pull request commentsRetrieves a paginated list of comments on a specific pull request in a Bitbucket repository.
Get pull request statusesReturns all build statuses (e.
Get repository refsReturns the branches and tags in the repository.
Get tagRetrieves detailed information about a specific tag in a Bitbucket repository.
Get repositories srcLists the contents of the root directory on the repository's main branch without needing to specify a commit or branch.
Get repository watchersRetrieves a paginated list of all the watchers on the specified repository.
Get repositoryRetrieves detailed information about a specific repository in a Bitbucket workspace.
Get Repository PatchTool to retrieve the git patch content for a Bitbucket repository at a specified revision or commit range.
Get snippetRetrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure.
Get snippet watch statusChecks if the current user is watching a specific snippet.
Get SSH keys for userRetrieves a paginated list of SSH keys for a specified Bitbucket user.
Get userRetrieves public profile information for a specific Bitbucket user by username or UUID.
Get user emailsReturns all the authenticated user's email addresses, both confirmed and unconfirmed.
Get user email detailsRetrieves details about a specific email address for the authenticated user.
Get user permissions for repositoriesReturns an object for each repository the caller has explicit access to, including their permission level.
Get user permissions for workspacesRetrieves workspace memberships and permission levels for the authenticated user.
Get user workspacesTool to retrieve all workspaces accessible to the authenticated user.
Get workspaceRetrieves detailed information about a specific Bitbucket workspace.
Get Workspace Pull Requests by UserTool to get all workspace pull requests authored by a specified user.
Search code in workspaceTool to search for code in the repositories of the specified workspace.
List branchesLists branches in a Bitbucket repository with optional server-side filtering by name pattern (BBQL) and sorting.
List commitsTool to retrieve a page of commits from a Bitbucket repository.
List commits from revisionTool to list commits starting from a specific revision in a Bitbucket repository.
List commits on masterLists commits on the master branch of a Bitbucket repository.
List deploymentsLists deployments for a specified Bitbucket repository.
List issues in a repositoryLists issues in a Bitbucket repository with optional filtering by state, priority, kind, or assignee.
List pipelinesTool to find pipelines in a Bitbucket repository.
List pull requestsLists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED).
List pull request tasksLists all tasks associated with a pull request in a Bitbucket repository.
List all public repositoriesRetrieves a paginated list of all public repositories on Bitbucket.
List repository environmentsList all deployment environments configured for a Bitbucket repository.
List repositories in workspaceLists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results.
List repository pathsLists 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.
List snippetsReturns all snippets accessible to the authenticated user.
List tagsLists tags in a Bitbucket repository with optional server-side filtering by name pattern or commit hash (BBQL) and sorting.
List versionsLists versions (milestones) in a Bitbucket repository's issue tracker.
List workspace membersLists all members of a specified Bitbucket workspace; the workspace must exist.
List workspace projectsLists projects in a specified Bitbucket workspace.
List workspacesLists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted.
Merge Pull RequestTool to merge a Bitbucket Cloud pull request via the REST API.
Request Pull Request ChangesTool to request changes on a pull request as the authenticated user.
Resolve pull request commentTool to resolve or reopen a pull request comment thread.
Search code in user repositoriesTool to search for code in the repositories of a specified user.
Update commit insight reportCreate or update an insight report for a commit.
Update an issueUpdates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update.
Update Pull RequestTool to update an existing pull request's editable fields (e.
Update commit commentUpdates the contents of a comment on a commit.
Update commit report annotationCreates or updates an individual annotation for a commit report.
Update team pipeline variableUpdates a team-level pipeline configuration variable in Bitbucket.
Update user pipeline variableUpdates a user-level pipeline variable for Bitbucket pipelines.

How to build Bitbucket MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Bitbucket MCP?

With a standalone Bitbucket MCP server, the agents and LLMs can only access a fixed set of Bitbucket tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Bitbucket and many other apps based on the task at hand, all through a single MCP endpoint.

Can I use Tool Router MCP with Claude Cowork?

Yes, you can. Claude Cowork fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Bitbucket tools.

Can I manage the permissions and scopes for Bitbucket while using Tool Router?

Yes, absolutely. You can configure which Bitbucket scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Bitbucket data and credentials are handled as safely as possible.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.