Connecting Bitbucket to Claude (MCP and Integrations)

Published:

Updated:

bitbucket integration with claude

Disclaimer

As an affiliate, we may earn a commission from qualifying purchases. We get commissions for purchases made through links on this website from Amazon and other third parties.

Part of our AI Tools guides

https://www.youtube.com/watch?v=z08kBSVFoVs

You can connect Bitbucket to Claude through Atlassian MCP, a local Git workflow, or Bitbucket Pipelines, depending on whether you need remote repository actions, local development, or automation.

An MCP server is a service that lets an AI client use approved tools to work with another system. Cloud and Data Center use different setup paths.

For Bitbucket Cloud, Atlassian MCP supports remote repository and PR work without a local clone. A local clone gives Claude Code files to edit and tests to run.

Bitbucket Pipelines can run repeatable CI/CD tasks. Data Center teams have a separate MCP option, so your product type matters from the start.

This guide helps you choose a useful first step, connect the right client, and keep access within your team’s rules.

Key Takeaways

  • Use Atlassian MCP for supported remote Bitbucket Cloud work in Claude.
  • Use a local clone when Claude Code needs files or local tests.
  • Use Bitbucket Pipelines for repeatable agent tasks.
  • Bitbucket Data Center has a separate MCP plugin and setup path.
  • Start with read-only work before allowing changes.

Start by deciding whether you want Claude to work in a conversation, in a local code folder, or inside a pipeline.

Which Bitbucket Integration With Claude Fits Your Workflow?

For repository questions and supported PR actions, start with Atlassian MCP; choose a local clone for code and tests, or Pipelines for repeatable automated tasks. The right fit depends on where you want Claude to work.

MCP handles supported remote actions, but local tests need a local clone. A Git push also does not create a Bitbucket PR by itself.

Use this comparison to match each integration with the work and boundary that matter to your team.

Setup Where it runs Best fit Main boundary
Atlassian MCP Claude conversation Remote Cloud repository and PR work Supported tools and account access only
Local Git with Claude Code Local clone File edits and local tests Needs a cloned repository and Git access
Agentic Pipelines Pipeline step Repeatable automated tasks Runs within pipeline setup and permissions
Data Center MCP plugin Data Center instance Remote work on a Data Center site Admin controls and caller permissions apply

Pick the place where the work happens

Atlassian MCP is a good integration for asking about Bitbucket Cloud files, commits, and pull requests. It works without a local clone.

The Model Context Protocol specification describes how an AI client can use outside tools and data.

Choose Claude Code with local Git when you need to run a build, check tests, or change files on your device. Remote MCP access does not run your local project.

Agentic Pipelines runs an agent as a pipeline step. That suits repeatable work that starts from a pipeline event or defined process.

Check which Bitbucket product you use

Bitbucket Cloud and Bitbucket Data Center have different connection paths. Data Center has its own MCP plugin, including a version 10.5 release.

Teams comparing code hosts may also weigh pricing, self-hosting, and governance in this guide to code hosting options.

Do not treat a successful Git push as a created PR. Your client must use an available PR tool or another Bitbucket action.

Use the Cloud connector only when your workspace and organization support it; Data Center follows a separate setup path.

Connect Bitbucket Cloud Through Atlassian MCP

Before connecting, confirm that your Atlassian account can access the target Bitbucket Cloud workspace and that the workspace is linked to an Atlassian organization. Both checks matter for Bitbucket tools.

Jira access alone does not confirm Bitbucket access. The linked workspace and your account must allow the repository work you plan to do.

In 2026, Atlassian MCP v2 uses the address https://mcp.atlassian.com/v2/mcp and supports Claude Code and Claude Desktop.

  1. Link the Bitbucket workspace to an Atlassian organization.
  2. Add the Atlassian MCP server in your Claude client.
  3. Sign in with the Atlassian account that can reach the workspace.
  4. Approve the access your organization permits.

Connect Claude or Cowork

