Connector guide8-minute read25 MCP tools7 languages

How to Connect Bitbucket to Gemini via MCP

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

HCBy HelpCode teamUpdated 8 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Bitbucket

Bitbucket

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

tools

25

Region

INTL

Category

Infrastructure

Authentication

Bearer Token

Required env vars

BITBUCKET_API_TOKEN
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Bitbucket in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Try asking

Example prompts for Bitbucket

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Bitbucket · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Bitbucket, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Bitbucket + Gemini

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

BITBUCKET_API_TOKEN

Step 1 — Get credentials

  1. Sign in at https://id.atlassian.com/manage-profile/security/api-tokens (Security → API tokens in your Atlassian account) and click Create API token with scopes.
  2. Give the token a name (for example AnythingMCP), pick an expiry date and choose the app Bitbucket.
  3. Tick the read scopes read:user:bitbucket, read:workspace:bitbucket, read:repository:bitbucket, read:pullrequest:bitbucket and read:pipeline:bitbucket. Add write:pullrequest:bitbucket to create, comment on, approve and merge pull requests, and write:pipeline:bitbucket to start pipelines.
  4. Copy the token (it starts with ATATT) and paste it into BITBUCKET_API_TOKEN without the word Bearer, then install the connector. The connector sends it as a Bearer token, so your Atlassian email is not needed.
  5. Check the setup with bitbucket_get_current_user, then bitbucket_list_workspaces.

App passwords no longer work: Bitbucket stopped creating them on 9 September 2025 and switched off the remaining ones on 28 July 2026. Use an API token with scopes as above. A repository, project or workspace access token (Repository settings → Access tokens; project and workspace tokens need a Premium plan) also works in the same field, but it acts as a bot limited to that repository, project or workspace: bitbucket_get_current_user and bitbucket_list_workspaces may be refused, and anything outside its reach answers 403 or 404.

Who sees what: the AI acts as the user behind the token and sees and changes exactly what that user and the ticked scopes allow. Without the two write scopes the token stays read-only.

Changes real branches and reaches your team, so the AI asks first: bitbucket_create_pull_request opens a pull request in your name (the source branch must already be pushed). bitbucket_add_pull_request_comment posts a general comment, a reply or a code comment on a line, which everyone on the pull request sees and may get notified about. bitbucket_approve_pull_request adds your approval, which counts toward merge checks. bitbucket_merge_pull_request changes the destination branch for everyone, may start deployment pipelines and, with close_source_branch, deletes the source branch; the AI checks state and approvals with bitbucket_get_pull_request first. bitbucket_run_pipeline uses build minutes and runs whatever the pipeline does, deploy steps included. Before each of them the AI tells you the repository, the branches, the pull request and the merge strategy or pipeline, and waits for your yes. Nothing is switched off at install, and no tool deletes repositories, branches or comments, apart from the source branch on a merge with close_source_branch.

