Bitbucket MCP Server
Provides tools for interacting with the Bitbucket Cloud API, enabling AI assistants to list and get repositories, manage pull requests, branches, commits, issues, and retrieve diffs.
Click on "Deploy 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 MCP Server show me the open pull requests in my 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 MCP Server
A Model Context Protocol (MCP) server that provides access to Bitbucket Cloud API. This server enables AI assistants like Claude to interact with Bitbucket repositories, pull requests, issues, and more.
Features
This MCP server provides tools for:
Repositories: List and get repository details
Pull Requests: List, view, and create pull requests
Branches: List repository branches
Commits: List and view commits
Issues: List, view, and create issues
Diffs: Get diffs for PRs or between commits
Related MCP server: GitHub MCP Server
Prerequisites
Node.js 18 or higher
A Bitbucket Cloud account
Atlassian API Token (see setup instructions below)
Creating an Atlassian API Token
Go to Atlassian API Tokens
Click Create API token
Give it a label (e.g., "Bitbucket MCP Server")
Select the following scopes based on your needs:
Required scopes (minimum for read-only access):
read:repository:bitbucket- View repositories, branches, commits, and diffsread:pullrequest:bitbucket- View pull requestsread:issue:bitbucket- View issues
Additional scopes (for write operations):
write:pullrequest:bitbucket- Create and modify pull requestswrite:issue:bitbucket- Create and modify issues
Optional scopes (for enhanced functionality):
read:workspace:bitbucket- View workspace informationread:project:bitbucket- View project informationread:account- View user profiles
Click Create
Important: Copy the generated token immediately (you won't be able to see it again)
Installation
Option 1: Install via npm (Recommended)
npm install -g @auliaadil/bitbucket-2.0-mcpOption 2: Install from source (for development)
# Clone the repository
git clone https://github.com/auliaadil/bitbucket-2.0-mcp.git
cd bitbucket-2.0-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
For Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
If you installed via npm (Option 1):
{
"mcpServers": {
"bitbucket": {
"command": "bitbucket-2.0-mcp",
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}If you installed from source (Option 2):
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-2.0-mcp/dist/index.js"],
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}Replace:
your-workspace-slugwith your Bitbucket workspace slug (e.g., "my-team")your-email@example.comwith your Atlassian account emailyour-atlassian-api-tokenwith the Atlassian API token you created/path/to/bitbucket-2.0-mcpwith the actual path (only for source installation)
For Claude Code CLI
Add the following to your Claude Code CLI configuration file (~/.claude/config.json):
If you installed via npm (Option 1):
{
"mcpServers": {
"bitbucket": {
"command": "bitbucket-2.0-mcp",
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}If you installed from source (Option 2):
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-2.0-mcp/dist/index.js"],
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}For GitHub Copilot CLI
Add the following to your Copilot CLI configuration file (~/.github/copilot-cli/config.json):
If you installed via npm (Option 1):
{
"mcpServers": {
"bitbucket": {
"command": "bitbucket-2.0-mcp",
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}If you installed from source (Option 2):
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-2.0-mcp/dist/index.js"],
"env": {
"BITBUCKET_WORKSPACE": "your-workspace-slug",
"BITBUCKET_EMAIL": "your-email@example.com",
"BITBUCKET_API_TOKEN": "your-atlassian-api-token"
}
}
}
}For other MCP clients
If you installed via npm (Option 1):
Set the following environment variables:
export BITBUCKET_WORKSPACE="your-workspace-slug"
export BITBUCKET_EMAIL="your-email@example.com"
export BITBUCKET_API_TOKEN="your-atlassian-api-token"Then run the server:
bitbucket-2.0-mcpIf you installed from source (Option 2):
Set the following environment variables:
export BITBUCKET_WORKSPACE="your-workspace-slug"
export BITBUCKET_EMAIL="your-email@example.com"
export BITBUCKET_API_TOKEN="your-atlassian-api-token"Then run the server:
node /path/to/bitbucket-2.0-mcp/dist/index.jsScope Requirements by Tool
The following table shows which Atlassian API token scopes are required for each tool:
Tool | Required Scopes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Available Tools
Repository Tools
list_repositories
List all repositories in the workspace.
Parameters:
page(optional): Page number for paginationpagelen(optional): Items per page (max: 100)
get_repository
Get detailed information about a repository.
Parameters:
repo_slug(required): Repository name
Pull Request Tools
list_pull_requests
List pull requests for a repository.
Parameters:
repo_slug(required): Repository namestate(optional): Filter by state (OPEN, MERGED, DECLINED, SUPERSEDED)page(optional): Page number
get_pull_request
Get details about a specific pull request.
Parameters:
repo_slug(required): Repository namepr_id(required): Pull request ID
create_pull_request
Create a new pull request.
Parameters:
repo_slug(required): Repository nametitle(required): PR titlesource_branch(required): Source branch namedestination_branch(optional): Destination branch (default: main)description(optional): PR descriptionclose_source_branch(optional): Close source after merge (default: false)
Branch Tools
list_branches
List all branches in a repository.
Parameters:
repo_slug(required): Repository namepage(optional): Page number
Commit Tools
list_commits
List commits in a repository.
Parameters:
repo_slug(required): Repository namebranch(optional): Branch namepage(optional): Page number
get_commit
Get details about a specific commit.
Parameters:
repo_slug(required): Repository namecommit_hash(required): Commit hash
Issue Tools
list_issues
List issues for a repository.
Parameters:
repo_slug(required): Repository namestate(optional): Filter by state (new, open, resolved, etc.)page(optional): Page number
get_issue
Get details about a specific issue.
Parameters:
repo_slug(required): Repository nameissue_id(required): Issue ID
create_issue
Create a new issue.
Parameters:
repo_slug(required): Repository nametitle(required): Issue titlecontent(optional): Issue descriptionkind(optional): Issue type (bug, enhancement, proposal, task)priority(optional): Issue priority (trivial, minor, major, critical, blocker)
Diff Tools
get_diff
Get the diff for a pull request or between commits.
Parameters:
repo_slug(required): Repository namespec(required): Diff spec (e.g., "master..feature" or PR ID)
Usage Examples
When using with Claude Desktop, you can ask questions like:
"List all repositories in my Bitbucket workspace"
"Show me open pull requests for the project-name repository"
"Create a pull request from feature-branch to main in my-repo"
"What are the latest commits on the develop branch?"
"Create a bug issue in my-repo titled 'Fix login error'"
Development
# Install dependencies
npm install
# Build and watch for changes
npm run dev
# Build for production
npm run buildTroubleshooting
Authentication Errors
If you get 401 or 403 errors:
Verify your email and Atlassian API token are correct
Ensure your API token hasn't expired or been revoked
Confirm your Atlassian account has access to the workspace
Ensure your workspace slug is correct
Permission/Scope Errors
If specific tools fail with permission errors:
Check that your API token has the required scopes (see "Scope Requirements by Tool" section)
Verify you have the necessary permissions in your Bitbucket workspace
Some operations (like creating PRs or issues) require write scopes - ensure these are enabled on your token
You may need to regenerate your token with additional scopes if you initially created it with limited permissions
Tool Not Found
If tools aren't appearing:
Restart your MCP client (Claude Desktop, Claude Code CLI, etc.) after configuration changes
Check the logs in your client's developer console
For npm installations: Verify the installation with
npm list -g @auliaadil/bitbucket-2.0-mcpFor source installations: Verify the path to
index.jsis correct
Rate Limiting
Bitbucket API has rate limits. If you hit them:
Wait a few minutes before retrying
Reduce the number of requests
Consider implementing caching if needed
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT
Resources
Bitbucket OpenAPI Specification - Complete API spec included in this repository
Available Tools
12 toolscreate_issueC
Create a new issue
Inputs: title (required), repo_slug (required), kind, content, +1 more.
create_pull_requestC
Create a new pull request
Inputs: title (required), repo_slug (required), source_branch (required), description, +2 more.
get_commitC
Get detailed information about a specific commit
Inputs: repo_slug (required), commit_hash (required).
get_diffB
Get the diff for a pull request or between commits
Inputs: spec (required), repo_slug (required).
get_issueB
Get detailed information about a specific issue
Inputs: issue_id (required), repo_slug (required).
get_pull_requestB
Get detailed information about a specific pull request
Inputs: pr_id (required), repo_slug (required).
get_repositoryC
Get detailed information about a specific repository
Inputs: repo_slug (required).
list_branchesC
List branches in a repository
Inputs: repo_slug (required), page.
list_commitsC
List commits in a repository
Inputs: repo_slug (required), page, branch.
list_issuesC
List issues for a repository
Inputs: repo_slug (required), page, state.
list_pull_requestsC
List pull requests for a repository
Inputs: repo_slug (required), page, state.
list_repositoriesC
List all repositories in the workspace
Inputs: page, pagelen.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource+action pair (repo, PR, branch, commit, issue), so an agent can select unambiguously. get_diff is the only one that spans resources but is clearly scoped to diff content and doesn't collide with get_pull_request or get_commit.
Uniform verb_noun snake_case pattern throughout (list_*, get_*, create_*). No mixed conventions or camelCase deviations.
12 tools sits squarely in the well-scoped 3-15 range and each maps to a meaningful Bitbucket operation. No redundant or filler tools.
Covers read paths for repos, PRs, branches, commits, issues plus create for PRs and issues, but lifecycle gaps are notable: no update/delete issue, no merge/approve/comment on PRs, and no create_branch. An agent can read broadly but cannot complete common write workflows.
Maintenance
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Connect assistants to your company tools with per-person, per-action grants and a full audit log.
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to programmatically manage Bitbucket Cloud resources, including pull requests, repositories, and branches, automating code review workflows.5 npmMIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude directly to GitHub repositories for reading code, making changes, committing, and managing branches and pull requests.MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to search and inspect code repositories, manage issues and pull requests, and analyze user contributions.13MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Desktop to analyze repositories, fetch and create issues, inspect pull request diffs, and comment on pull requests through the GitHub API using natural-language commands.1MIT