In Claude, open connector settings and choose Atlassian. Select connect, sign in, then approve the access request.

For a managed plan, an owner may need to enable the connector first. Ask your plan owner if Atlassian is not available.

Claude can connect while a specific Bitbucket workspace remains out of reach. Check the workspace link and the account tied to your session.

Add Atlassian MCP to Claude Code

For Claude Code, add the MCP server from a terminal with this command:

claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcp

Open a Claude Code session and run /mcp to authenticate. Complete sign-in in the browser, then approve the requested access.

In 2026, Bitbucket Cloud MCP tools appear only when the Bitbucket workspace is linked to an Atlassian organization. The same check applies if the client sees Jira but not Bitbucket.

Approve only the access your organization allows for the workspace you intend to use.

Control Access With OAuth and API Permissions

A successful connection gives Claude only the access allowed by your account and organization. It adds no new rights to your Bitbucket account.

Read and write access are separate controls. A user may connect successfully but lack access to a repository or a write action.

Use this table to see what each access method controls and what to check before blaming the client.

Access method What controls access What to check
OAuth 2.1 Your Atlassian account and existing rights Workspace and repository access
API-token authentication Token permissions and account rights Token scope and intended action
Organization permission groups Admin-granted read or write tools Group access for each tool type

Understand the connection methods

Atlassian MCP uses OAuth 2.1 and follows the access already granted to your Atlassian account. API-token authentication is also supported.

OAuth connects the client to your account; it does not bypass repository permissions. A token also cannot give its user rights the account does not have.

For Bitbucket Cloud, read and write tools belong to separate groups. An organization admin can grant or remove access by permission group.

Check organization and tool access

Check the exact task before asking for broader access. Reading a repository is different from creating a branch or updating a PR.

A user might see repository details but not a write tool. Another user might connect but lack access to one private repository.

Check both the organization’s tool group and the user’s repository permissions. This helps separate an access issue from a client setup issue.

Ask an organization admin to review the relevant permission group before treating a missing tool as a client failure.

Use Claude for Repository and Pull Request Work

Claude sits at a modern desk in a home office, checking a Bitbucket pull request diff and pipeline status on his laptop. Programming books, tech gadgets, an indoor plant, posters, and a bulletin board with notes surround him.
Claude can use Bitbucket to review pull request diffs and check pipeline status, keeping repository work close at hand.

Once connected, Claude can help you inspect repository files, PR changes, discussions, commits, and pipeline results. Start with reading before allowing changes.

Review the exact repository, branch, and diff before approving any change. Your available Bitbucket tools depend on your account and client.

Start with read-only repository questions

Read-only requests give you useful context without changing a branch or PR. Try prompts that name the workspace and task clearly:

  • “List the repositories I can access in the Northstar workspace and summarize this repository’s README.”
  • “Summarize PR 42’s diff and pipeline status. Do not approve or merge it.”
  • “Explain commit abc123 in plain language.”
  • “Review the latest pipeline failure and name the step that failed.”
  • “Use linked Jira work and Confluence decisions to explain this code change.”

Repository browsing, PR lists, diffs, status checks, and pipeline results can answer focused questions. Linked Jira work items, technical decisions, and rollout plans can add useful context.

For example, you can compare a code change with a Jira task and a Confluence decision. That helps you see whether the change matches the planned work.

Review proposed changes before writing

Write tools may create branches, commits, comments, and PRs. They may also update reviewers, depending on your client and authorization.

Ask Claude to explain its proposed edit before you approve or apply it. Check the target repository and branch, then inspect the full diff.

Some clients can create a PR after changes are ready, but a Git push alone cannot do that. The source branch must contain the work, and the PR action must be available.

Check pipeline results and comments as part of your review. A green result does not replace your team’s review of the actual changes.

Keep approval, merge, and other high-impact actions under your team’s normal review process.

Set Up a Local Git Workflow in Claude Code

Choose the local route when you need Claude Code to edit files, run project tests, or work from a folder on your device. Local work needs Git access.

