Bitbucket Server MCP
Provides tools for managing Bitbucket Server projects, repositories, branches, files, commits, pull requests, and code search.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bitbucket Server MCPshow open pull requests in PROJ/repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bitbucket Server MCP
An MCP (Model Context Protocol) server for Atlassian Bitbucket Server / Data Center (Enterprise). Provides 66 tools for reading and writing projects, repositories, branches, files, commits, pull requests, and code search — with opt-in gated deletion operations (disabled by default, see SECURITY.md.
Installation
From PyPI (recommended)
pip install bitbucket-server-mcpOr with uv:
uv pip install bitbucket-server-mcpFrom source
git clone https://github.com/ManpreetShuann/bitbucket-server-mcp.git
cd bitbucket-server-mcp
uv syncVia Docker (no local Python required)
cd bitbucket-server-mcp
docker build -t bitbucket-server-mcp .Prerequisites
Python 3.10+
Bitbucket Server 7.x+ with HTTP access tokens enabled
Configuration
Set two required environment variables (plus optional ones):
Variable | Required | Description |
| Yes | Base URL of your Bitbucket Server (e.g., |
| Yes | HTTP access token (create in Bitbucket > User Settings > HTTP Access Tokens) |
| No | Log level for stderr output: |
| No | Set to |
| No | Set to |
Integration
This server runs locally via stdio rather than as a hosted HTTP service. Running locally keeps your Bitbucket access token on your own machine, avoids exposing an authenticated API endpoint over the network, and removes the need to manage server infrastructure or TLS certificates.
Claude Code
Add to ~/.claude.json or project .claude/settings.json:
pip install bitbucket-server-mcp{
"mcpServers": {
"bitbucket": {
"command": "bitbucket-server-mcp",
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "your-token-here"
}
}
}
}{
"mcpServers": {
"bitbucket": {
"command": "docker",
"args": ["run", "--rm", "-i", "-e", "BITBUCKET_URL", "-e", "BITBUCKET_TOKEN", "bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "your-token-here"
}
}
}
}git clone https://github.com/ManpreetShuann/bitbucket-server-mcp.git
cd bitbucket-server-mcp
uv sync{
"mcpServers": {
"bitbucket": {
"command": "uv",
"args": ["run", "--directory", "/path/to/bitbucket-server-mcp", "bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "your-token-here"
}
}
}
}GitHub Copilot (VS Code)
Add to .vscode/mcp.json in your workspace:
pip install bitbucket-server-mcp{
"servers": {
"bitbucket": {
"type": "stdio",
"command": "bitbucket-server-mcp",
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "${input:bitbucket-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "bitbucket-token",
"description": "Bitbucket Server HTTP access token",
"password": true
}
]
}{
"servers": {
"bitbucket": {
"type": "stdio",
"command": "docker",
"args": ["run", "--rm", "-i", "-e", "BITBUCKET_URL", "-e", "BITBUCKET_TOKEN", "bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "${input:bitbucket-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "bitbucket-token",
"description": "Bitbucket Server HTTP access token",
"password": true
}
]
}git clone https://github.com/ManpreetShuann/bitbucket-server-mcp.git
cd bitbucket-server-mcp
uv sync{
"servers": {
"bitbucket": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/bitbucket-server-mcp", "bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://bitbucket.yourcompany.com",
"BITBUCKET_TOKEN": "${input:bitbucket-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "bitbucket-token",
"description": "Bitbucket Server HTTP access token",
"password": true
}
]
}OpenAI Codex
Add to ~/.codex/config.toml:
pip install bitbucket-server-mcp[mcp_servers.bitbucket]
command = "bitbucket-server-mcp"
args = []
[mcp_servers.bitbucket.env]
BITBUCKET_URL = "https://bitbucket.yourcompany.com"
BITBUCKET_TOKEN = "your-token-here"Or via CLI:
codex mcp add bitbucket \
--env BITBUCKET_URL=https://bitbucket.yourcompany.com \
--env BITBUCKET_TOKEN=your-token-here \
-- bitbucket-server-mcp[mcp_servers.bitbucket]
command = "docker"
args = ["run", "--rm", "-i", "-e", "BITBUCKET_URL", "-e", "BITBUCKET_TOKEN", "bitbucket-server-mcp"]
[mcp_servers.bitbucket.env]
BITBUCKET_URL = "https://bitbucket.yourcompany.com"
BITBUCKET_TOKEN = "your-token-here"Or via CLI:
codex mcp add bitbucket \
--env BITBUCKET_URL=https://bitbucket.yourcompany.com \
--env BITBUCKET_TOKEN=your-token-here \
-- docker run --rm -i -e BITBUCKET_URL -e BITBUCKET_TOKEN bitbucket-server-mcpgit clone https://github.com/ManpreetShuann/bitbucket-server-mcp.git
cd bitbucket-server-mcp
uv sync[mcp_servers.bitbucket]
command = "uv"
args = ["run", "--directory", "/path/to/bitbucket-server-mcp", "bitbucket-server-mcp"]
[mcp_servers.bitbucket.env]
BITBUCKET_URL = "https://bitbucket.yourcompany.com"
BITBUCKET_TOKEN = "your-token-here"Or via CLI:
codex mcp add bitbucket \
--env BITBUCKET_URL=https://bitbucket.yourcompany.com \
--env BITBUCKET_TOKEN=your-token-here \
-- uv run --directory /path/to/bitbucket-server-mcp bitbucket-server-mcpTools (66 total)
Projects
Tool | Description |
| List all projects (paginated) |
| Get project details by key |
Repositories
Tool | Description |
| List repos in a project (paginated) |
| Get repo details |
| Create a new repo |
Branches & Tags
Tool | Description |
| List branches (paginated, filterable) |
| Get default branch |
| Create a branch from a start point |
| List tags (paginated, filterable) |
Files & Content
Tool | Description |
| Browse directory/file tree at a path and revision |
| Get raw file content |
| List file paths in a directory |
Commits
Tool | Description |
| List commits (paginated, filterable by branch/path) |
| Get commit details |
| Get diff for a commit |
| Get changed files for a commit |
Pull Requests
Tool | Description |
| List PRs with state/direction/draft/title/participant filters (paginated) |
| Get PR details |
| Create a PR with reviewers (supports draft mode) |
| Update PR title/description/reviewers/draft status |
| Create a PR in draft mode |
| Publish a draft PR (mark as ready for review) |
| Convert an open PR back to draft |
| Check merge readiness (canMerge, conflicts, vetoes) |
| Merge a PR with optional strategy |
| Decline a PR |
| Reopen a declined PR |
| Approve a PR |
| Remove your approval |
| Request changes on a PR |
| Remove your change request |
| List reviewers with roles and statuses |
| Subscribe as a watcher |
| Unsubscribe from watching |
| Get suggested commit message for merge |
| Get PR diff |
| Get per-file change list (added/modified/deleted) |
| List commits in a PR |
| Get PR activity feed |
| List comments on a PR |
| Get a specific comment |
| Add a comment (general, inline, reply, or blocker task) |
| Edit a comment |
| Resolve a comment thread |
| Reopen a resolved thread |
| List PR tasks |
| Create a task (optionally linked to a comment) |
| Get a specific task |
| Update task content or state |
Dashboard
Tool | Description |
| List PRs visible to the authenticated user across all repos (paginated) |
| List PRs in the user's inbox needing review action (paginated) |
Search
Tool | Description |
| Search code across repos (requires Elasticsearch) |
| Find files by name or path pattern with wildcards |
Users
Tool | Description |
| Search users by name, username, or email |
Attachments
Tool | Description |
| Download an attachment by ID |
| Get attachment metadata |
| Create or update attachment metadata |
Dangerous Delete (Tier-1, requires BITBUCKET_ALLOW_DANGEROUS_DELETE=1)
Tool | Description |
| Delete a branch (irreversible) |
| Delete a tag (irreversible) |
| Delete a PR and all its contents |
| Delete a PR comment |
| Delete a PR task |
| Delete an attachment |
| Delete attachment metadata |
Destructive Delete (Tier-2, requires both BITBUCKET_ALLOW_DANGEROUS_DELETE=1 and BITBUCKET_ALLOW_DESTRUCTIVE_DELETE=1)
Tool | Description |
| Delete a project and all its repositories (irreversible) |
| Delete a repository and all its contents (irreversible) |
Development
git clone https://github.com/ManpreetShuann/bitbucket-server-mcp.git
cd bitbucket-server-mcp
uv sync # Install all dependencies (including dev)
uv run pytest -v # Run tests
uv run ruff check src/ tests/ # Lint
uv run ruff format src/ tests/ # FormatSee CONTRIBUTING.md for full development guidelines.
Pagination
All list tools accept start (default 0) and limit (default 25) parameters. Responses include isLastPage and nextPageStart for fetching subsequent pages.
Security
See SECURITY.md for our security policy and vulnerability reporting instructions.
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/ManpreetShuann/bitbucket-server-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server