Bitbucket

Lightweight, dependency-free, in-memory Bitbucket Cloud API 2.0 fake for testing code that uses the raw Bitbucket REST API or the bitbucket Node SDK.

Default port: 4769

Quick start

import { BitbucketServer } from "./services/bitbucket/src/server.js";

const server = new BitbucketServer(4769);
await server.start();
// ... run your app/tests ...
await server.stop();

Point a client at it:

const res = await fetch("http://127.0.0.1:4769/2.0/user", {
  headers: { Authorization: "Bearer bbp_parlel" },
});
const user = await res.json();
// user.username => "parlel-user"

Access via MCP / preview URL

Both Authorization: Bearer <token> and HTTP Basic (app-password) auth are accepted.

Implemented operations

All /2.0/* routes require Authorization: Bearer <token> or Authorization: Basic <creds>. Collections use the Bitbucket paginated envelope { values, page, size, pagelen }. State is in-memory and ephemeral.

Service & inspection (parlel extensions)

Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

FeatureStatus
GET /2.0/user✅ Supported
Repositories list / get / create / update / delete✅ Supported
Pull requests create / list / get / update✅ Supported
Paginated envelope { values, page, size, pagelen }✅ Supported
Basic / Bearer auth✅ Required (any non-empty credential)
Real cursor pagination (next/previous links)⟳ Roadmap — Single page only
Commits / branches / pipelines / webhooks⟳ Roadmap
PR merge / approve / decline⟳ Roadmap — State stays OPEN
Scope enforcement✓ By design — Any non-empty credential is accepted — no real secrets needed

Error codes & shapes

Bitbucket error envelope: { "type": "error", "error": { "message": "..." } }.

StatusWhen
401missing/invalid authorization
400missing required field (e.g. PR title)
404unknown resource
405method not allowed

Manifest

See services/bitbucket/manifest.json:

<!-- parlel:testenv:start -->

Configuration — test.env

Copy these into your test.env (used by the bridge sidecar flow). Tokens are Parlel's seeded test credentials — any non-empty value is accepted by the emulator, so you rarely need to change them. Swap in real credentials only when pointing at the live service in prod.env.

BITBUCKET_TOKEN=bbp_parlel
BITBUCKET_API_URL=http://parlel-bridge:4769
<!-- parlel:testenv:end -->