Keep credentials out of chat. Use a scoped API token in your terminal, and store it in a password manager.

Prepare a local clone and test access

The repository must already exist as a local clone before Claude Code can work with its files. Run git remote -v to check the saved remote.

You can test read access without cloning by running this command:

git ls-remote https://x-bitbucket-api-token-auth@bitbucket.org/WORKSPACE/REPOSITORY.git

Replace the workspace and repository names with your own. For HTTPS Git, use a scoped API token, not an account or SSO password.

A token with repository Read permission can view source code and use the file-browsing API, but it does not grant PR access.

Pull-request permissions are not needed for ordinary Git clone or push. Read access supports cloning and reading; pushing needs repository Write access.

Create and push a feature branch

Claude Code can edit files in a new branch and run tests from the local clone. You still choose what to keep and what to push.

  1. Ask Claude Code to create a feature branch for one clear task.
  2. Review the diff and discard changes you did not request.
  3. Run the tests that fit the files Claude changed.
  4. Push only when your token has the needed Git write permission.

For HTTPS Git, use the username x-bitbucket-api-token-auth. The read:repository:bitbucket scope supports clone and read access.

The write:repository:bitbucket scope is needed to push changes. Repository Write does not itself grant PR access.

Never paste API tokens, SSH private keys, or other secrets into a Claude conversation. Enter credentials in your terminal, not in the Claude conversation.

Run Claude Agents in Bitbucket Pipelines

A computer screen shows a Bitbucket Pipelines workflow with a Claude agent provider configuration, code snippets, and colorful graphs. A wooden desk holds office supplies and a potted plant, with bookshelves and a window in the home office behind it.
Run Claude agents in Bitbucket Pipelines by configuring a Claude agent provider, with code snippets and workflow graphs guiding the setup.

For repeatable work that should run with a pipeline, Bitbucket Agentic Pipelines can use Claude as the agent provider. This is for automation, not an interactive chat.

Agentic Pipelines is in open beta. Teams remain responsible for reviewing changes and handling data, security, and costs.

Select Claude as the pipeline provider

Define an agent in bitbucket-pipelines.yml and set provider: claude. That setting selects Claude for the agent step.

Without that line, the default provider is Rovo Dev. Use a clearly defined task, such as drafting a PR description or updating a README.

Teams can also use an agent to sort a security report or investigate a flaky test. A configured flaky-test trigger can start an agent to investigate, test, propose a fix, and open a draft PR.

Start with one narrow process and a clear way to check its output. Broader workflow automation practices can help you set useful controls and alerts.

Keep human review around agent changes

Review the diff and test results before merging any agent change. The pipeline can help with repeated work, but it cannot replace judgment.

When you enable the provider, source code, prompts, and logs go to Claude Code under the Third-Party Product agreement.

Atlassian is not responsible for related privacy, security, or costs. Your team must decide whether that data flow fits its rules.

Check which pipeline steps can access the repository and what data the agent sends. Then set a clear owner for reviewing each draft PR.

Review the pipeline’s access scopes and data handling before enabling it for a repository.

Connect Bitbucket Data Center With Its MCP Plugin

For Bitbucket Data Center, use the dedicated MCP plugin and have an administrator set the tool limits before wider access. Cloud steps do not apply to this setup.

The administrator’s whitelist sets the maximum tools available. Each caller’s token still limits the tools that caller can see.

Bitbucket Data Center 10.5 can expose tools for repositories, branches, tags, commits, files, PRs, and file edits.

Limit the available tools

An administrator sets the maximum tool list in BITBUCKET_HOME/shared/mcp-tools.json. The whitelist controls which MCP actions the instance may offer.

Available actions can include browsing files, creating branches, viewing commits, editing files, and creating or merging PRs.

Default capabilities can include direct file commits and PR merges. Review the whitelist before users connect the plugin.

A caller’s token permissions still shape the tools that caller sees. The whitelist does not give a user rights beyond the token.

