@droplinkperformance/bitbucket-mcp-server
@droplinkperformance/bitbucket-mcp-server
Servidor de Model Context Protocol (MCP) para Bitbucket Cloud, agnóstico respecto al proveedor y centrado en la revisión con IA.
El valor principal de este servidor es la revisión de código asistida por IA y el análisis de pull requests, no las operaciones CRUD contra la API de Bitbucket. Cada dependencia importante (acceso SCM, caché, almacenamiento de tokens, limitación de tasa, LLM, eventos) está oculta tras una interfaz agnóstica respecto al proveedor, de modo que la misma lógica de negocio pueda apuntar más adelante a GitHub / GitLab / Azure DevOps y a OpenAI / Anthropic / Gemini / Bedrock sin cambios en los casos de uso, agentes o contratos de dominio.
Estado: Fase 1. Consulta la Hoja de ruta.
Características (Fase 1)
Transportes duales: stdio (Cursor / Claude Desktop) y Streamable HTTP (Node
http, para remoto/producción).Herramientas de descubrimiento automático mediante un
ToolRegistry: no hay registro manual.BitbucketContextexplícito (workspace+repositoryopcional) en cada herramienta: preparado para múltiples espacios de trabajo.BitbucketClientresiliente: inyección de autenticación, paginación automática, reintentos/backoff, gestión de límites de tasa, caché y enmascaramiento de secretos.Dos estrategias de autenticación: OAuth 2.0 (código de autorización, con persistencia rotatoria del token de refresco) y token Bearer.
Revisión de código con IA (
analyze_pull_request) respaldada por unCodeReviewAgentque divide los PR grandes en fragmentos y devuelve unReviewResultestándar.Proveedor de LLM conectable (OpenAI / Anthropic / Gemini / Bedrock), caché (memoria / Redis) y almacén de tokens (archivo / memoria / Redis).
Herramientas
Tool | Descripción |
| Usuario autenticado. |
| Lista los PR (filtro por estado/consulta). |
| Obtiene un PR por su id. |
| Abre un PR. |
| Diff unificado sin procesar. |
| Archivos modificados + estadísticas de líneas. |
| Comentarios del PR. |
| Añade un comentario (opcionalmente en línea). |
| Revisión con IA que devuelve un |
Todas las entradas de las herramientas aceptan workspace (opcional si se define BITBUCKET_DEFAULT_WORKSPACE) y, cuando corresponda, repository.
Related MCP server: Atlassian Bitbucket MCP Server
Arquitectura
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, BitbucketContextFlujo: tool -> use-case -> (agent | repository contract) -> repositories/bitbucket -> BitbucketClient. Los agentes también pueden usar LlmProvider y EventBus. Las herramientas nunca contienen lógica de negocio.
Requisitos
Node.js 23+
Instalación
Publicado como @droplinkperformance/bitbucket-mcp-server.
npx -y @droplinkperformance/bitbucket-mcp-serverDesde el código fuente:
npm install
npm run buildPublicación
Las fusiones (merges) a main ejecutan .github/workflows/release.yml: pruebas, compilación y, después, semantic-release. El versionado y la publicación en npm solo ocurren cuando la fusión incluye Conventional Commits:
Commit | Incremento |
| patch |
| minor |
| major |
El resto de mensajes omiten la publicación. Se requiere el secreto de GitHub NPM_TOKEN (token de automatización de npm para la organización droplinkperformance).
Tras una publicación npm correcta, el mismo flujo de trabajo publica metadatos en el MCP Registry como io.github.droplinkperformance/bitbucket-mcp-server (OIDC, sin secreto adicional). github.com/mcp se sincroniza desde ese registro; si el servidor no aparece, escribe a partnerships@github.com.
Para permanecer en 0.x en la primera versión, etiqueta el commit actual (git tag v0.1.0 && git push origin v0.1.0) antes de la primera fusión convencional; de lo contrario, semantic-release comenzará en 1.0.0.
Configuración
Copia .env.example a .env y completa los valores. Cárgalo con la opción integrada de Node:
node --env-file=.env dist/index.jsVariables clave:
Variable | Default | Notas |
|
|
|
|
| Enlace del transporte HTTP. |
| – | Valor alternativo cuando una herramienta omite |
| – | Token de API (ATATT…), contraseña de aplicación o token de acceso OAuth |
| – | Requerido con tokens de API (ATATT…): el correo de tu cuenta de Atlassian |
| – | Requerido para OAuth (cuando no hay token de acceso). |
| – | Semilla opcional para OAuth sin interfaz (headless). |
|
|
|
|
|
|
|
|
|
|
| Umbrales de fragmentación para PR grandes. |
|
| Métricas no operativas salvo que estén habilitadas. |
Autenticación
Bearer (token de acceso OAuth): establece solo BITBUCKET_ACCESS_TOKEN (tokens que no son ATATT).
Token de API (recomendado, ATATT…): establece BITBUCKET_ACCESS_TOKEN y BITBUCKET_EMAIL (el correo de tu cuenta de Atlassian desde Bitbucket → Configuración personal → Alias de correo). Los tokens de API usan autenticación HTTP Basic, no Bearer.
Contraseña de aplicación (heredada, hasta junio de 2026): establece BITBUCKET_ACCESS_TOKEN y BITBUCKET_USERNAME (tu nombre de usuario de Bitbucket).
OAuth 2.0 (código de autorización): establece BITBUCKET_CLIENT_ID / BITBUCKET_CLIENT_SECRET. El TOKEN_STORE configurado persiste los tokens; Bitbucket rota los tokens de refresco y el servidor persiste el nuevo en cada renovación. Para un arranque sin interfaz (headless), proporciona un BITBUCKET_REFRESH_TOKEN obtenido previamente.
Los endpoints OAuth de Bitbucket utilizados son: autorización https://bitbucket.org/site/oauth2/authorize, token https://bitbucket.org/site/oauth2/access_token. La URL de autorización se puede construir con OAuthProvider.buildAuthorizeUrl() y el ?code= devuelto se intercambia mediante OAuthProvider.loginWithCode(code).
Proveedor de LLM
Establece LLM_PROVIDER y la clave correspondiente:
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 (proveedores Redis) y @aws-sdk/client-bedrock-runtime (Bedrock) son opcionales y se cargan de forma diferida (lazy): solo se necesitan cuando se seleccionan.
Ejecución
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 (o .cursor/mcp.json del proyecto):
{
"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-..."
}
}
}
}Desarrollo
npm run dev # tsx watch (stdio)
npm run typecheck
npm run lint
npm test
npm run test:coverageHoja de ruta
Fase 1 (esta versión): autenticación, abstracciones,
BitbucketClient, descubrimiento automático de herramientas, herramientas de PR,analyze_pull_request.Fase 2: Pipelines + registros paginados de texto completo, agente
pipeline-investigator,auto_review_pull_request(dry-run / publicar comentarios en línea).Fase 3: CRUD restante: repositorios, commits, ramas, etiquetas, incidencias, espacios de trabajo, miembros, búsqueda.
Fase 4:
analyze_dotnet_pull_request(agente dotnet-review), agentes avanzados, flujos de automatización.Fase 5: Docker, Compose, Helm, guía de despliegue en producción.
Licencia
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- AlicenseBqualityDmaintenanceEnables 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.92ISC
- AlicenseAqualityDmaintenanceEnables LLMs to review Bitbucket pull requests with custom checklists and API token authentication.51MIT
Related MCP Connectors
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/droplinkperformance/bitbucket-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server