Secure, self-hosted Model Context Protocol (MCP) server for Bitbucket Server/Data Center β designed for enterprise, air-gapped, and private network environments. Built in Rust for maximum security, performance, and zero runtime dependencies.
| Feature | This Server | Other MCP Servers |
|---|---|---|
| Deployment | Single binary | Node.js + npm dependencies |
| Security | Rust memory safety | JavaScript runtime vulnerabilities |
| Dependencies | Zero at runtime | 100+ npm packages |
| Air-gapped | β Fully supported | β Requires npm registry |
| SSL/TLS | Custom CA support | Limited |
| Permissions | Granular READ/WRITE/DELETE | All-or-nothing |
| Audit Trail | Security-audited dependencies | Supply chain risks |
- π Enterprise environments with strict security policies
- π’ Corporate networks behind firewalls
βοΈ Air-gapped systems without internet access- π‘οΈ Compliance requirements (SOC2, ISO27001, GDPR)
- π¦ Minimal attack surface requirements
# Global install
npm install -g @bitbucket-mcp/server
# Or run without install
npx @bitbucket-mcp/servermacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@bitbucket-mcp/server"],
"env": {
"BITBUCKET_BASE_URL": "https://bitbucket.your-company.com",
"BITBUCKET_USERNAME": "service-account",
"BITBUCKET_PASSWORD": "your-personal-access-token",
"BITBUCKET_SSL_VERIFY": "true",
"BITBUCKET_ALLOW_READ": "true",
"BITBUCKET_ALLOW_WRITE": "false",
"BITBUCKET_ALLOW_DELETE": "false"
}
}
}
}| Feature | Description |
|---|---|
| Memory Safety | Rust prevents buffer overflows, use-after-free, data races |
| Zero Supply Chain Risk | No runtime npm dependencies to compromise |
| Audited Dependencies | All Rust crates scanned with cargo-audit |
| Granular Permissions | Separate READ/WRITE/DELETE controls |
| Self-Signed SSL | Support for internal CA certificates |
| No Telemetry | Zero data collection, fully offline-capable |
{
"env": {
// Require SSL verification (default: true)
"BITBUCKET_SSL_VERIFY": "true",
// Read-only mode for maximum security
"BITBUCKET_ALLOW_READ": "true",
"BITBUCKET_ALLOW_WRITE": "false",
"BITBUCKET_ALLOW_DELETE": "false",
// Use personal access token instead of password
"BITBUCKET_PASSWORD": "your-pat-token"
}
}- β SOC2: Audit trails, access controls, encryption in transit
- β ISO27001: Secure development, dependency management
- β GDPR: No data retention, on-premise deployment
- β HIPAA: Private network deployment supported
| Tool | Description | Permission |
|---|---|---|
list_projects |
List all projects with pagination | READ |
get_project |
Get project details by key | READ |
| Tool | Description | Permission |
|---|---|---|
list_repos |
List repositories in a project | READ |
get_repo |
Get repository details | READ |
| Tool | Description | Permission |
|---|---|---|
list_prs |
List pull requests with filters (state, author) | READ |
get_pr |
Get pull request details | READ |
create_pr |
Create a new pull request | WRITE |
update_pr |
Update pull request title/description | WRITE |
merge_pr |
Merge a pull request | DELETE |
decline_pr |
Decline a pull request | DELETE |
pr_diff |
Get pull request diff | READ |
pr_changes |
Get pull request file changes | READ |
| Tool | Description | Permission |
|---|---|---|
list_branches |
List repository branches | READ |
create_branch |
Create a new branch from ref | WRITE |
compare_branches |
Compare commits between branches | READ |
| Tool | Description | Permission |
|---|---|---|
list_commits |
List repository commits with filters | READ |
get_commit |
Get commit details | READ |
| Tool | Description | Permission |
|---|---|---|
list_files |
Browse repository files | READ |
get_file_content |
Get file content at specific commit | READ |
npm install -g @bitbucket-mcp/serverDownload prebuilt binary for your platform:
| Platform | Binary | Size |
|---|---|---|
| macOS Intel | bitbucket-mcp-darwin-x64 |
~15 MB |
| macOS ARM | bitbucket-mcp-darwin-arm64 |
~12 MB |
| Linux x64 | bitbucket-mcp-linux-x64 |
~18 MB |
| Linux ARM64 | bitbucket-mcp-linux-arm64 |
~16 MB |
| Windows x64 | bitbucket-mcp-win32-x64.exe |
~20 MB |
# Download and run
chmod +x bitbucket-mcp-linux-x64
./bitbucket-mcp-linux-x64FROM scratch
COPY bitbucket-mcp-linux-x64 /bitbucket-mcp
ENTRYPOINT ["/bitbucket-mcp"]-
Download on internet-connected machine:
npm pack @bitbucket-mcp/server
-
Transfer to air-gapped system via secure media
-
Install offline:
npm install -g bitbucket-mcp-server-0.1.0.tgz
{
"env": {
"BITBUCKET_BASE_URL": "https://bitbucket.internal.company.com",
"HTTP_PROXY": "http://proxy.company.com:8080",
"HTTPS_PROXY": "http://proxy.company.com:8080",
"NO_PROXY": "localhost,127.0.0.1,.internal.company.com"
}
}# 1. Create dedicated service account in Bitbucket
# 2. Grant minimal required permissions
# 3. Generate Personal Access Token (PAT)
# 4. Use in configuration (never commit to git!)| Variable | Required | Default | Description |
|---|---|---|---|
BITBUCKET_BASE_URL |
Yes | - | Bitbucket Server base URL |
BITBUCKET_API_KEY |
No | - | API Key / PAT for Bearer token authentication (has priority over Basic Auth) |
BITBUCKET_USERNAME |
Yes | - | Username for Basic Auth (ignored if BITBUCKET_API_KEY is set) |
BITBUCKET_PASSWORD |
Yes | - | Password or PAT for Basic authentication (ignored if BITBUCKET_API_KEY is set) |
BITBUCKET_SSL_VERIFY |
No | true |
SSL certificate verification |
BITBUCKET_ALLOW_READ |
No | true |
Allow read operations |
BITBUCKET_ALLOW_WRITE |
No | true |
Allow write operations |
BITBUCKET_ALLOW_DELETE |
No | true |
Allow delete operations |
// Read-only (maximum security)
{ "BITBUCKET_ALLOW_READ": "true", "BITBUCKET_ALLOW_WRITE": "false", "BITBUCKET_ALLOW_DELETE": "false" }
// Developer mode (no delete)
{ "BITBUCKET_ALLOW_READ": "true", "BITBUCKET_ALLOW_WRITE": "true", "BITBUCKET_ALLOW_DELETE": "false" }
// Admin mode (full access)
{ "BITBUCKET_ALLOW_READ": "true", "BITBUCKET_ALLOW_WRITE": "true", "BITBUCKET_ALLOW_DELETE": "true" }# β Don't use password
BITBUCKET_PASSWORD="my-actual-password"
# β
Use PAT with minimal scope
BITBUCKET_PASSWORD="pat:read-only-projects-repos"{
"env": {
"BITBUCKET_ALLOW_WRITE": "false",
"BITBUCKET_ALLOW_DELETE": "false"
}
}# Bind to localhost only (if supported)
# Or use firewall rules to restrict access
sudo ufw allow from 127.0.0.1 to any port 3000# Rotate PAT every 90 days
# Monitor Bitbucket audit logs for unusual activity{
"env": {
"BITBUCKET_SSL_VERIFY": "true" // Never disable in production
}
}For self-signed/internal CA certificates:
{
"env": {
// Option 1: Add to system trust store (recommended)
// Option 2: Disable verification (NOT recommended for production)
"BITBUCKET_SSL_VERIFY": "false"
}
}# Check credentials
curl -u username:password https://bitbucket.example.com/rest/api/1.0/projects
# Verify PAT has required permissions
# Check user is not locked/suspended# Verify URL includes protocol
BITBUCKET_BASE_URL="https://bitbucket.example.com" # β
BITBUCKET_BASE_URL="bitbucket.example.com" # β
# Test connectivity
curl -I https://bitbucket.example.com
# Check firewall/proxy rules{
"env": {
// Enable only required permissions
"BITBUCKET_ALLOW_READ": "true",
"BITBUCKET_ALLOW_WRITE": "false",
"BITBUCKET_ALLOW_DELETE": "false"
}
}βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Claude Desktop ββββββΆβ MCP Server ββββββΆβ Bitbucket β
β (AI Assistant) β β (Rust Binary) β β Server/DC β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
User Requests Zero Dependencies REST API 1.0
Natural Language Memory Safe Basic Auth
Single Binary SSL/TLS
- Memory Safety: No buffer overflows, use-after-free, or data races
- Performance: Native code, no GC pauses
- Security: Audited dependencies, minimal attack surface
- Portability: Single static binary, no runtime dependencies
- Model Context Protocol Documentation
- Bitbucket Server REST API
- Security Best Practices
- Enterprise Deployment Guide
- Build Instructions
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/your-org/bitbucket-mcp-server.git
cd bitbucket-mcp-server
# Build
cargo build --release
# Test
cargo test
# Security audit
cargo auditΠΡΠΈ ΠΊΠ°ΠΆΠ΄ΠΎΠΌ ΠΊΠΎΠΌΠΌΠΈΡΠ΅ Π² Π²Π΅ΡΠΊΡ main Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ:
- Dependabot ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅Ρ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ (Π΅ΠΆΠ΅Π½Π΅Π΄Π΅Π»ΡΠ½ΠΎ ΠΏΠΎ ΠΏΠΎΠ½Π΅Π΄Π΅Π»ΡΠ½ΠΈΠΊΠ°ΠΌ)
- Π‘ΠΎΠ·Π΄Π°Π΅ΡΡΡ Π½ΠΎΠ²ΡΠΉ ΡΠ΅Π³ Ρ ΠΈΠ½ΠΊΡΠ΅ΠΌΠ΅Π½ΡΠΎΠΌ patch-Π²Π΅ΡΡΠΈΠΈ (v0.1.0 β v0.1.1)
- ΠΠ΅Π½Π΅ΡΠΈΡΡΠ΅ΡΡΡ changelog Π½Π° ΠΎΡΠ½ΠΎΠ²Π΅ Conventional Commits
- ΠΡΠ±Π»ΠΈΠΊΡΠ΅ΡΡΡ GitHub Release Ρ Π±ΠΈΠ½Π°ΡΠ½ΠΈΠΊΠ°ΠΌΠΈ Π΄Π»Ρ Π²ΡΠ΅Ρ ΠΏΠ»Π°ΡΡΠΎΡΠΌ
- ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ Π² npm (ΠΏΡΠΈ Π½Π°Π»ΠΈΡΠΈΠΈ ΡΠΎΠΊΠ΅Π½Π°
NPM_TOKEN)
ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΡΠΎΡΠΌΠ°Ρ ΠΊΠΎΠΌΠΌΠΈΡΠΎΠ² Π΄Π»Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡ ΡΠΈΠΏΠ° ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ:
# ΠΠΎΠ²ΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ (minor version)
git commit -m "feat: add branch comparison tool"
# ΠΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ (patch version)
git commit -m "fix: handle SSL certificate errors"
# ΠΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ (patch version)
git commit -m "deps: update tokio to 1.42"
# ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ (Π½Π΅ ΡΠΎΠ·Π΄Π°Π΅Ρ ΡΠ΅Π»ΠΈΠ·)
git commit -m "docs: update README examples"βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Push to main ββββββΆβ auto-release.ymlββββββΆβ Create tag β
β (non-.md) β β β β (v0.1.0β0.1.1) β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββ
β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββΌβββββββββ
β npm Publish βββββββ release.yml βββββββ GitHub Release β
β β β Build & Test β β + Changelog β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
ΠΠ°ΡΡΡΠΎΠΉΡΠ΅ secrets Π² GitHub Repository Settings β Secrets β Actions:
| Secret | Description | Required |
|---|---|---|
GITHUB_TOKEN |
ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΡΠΎΠ·Π΄Π°Π΅ΡΡΡ GitHub | β Yes |
NPM_TOKEN |
Π’ΠΎΠΊΠ΅Π½ Π΄Π»Ρ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ Π² npm | β Optional |
Dependabot Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅Ρ:
- Rust Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ (Cargo.toml) β Π΅ΠΆΠ΅Π½Π΅Π΄Π΅Π»ΡΠ½ΠΎ
- npm Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ (package.json) β Π΅ΠΆΠ΅Π½Π΅Π΄Π΅Π»ΡΠ½ΠΎ
- GitHub Actions β Π΅ΠΆΠ΅Π½Π΅Π΄Π΅Π»ΡΠ½ΠΎ
ΠΡΠ΅ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ ΡΠΎΠ·Π΄Π°ΡΡΡΡ ΠΊΠ°ΠΊ Pull Request Ρ Π»Π΅ΠΉΠ±Π»Π°ΠΌΠΈ:
dependencies+rust/javascript/ci/cd- ΠΡΡΠΏΠΏΠΈΡΠΎΠ²Π°Π½Π½ΡΠ΅ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ Π΄Π»Ρ minor/patch Π²Π΅ΡΡΠΈΠΉ
MIT License - see LICENSE file for details.
MCP server, Model Context Protocol, Bitbucket Server, Bitbucket Data Center, enterprise MCP, secure MCP, self-hosted MCP, air-gapped MCP, on-premise MCP, single binary MCP, Rust MCP server, zero dependencies, private network MCP, corporate MCP, SOC2 compliant, ISO27001 compliant, Atlassian integration, Bitbucket REST API, Claude Desktop MCP, AI integration
Built for enterprise security β’ Zero runtime dependencies β’ Air-gapped ready