Labsco
MCP SERVER

Bitbucket

by pdogra1299

Work a remote Bitbucket repo like a local clone — regex grep, windowed file reads, PR review and merge.

Git Hosting & Code ReviewVerified
Summary
A remote repo with local-clone ergonomics — grep with regex, read a window rather than a file.

The decision that matters is treating the repository as something you scan instead of something you page through: one archive fetch backs real regex grep on any branch, cached and freshness-checked every call, and file reads transfer only the line window you asked for. Content responses carry the commit they were taken at, and no cap cuts results quietly — a truncated answer arrives with the warning and the way to continue.

What it is

A Bitbucket client built for coding agents. It greps file contents with real regex on any branch, reads file windows without transferring the whole file, and covers pull requests end to end — comments, tasks, review status, diffs, merge. Bitbucket Server and Data Center are the primary target, with Cloud supported.

What you get
  • Repo-wide content search with full regex on any branch, served from one archive download that is cached in process and freshness-checked every call, in content, files or count mode with glob, path and context options
  • Index-backed exact-term search across a whole project in one call, for cross-repo identifier lookups
  • Repositories found by name or description across the instance
  • A pull request's metadata, reviewer status, merge info, comments and changed files in one call, returning a version token that saves a fetch on the follow-up mutation
  • Your own pull requests across every repository in one call, without naming a repository
  • PRs created, updated, merged and declined, with reviewers and approvals preserved unless you pass reviewers explicitly
  • Comments as general, threaded reply, inline by file and line, code suggestion, or a BLOCKER task — then edited, deleted, resolved, reopened, or converted between comment and task
  • Your review status set to APPROVED, NEEDS_WORK or UNAPPROVED in a single call
  • PR diffs as raw unified diff text, scoped by file path or include and exclude globs, with context lines and a whitespace option
  • Commits on a PR or a branch, and one commit as a diff or just its changed-file list
  • Branches listed, one branch with its open PRs, and branch deletion
  • File contents read as a server-side window of up to 5000 lines, or whole-file, or a tail; per-line blame for a window in one call; compact directory listings
  • Attachments downloaded or deleted, and uploaded through the attachments parameter on comments and pull requests
  • Truncation that is never silent — every cap comes with a warning and the way to continue, and content responses carry as_of with the commit they saw
Requirements

BITBUCKET_USERNAME plus a credential, and for Server or Data Center a BITBUCKET_BASE_URL. On Server and Data Center that credential is an HTTP access token in BITBUCKET_TOKEN; on Cloud it is an app password in BITBUCKET_APP_PASSWORD and the base URL is omitted. Runs over stdio through npx @nexus2520/bitbucket-mcp-server. Requests are paced client-side to Data Center's per-user limiter — BITBUCKET_RATE_LIMIT_RPS defaults to 5 and the burst to 50 — so set BITBUCKET_RATE_LIMIT_RPS=0 only when your service account holds an admin rate-limit exemption. The grep cache is capped by BITBUCKET_SNAPSHOT_MAX_MB, default 256. BITBUCKET_TOOL_GROUPS exposes only the groups you name, enforced at dispatch. Search, blame, attachments and cross-repo PR listing are Server and Data Center only.

Setup effort

One command plus a key — npx -y @nexus2520/bitbucket-mcp-server, then supply credentials