@droplinkperformance/bitbucket-mcp-server
@droplinkperformance/bitbucket-mcp-server
Providerunabhängiger, KI-Review-first Model Context Protocol (MCP)-Server für Bitbucket Cloud.
Der primäre Wert dieses Servers liegt in der KI-gestützten Code-Review- und Pull-Request-Analyse, nicht in CRUD-Operationen gegen die Bitbucket-API. Jede wesentliche Abhängigkeit (SCM-Zugriff, Cache, Token-Speicherung, Rate Limiting, LLM, Events) ist hinter einer providerunabhängigen Schnittstelle verborgen, sodass dieselbe Geschäftslogik später GitHub / GitLab / Azure DevOps und OpenAI / Anthropic / Gemini / Bedrock ansprechen kann, ohne Änderungen an Use-Cases, Agents oder Domain-Verträgen.
Status: Phase 1. Siehe Roadmap.
Funktionen (Phase 1)
Duale Transporte: stdio (Cursor / Claude Desktop) und Streamable HTTP (Node
http, für Remote-/Produktionsumgebungen).Automatisch erkannte Tools über eine
ToolRegistry– keine manuelle Registrierung.Expliziter
BitbucketContext(workspace+ optionalrepository) für jedes Tool – Multi-Workspace-fähig.Robuster
BitbucketClient: Auth-Injektion, automatische Paginierung, Retry/Backoff, Rate-Limit-Handling, Caching, Secret-Masking.Zwei Auth-Strategien: OAuth 2.0 (Authorization Code, mit rotierender Refresh-Token-Persistenz) und Bearer-Token.
KI-Code-Review (
analyze_pull_request), unterstützt von einemCodeReviewAgent, der große PRs in Blöcke zerlegt und ein standardisiertesReviewResultzurückgibt.Steckbare LLM-Provider (OpenAI / Anthropic / Gemini / Bedrock), Cache (memory / Redis) und Token-Speicher (file / memory / Redis).
Tools
Tool | Beschreibung |
| Angemeldeter Benutzer. |
| PRs auflisten (nach Status/Query filtern). |
| Einen PR per ID abrufen. |
| Einen PR erstellen. |
| Roh-Unified-Diff. |
| Geänderte Dateien + Zeilenstatistiken. |
| PR-Kommentare. |
| Einen (optional inline) Kommentar hinzufügen. |
| KI-Review, das ein standardisiertes |
Alle Tool-Eingaben akzeptieren workspace (optional, wenn BITBUCKET_DEFAULT_WORKSPACE gesetzt ist) und, wo zutreffend, repository.
Related MCP server: Atlassian Bitbucket MCP Server
Architektur
src/
index.ts entry: chooses transport
container.ts composition root (the only place wiring concretes)
mcp/ McpServer + ToolRegistry (auto-discovery) + transports
tools/ thin MCP adapters (*.tool.ts) -> call exactly one use-case
application/ use-cases (CQRS-ish: command|query) with Input/Output DTOs
agents/ autonomous workflows implementing Agent<TInput,TOutput>
domain/ provider-agnostic types, repository contracts, ReviewResult
repositories/bitbucket/ Bitbucket implementations of the contracts
clients/bitbucket/ resilient REST client
auth/ AuthProvider (+ token/oauth) and TokenStore implementations
cache/ CacheProvider (+ memory/redis)
ratelimit/ RateLimitStrategy (+ bitbucket)
llm/ LlmProvider (+ openai/anthropic/gemini/bedrock)
events/ EventBus (+ in-memory)
services/ reusable services (masking, chunking)
telemetry/ OpenTelemetry bootstrap + metrics
infrastructure/ config, logger, http, attachments
shared/ errors, result envelope, http-status, BitbucketContextAblauf: tool -> use-case -> (agent | repository contract) -> repositories/bitbucket -> BitbucketClient. Agents können auch den LlmProvider und den EventBus verwenden. Tools enthalten niemals Geschäftslogik.
Voraussetzungen
Node.js 23+
Installation
Veröffentlicht als @droplinkperformance/bitbucket-mcp-server.
npx -y @droplinkperformance/bitbucket-mcp-serverAus dem Quellcode:
npm install
npm run buildRelease
Bei Merges in main wird .github/workflows/release.yml ausgeführt: Tests, Build, dann semantic-release. Versionierung und npm-Publish erfolgen nur, wenn der Merge Conventional Commits enthält:
Commit | Bump |
| patch |
| minor |
| major |
Andere Nachrichten überspringen das Publish. Das GitHub-Secret NPM_TOKEN (npm-Automation-Token für die Organisation droplinkperformance) ist erforderlich.
Nach einem erfolgreichen npm-Release veröffentlicht derselbe Workflow Metadaten im MCP Registry als io.github.droplinkperformance/bitbucket-mcp-server (OIDC, kein zusätzliches Secret). github.com/mcp wird aus diesem Registry synchronisiert; wenn der Server nicht erscheint, senden Sie eine E-Mail an partnerships@github.com.
Um für das erste Release bei 0.x zu bleiben, taggen Sie den aktuellen Commit (git tag v0.1.0 && git push origin v0.1.0) vor dem ersten konventionellen Merge; andernfalls beginnt semantic-release bei 1.0.0.
Konfiguration
Kopieren Sie .env.example nach .env und füllen Sie die Werte aus. Laden Sie es mit dem eingebauten Node-Flag:
node --env-file=.env dist/index.jsWichtige Variablen:
Variable | Default | Hinweise |
|
|
|
|
| HTTP-Transport-Bind. |
| – | Fallback, wenn ein Tool |
| – | API-Token (ATATT…), App-Passwort oder OAuth-Zugriffstoken |
| – | Erforderlich bei API-Tokens (ATATT…) – Ihre Atlassian-Konto-E-Mail |
| – | Erforderlich für OAuth (wenn kein Zugriffstoken vorhanden ist). |
| – | Optionaler Seed für Headless-OAuth. |
|
|
|
|
|
|
|
|
|
|
| Schwellenwerte für die Aufteilung großer PRs. |
|
| No-op-Metriken, sofern nicht aktiviert. |
Authentifizierung
Bearer (OAuth-Zugriffstoken): setzen Sie nur BITBUCKET_ACCESS_TOKEN (nicht-ATATT-Tokens).
API-Token (empfohlen, ATATT…): setzen Sie BITBUCKET_ACCESS_TOKEN und BITBUCKET_EMAIL (Ihre Atlassian-Konto-E-Mail aus Bitbucket → Persönliche Einstellungen → E-Mail-Aliase). API-Tokens verwenden HTTP-Basic-Auth, nicht Bearer.
App-Passwort (Legacy, bis Juni 2026): setzen Sie BITBUCKET_ACCESS_TOKEN und BITBUCKET_USERNAME (Ihren Bitbucket-Benutzernamen).
OAuth 2.0 (Authorization Code): setzen Sie BITBUCKET_CLIENT_ID / BITBUCKET_CLIENT_SECRET. Tokens werden vom konfigurierten TOKEN_STORE persistiert; Bitbucket rotiert Refresh-Tokens, und der Server persistiert das neue Token bei jedem Refresh. Für den Headless-Start geben Sie ein zuvor erhaltenes BITBUCKET_REFRESH_TOKEN an.
Verwendete Bitbucket-OAuth-Endpunkte: authorize https://bitbucket.org/site/oauth2/authorize, token https://bitbucket.org/site/oauth2/access_token. Die Authorize-URL kann aus OAuthProvider.buildAuthorizeUrl() erstellt und das zurückgegebene ?code= über OAuthProvider.loginWithCode(code) eingetauscht werden.
LLM-Provider
Setzen Sie LLM_PROVIDER und den passenden Schlüssel:
LLM_PROVIDER=openai # OPENAI_API_KEY
LLM_PROVIDER=anthropic # ANTHROPIC_API_KEY
LLM_PROVIDER=gemini # GEMINI_API_KEY
LLM_PROVIDER=bedrock # AWS creds + BEDROCK_MODEL_ID (needs @aws-sdk/client-bedrock-runtime)ioredis (Redis-Provider) und @aws-sdk/client-bedrock-runtime (Bedrock) sind optional und werden lazy geladen – nur erforderlich, wenn ausgewählt.
Ausführen
stdio
MCP_TRANSPORT=stdio node --env-file=.env dist/index.jsStreamable HTTP
MCP_TRANSPORT=http HTTP_PORT=3000 node --env-file=.env dist/index.js
# health: GET http://localhost:3000/health
# endpoint: POST http://localhost:3000/mcpMCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsCursor
~/.cursor/mcp.json (oder .cursor/mcp.json im Projekt):
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@droplinkperformance/bitbucket-mcp-server"],
"env": {
"MCP_TRANSPORT": "stdio",
"BITBUCKET_ACCESS_TOKEN": "ATATT-your-api-token",
"BITBUCKET_EMAIL": "you@company.com",
"BITBUCKET_DEFAULT_WORKSPACE": "your-workspace",
"LLM_PROVIDER": "openai",
"OPENAI_API_KEY": "sk-..."
}
}
}
}Claude Desktop
claude_desktop_config.json:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@droplinkperformance/bitbucket-mcp-server"],
"env": {
"BITBUCKET_ACCESS_TOKEN": "your-token",
"BITBUCKET_DEFAULT_WORKSPACE": "your-workspace",
"LLM_PROVIDER": "anthropic",
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Entwicklung
npm run dev # tsx watch (stdio)
npm run typecheck
npm run lint
npm test
npm run test:coverageRoadmap
Phase 1 (dieses Release): Auth, Abstraktionen,
BitbucketClient, automatische Tool-Erkennung, PR-Tools,analyze_pull_request.Phase 2: Pipelines + Volltext-Logs mit Paginierung,
pipeline-investigator-Agent,auto_review_pull_request(Dry-Run / Inline-Kommentare veröffentlichen).Phase 3: Restliches CRUD – Repositories, Commits, Branches, Tags, Issues, Workspaces, Mitglieder, Suche.
Phase 4:
analyze_dotnet_pull_request(dotnet-review-Agent), erweiterte Agents, Automatisierungs-Workflows.Phase 5: Docker, Compose, Helm, Leitfaden für Produktions-Deployments.
Lizenz
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables management of Bitbucket Cloud pull requests through natural language, including creating, reviewing, approving, and commenting on PRs with automatic default reviewer support.791MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to interact with Bitbucket Cloud and self-hosted instances for pull request reviews, code search, repository operations, and managing PR comments and approvals.19GPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to interact with Bitbucket repositories, primarily focusing on retrieving and reviewing pull request context. It provides a suite of tools for repository operations, allowing users to manage pull requests and explore Bitbucket resources through the Model Context Protocol.75 npmISC
- AlicenseAqualityDmaintenanceEnables LLMs to review Bitbucket pull requests with custom checklists and API token authentication.51MIT