Sign inSign up

guerchele/bitbucket-dc-mcp

By guerchele

•Updated 10 months ago

Image
0

2.7K

guerchele/bitbucket-dc-mcp repository overview

⁠Bitbucket Data Center MCP Server - Docker Image

Model Context Protocol (MCP) server for Atlassian Bitbucket Data Center with semantic search and AI-powered workflow automation.

GitHub License: LGPL-3.0

Transform natural language queries into precise Bitbucket API operations. Built for LLMs (Claude, GPT-4) to interact intelligently with Bitbucket Data Center.

ā šŸš€ Quick Start

⁠Run with Docker
docker run -it \
  -e BITBUCKET_URL=https://bitbucket.example.com \
  -e BITBUCKET_AUTH_METHOD=pat \
  -e BITBUCKET_TOKEN=your-personal-access-token \
  ghcr.io/guerchele/bitbucket-dc-mcp:latest
⁠Run with Docker Compose

Create docker-compose.yml:

version: '3.8'
services:
  bitbucket-mcp:
    image: guerchele/bitbucket-dc-mcp:latest
    environment:
      BITBUCKET_URL: https://bitbucket.example.com
      BITBUCKET_AUTH_METHOD: pat
      BITBUCKET_TOKEN: your-personal-access-token
      LOG_LEVEL: info
    restart: unless-stopped

Then run:

docker-compose up -d

ā šŸ“‹ Requirements

  • Bitbucket Data Center instance with API access
  • Valid credentials: OAuth 2.0, Personal Access Token, OAuth 1.0a, or Basic Auth
  • Docker Desktop 4.37.1+ or Docker Engine 20.10+

ā šŸ”§ Environment Variables

⁠Required
VariableDescriptionExample
BITBUCKET_URLYour Bitbucket Data Center URLhttps://bitbucket.example.com
BITBUCKET_AUTH_METHODAuthentication methodpat, oauth2, oauth1, basic
BITBUCKET_TOKENAuthentication token (for PAT/Basic)your-token-here
⁠Optional
VariableDefaultDescription
BITBUCKET_API_VERSIONlatestAPI version: 1.0 (legacy) or latest (modern)
LOG_LEVELinfoLogging level: debug, info, warn, error
RATE_LIMIT_MAX_REQUESTS100Max API requests per minute
REQUEST_TIMEOUT_MS30000Request timeout in milliseconds

Note: The BITBUCKET_API_VERSION is automatically detected based on your Bitbucket instance during setup. You typically don't need to set this manually unless you want to override the auto-detection. See API Version Detection Guide⁠ for more details.

ā šŸ’” Usage Examples

⁠Example 1: Basic Container
docker run -it --rm \
  -e BITBUCKET_URL=https://bitbucket.example.com \
  -e BITBUCKET_AUTH_METHOD=pat \
  -e BITBUCKET_TOKEN=abc123xyz \
  guerchele/bitbucket-dc-mcp:latest
⁠Example 2: With Persistent Configuration
docker run -it -d \
  --name bitbucket-mcp \
  -v ~/.bitbucket-mcp:/root/.bitbucket-mcp \
  -e BITBUCKET_URL=https://bitbucket.example.com \
  -e BITBUCKET_AUTH_METHOD=pat \
  -e BITBUCKET_TOKEN=abc123xyz \
  guerchele/bitbucket-dc-mcp:latest
⁠Example 3: Debug Mode
docker run -it --rm \
  -e BITBUCKET_URL=https://bitbucket.example.com \
  -e BITBUCKET_AUTH_METHOD=pat \
  -e BITBUCKET_TOKEN=abc123xyz \
  -e LOG_LEVEL=debug \
  guerchele/bitbucket-dc-mcp:latest
⁠Example 4: Connect from Claude Desktop

Edit your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "bitbucket-datacenter": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "BITBUCKET_URL=https://bitbucket.example.com",
        "-e",
        "BITBUCKET_AUTH_METHOD=pat",
        "-e",
        "BITBUCKET_TOKEN=your-token",
        "guerchele/bitbucket-dc-mcp:latest"
      ]
    }
  }
}

ā šŸ—ļø Key Features

āœ… Semantic Search Engine - Natural language queries with >90% relevance
āœ… Three MCP Tools - search_ids, get_id, call_id
āœ… Multi-Authentication - OAuth 2.0, PAT, OAuth 1.0a, Basic Auth
āœ… Production Resilient - Circuit breakers, rate limiting, retries
āœ… Secure by Default - Non-root user, credential redaction
āœ… Multi-Architecture - Supports linux/amd64 and linux/arm64

ā šŸ” MCP Tools Available

  1. search_ids - Find Bitbucket operations using natural language

    {"query": "create repository", "limit": 5}
    
  2. get_id - Get operation details and schema

    {"operation_id": "createRepository"}
    
  3. call_id - Execute Bitbucket API operations

    {"operation_id": "createRepository", "parameters": {...}}
    

ā šŸ„ Health Checks

The container includes built-in health checks:

# Check container health status
docker inspect --format='{{.State.Health.Status}}' bitbucket-mcp

# View health check logs
docker logs bitbucket-mcp

ā šŸ” Security Notes

  • Credentials are never logged (automatic redaction)
  • Runs as non-root user (nodejs, UID 1001)
  • Uses OS-native keychains when available
  • Supports read-only root filesystem

ā šŸ“– Full Documentation

ā šŸ› Troubleshooting

⁠Container exits immediately
# Check logs for errors
docker logs bitbucket-mcp

Common causes:

  • Missing BITBUCKET_URL environment variable
  • Invalid authentication credentials
  • Network connectivity issues
⁠Health check failing
# Run health check manually
docker exec bitbucket-mcp node /app/dist/healthcheck.js
⁠Cannot connect to Bitbucket
# Test connectivity from container
docker exec bitbucket-mcp wget -O- https://bitbucket.example.com/status

ā šŸ“œ License

LGPL-3.0 License - see LICENSE⁠

ā šŸ¤ Contributing

Contributions welcome! See CONTRIBUTING.md⁠


Need help? Open an issue on GitHub⁠

Tag summary

Content type

Image

Digest

sha256:c64b9236d…

Size

264.1 MB

Last updated

10 months ago

docker pull guerchele/bitbucket-dc-mcp