The Data Center MCP tool whitelist is an admin control, so set it around actual work needs.

Protect the instance from excess load

MCP requests use the Bitbucket Data Center instance. More client activity can add load, especially when requests repeat or ask for large results.

Atlassian recommends enabling rate limiting if MCP client requests cause heightened instance load. Watch load as more clients and tasks use the plugin.

Keep a record of which tools are enabled and who needs them. Remove actions that have no clear use for the team.

Keep the whitelist narrower than the full tool set when callers do not need every action.

Fix Common Claude and Bitbucket Workflow Problems

When a connection works but a task fails, first identify whether the issue is authentication, pipeline setup, or the PR’s source branch. Check one cause at a time.

A Bitbucket PR needs an existing source branch with the intended changes. A destination branch alone is not enough.

Resolve an older MCP authentication setup

On March 1, 2027, existing Atlassian MCP v1 use is scheduled to expose and use v2 tools automatically.

An incompatible client may need its cached client IDs or .well-known credentials cleared to keep authenticating. Restart the client after clearing its saved data.

Check a failed pipeline agent

Check whether the intended provider is set and whether the agent has the permissions its task needs. Then inspect the pipeline result for the failed step.

A run can fail before Claude starts if the provider setting is wrong. A later failure may point to a task, permission, or test issue.

Confirm the PR source branch

Before retrying PR creation, confirm the source branch exists and contains the intended work. Make sure it differs from the destination branch.

  • Authentication: check the client session and saved login data.
  • Pipeline: check the provider, permissions, and failed step.
  • PR: check that the source branch exists and has the right changes.

If the source branch is missing, push the intended changes before trying to create the PR again.

Conclusion

The right setup is the one that matches where your team needs Claude to work. Use Atlassian MCP for supported remote work, and a local clone for local development.

Start with a read-only repository request and check the result before enabling write actions. That small test can confirm the account, workspace, and client work together.

Connect the option that fits your workflow, test it with a read-only request, and add write access only when your team is ready.

FAQ

Can Claude read a Bitbucket repository without cloning it?

Yes, supported Atlassian MCP tools can read Bitbucket Cloud data remotely without a local clone. Your account still needs access to the workspace and repository. A local clone is useful when Claude Code must edit files, run tests, or work with local project tools. Remote reading does not run your code or test your local setup.

Does connecting Claude give it access to every Bitbucket workspace?

No, connecting Claude does not grant access to every Bitbucket workspace. The target workspace must link to an Atlassian organization, and your account must have the needed rights. Organization settings can also limit the tools Claude may use. A successful sign-in alone does not confirm that a private repository or write action is available.

Do I need a Bitbucket API token to use Atlassian MCP?

No, Atlassian MCP uses OAuth 2.1, and API-token connections are also supported. For local HTTPS Git, use a scoped API token rather than an account or SSO password. The token needs the right Git scope for the action, such as reading or pushing. Keep tokens in a password manager, not in a Claude chat.

Can Claude create and merge Bitbucket pull requests?

Claude can create or merge a pull request only when the needed tools and permissions are available. PR creation also needs an existing source branch with the intended changes. A Git push alone does not open a PR. Review the branch and diff, and keep approval and merge actions within your team’s normal controls.

Can Claude run inside Bitbucket Pipelines?

Yes, Agentic Pipelines supports Claude as a provider and is in open beta. Set provider: claude in the agent setup to select Claude; leaving it out defaults to Rovo Dev. Pipeline runs can send source code, prompts, and logs to Claude Code. Review the data flow and costs before enabling it.

What should I do if an older Atlassian MCP client stops authenticating?

The v1-to-v2 transition is scheduled for March 1, 2027. Existing v1 use is scheduled to expose and use v2 tools automatically, but an incompatible client may still fail to authenticate. Clear cached client IDs or .well-known credentials if needed, then restart the client and sign in again. Check the client’s saved authentication data first.

About the author

Latest Posts