How to work: bitbucket_list_workspaces gives the workspace slug and bitbucket_list_repositories the repository slug; both are in the address bitbucket.org/<workspace>/<repo>. Code: bitbucket_get_repository (main branch), bitbucket_list_branches, bitbucket_list_commits, bitbucket_get_commit and bitbucket_get_file (a file's text or a folder listing). Reviews: bitbucket_list_pull_requests, bitbucket_get_pull_request, bitbucket_get_pull_request_diffstat for the size of the change, then bitbucket_get_pull_request_diff, bitbucket_list_pull_request_commits and bitbucket_list_pull_request_comments. Deployments: bitbucket_list_environments and bitbucket_list_deployments.

Pipelines: bitbucket_list_pipelines, then bitbucket_get_pipeline, bitbucket_list_pipeline_steps and bitbucket_get_pipeline_step_log for the failing step. Pipeline and step uuids include curly braces; the AI passes them exactly as returned. Step logs over 200 KB are cut and keep the beginning, while the error is usually at the end, so for long logs the AI reads the end with a range such as bytes=-150000 (the last 150 KB). Diffs and files are also cut at 200 KB.

Lists and filters: a list answer carries next when there is another page; the AI calls again with page (a number for most lists, an opaque token for commits), and pagelen sets the page size. q takes Bitbucket's query language, for example name ~ "api" or destination.branch.name = "main".

No issues or wikis: Bitbucket removed its built-in issue tracker and wiki on 20 August 2026 (the API answers 410), so this connector has no tools for them. For issues, add a Jira connector.

Common errors: 401: the token is wrong, expired or revoked, or it is an old app password; create an API token with scopes. 403: a scope is missing (the message names it) or the user lacks permission. 404: the workspace, repository or item does not exist, or the token cannot see it. 429: the hourly rate limit is reached; wait and retry.

The connector does not cover creating or deleting repositories and branches, editing files or pushing commits, declining pull requests, stopping pipelines, repository variables and settings, or administration.

Step 2 — Install the adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Step 3 — Add the connector in Gemini

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:

{
  "mcpServers": {
    "anythingmcp": {
      "httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of YOUR_MCP_API_KEY.
  2. Save the file and restart gemini.
  3. Run /mcp inside Gemini CLI (or gemini mcp list in your shell): anythingmcp should show as connected.
  4. Start prompting: Gemini CLI can now call the Bitbucket tools.

Available tools

ToolWhat it does
bitbucket_get_current_userGet the Bitbucket account the token belongs to: display name, nickname, uuid, account_id and profile link
bitbucket_list_workspacesList the workspaces the token's user belongs to: slug, name, uuid and whether the user is an administrator there
bitbucket_list_repositoriesList repositories in a workspace, most recently updated first: full_name, slug, description, private flag, language, main branch, project…
bitbucket_get_repositoryGet one repository: description, main branch, project, privacy, language, size, fork parent, clone URLs and web link
bitbucket_list_branchesList branches of a repository with the latest commit of each (hash, date, message, author)
bitbucket_list_commitsList commits newest first: hash, date, message, author and parents
bitbucket_get_commitGet one commit: full hash, date, full message, author, parents and web link
bitbucket_get_fileRead a file or list a folder at a commit or branch
bitbucket_list_pull_requestsList pull requests of a repository, open ones by default: id, title, state, draft, author, source and destination branch, comment and task…
bitbucket_get_pull_requestGet one pull request: title, description, state, branches and commits, merge commit, reviewers and participants with their approval state…
bitbucket_get_pull_request_diffstatList the files a pull request changes: status (added, removed, modified, renamed), old and new path, lines added and removed
bitbucket_get_pull_request_diffRead the unified diff of a pull request as plain text
bitbucket_list_pull_request_commitsList the commits a pull request contains, newest first: hash, date, message and author
bitbucket_list_pull_request_commentsList comments on a pull request, oldest first: id, author, text, inline position (file and line) for code comments, parent id for replies…
bitbucket_create_pull_requestOpen a pull request from a source branch into a destination branch of the same repository, as the token's user
bitbucket_add_pull_request_commentPost a comment on a pull request as the token's user: a general comment, a reply (parent) or a code comment on a line (inline)
bitbucket_approve_pull_requestApprove a pull request as the token's user
bitbucket_merge_pull_requestMerge an open pull request into its destination branch
bitbucket_list_pipelinesList Bitbucket Pipelines runs of a repository, newest first: uuid, build number, state (PENDING, IN_PROGRESS, COMPLETED), result…
bitbucket_get_pipelineGet one pipeline run: state, result, branch or tag, commit, custom pipeline name, trigger, creator, start, end and duration
bitbucket_list_pipeline_stepsList the steps of a pipeline run: uuid, name, state, result, start, end, duration, build image name and script command names
bitbucket_get_pipeline_step_logRead the log of one pipeline step as plain text
bitbucket_run_pipelineStart a Bitbucket Pipelines run on a branch or tag, optionally a custom pipeline from bitbucket-pipelines.yml
bitbucket_list_environmentsList the deployment environments of a repository (for example Test, Staging, Production): uuid, name, type, rank and lock state
bitbucket_list_deploymentsList deployments of a repository: environment uuid, state (UNDEPLOYED, IN_PROGRESS, COMPLETED), status (SUCCESSFUL, FAILED, STOPPED), who…

Example prompts

  • "Which pull requests in acme/web-app are still open, who opened them, and which ones have no approval yet?"
  • "Review pull request #42 in web-app: summarise the changed files, flag risky changes and list the open review comments."
  • "Why did the last pipeline on main fail? Read the log of the failing step and show me the error."
  • "Merge pull request #42 into main with squash once it has two approvals. Show me the branches and the merge strategy and ask me before you merge."
  • "What was last deployed to Production, when, by whom, and which commit did it release?"

FAQ

Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.

Next steps

Was this guide helpful?

Your Bitbucket agent is one click away.

Install the connector, paste the key, prompt Gemini. Free for 7 days, no credit card.

Related guides

Connectors

Bitbucket to MCP: Code Reviews, Pull Requests and Pipelines in any AI Agent

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Connectors

How to Connect Bitbucket to ChatGPT via MCP

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Connectors

How to Connect Bitbucket to Claude via MCP

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Connectors

How to Connect Bitbucket to Cursor via MCP

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Connectors

How to Connect Bitbucket to Meta Muse via MCP

Let your AI work in Bitbucket Cloud: browse repositories, branches, commits and files, review pull requests with diffs and comments, approve, comment and merge after you confirm, and check Bitbucket Pipelines runs, step logs and deployments.

Connectors

How to Connect Avito to Gemini via MCP

Let your AI work with your Avito business account: list your ads and change their prices, read views, contacts and calls statistics, check autoload uploads and their errors, the feed format and your wallet, and read Avito Messenger chats. Sending messages and changing autoload settings are optional and off by default.