Integrations
Provides authentication and integration with Atlassian services, specifically focused on Bitbucket functionality using Atlassian API tokens.
Allows AI assistants to interact with Bitbucket repositories, including listing repositories, accessing pull requests, viewing commit information, and exploring workspaces.
Atlassian Bitbucket MCP Server
This project provides a Model Context Protocol (MCP) server that acts as a bridge between AI assistants (like Anthropic's Claude, Cursor AI, or other MCP-compatible clients) and your Atlassian Bitbucket instance. It allows AI to securely access and interact with your repositories, pull requests, and workspaces in real time.
Overview
What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI systems to securely and contextually connect with external tools and data sources.
This server implements MCP specifically for Bitbucket Cloud, bridging your Bitbucket data with AI assistants.
Why Use This Server?
- Minimal Input, Maximum Output Philosophy: Simple identifiers like
workspaceSlug
andrepoSlug
are all you need. Each tool returns comprehensive details without requiring extra flags. - Rich Code Visualization: Get detailed insights into repositories and code changes with file statistics, diff views, and smart context around code modifications.
- Secure Local Authentication: Credentials are never stored in the server. The server runs locally, so your tokens never leave your machine and you can request only the permissions you need.
- Intuitive Markdown Responses: All responses use well-structured Markdown for readability with consistent formatting and navigational links.
- Full Bitbucket Integration: Access workspaces, repositories, pull requests, comments, code search, and more through a unified interface.
Getting Started
Prerequisites
- Node.js (>=18.x): Download
- Bitbucket Cloud Account
Step 1: Authenticate
Choose one of the following authentication methods:
Option A: Bitbucket App Password (Recommended)
Generate one from Bitbucket App Passwords. Minimum permissions:
- Workspaces: Read
- Repositories: Read
- Pull Requests: Read
Option B: Atlassian API Token
Generate one from Atlassian API Tokens.
Note: While the server may function using an Atlassian API Token (via the standard ATLASSIAN_*
variables) due to the shared Atlassian account system, Bitbucket App Passwords are the strongly recommended and officially supported method for this integration. App Passwords allow for more granular, Bitbucket-specific permission scopes, enhancing security compared to potentially broader-scoped API Tokens.
Step 2: Configure Credentials
Method A: MCP Config File (Recommended)
Create or edit ~/.mcp/configs.json
:
Using Bitbucket App Password:
Using Atlassian API Token:
Note: For backward compatibility, the server will also recognize configurations under the full package name (@aashari/mcp-server-atlassian-bitbucket
), the unscoped package name (mcp-server-atlassian-bitbucket
), or the atlassian-bitbucket
format if the recommended bitbucket
key is not found. However, using the short bitbucket
key is preferred for new configurations.
Method B: Environment Variables
Pass credentials directly when running the server:
Step 3: Connect Your AI Assistant
Configure your MCP-compatible client to launch this server.
Claude / Cursor Configuration:
This configuration launches the server automatically at runtime.
Tools
This section covers the MCP tools available when using this server with an AI assistant. Note that MCP tools use snake_case
for tool names and camelCase
for parameters.
bb_ls_workspaces
List available Bitbucket workspaces.
or:
"Show me all my Bitbucket workspaces."
bb_get_workspace
Get full details for a specific workspace.
"Tell me more about the 'acme-corp' workspace."
bb_ls_repos
Lists repositories in a workspace. Filters by role
, projectKey
, query
(name/description). Supports sorting and pagination.
"List repositories in 'acme-corp' for project PROJ."
bb_get_repo
Get details of a specific repository, including owner, main branch name, comment/task counts, and recent PRs.
"Show me the 'backend-api' repository in 'acme-corp'."
bb_search
Search Bitbucket content. Scope with scope
('repositories', 'pullrequests', 'commits', 'code', 'all'). Code scope supports language
and extension
filters. The 'all' scope includes a header indicating which scope returned results.
Code (filtered):
"Search for 'Logger' in TypeScript files within the 'acme-corp' workspace."
bb_ls_prs
List pull requests in a repository.
"Show open PRs in 'frontend-app'."
bb_get_pr
Get full details of a pull request, including code diffs, file changes, comment/task counts.
"Get PR #42 from 'frontend-app' with all code changes."
bb_ls_pr_comments
List comments on a specific pull request. Inline comments include code snippets.
"Show me all comments on PR #42, including code context for inline comments."
bb_create_pr_comment
Add a comment to a pull request.
General:
Inline:
"Add a comment to PR #42 on line 42."
bb_create_pr
Create a new pull request.
"Create a PR from 'feature/login' to 'main'."
bb_create_branch
Create a new branch from a source branch or commit.
"Create branch 'feature/new-feature' from 'main' in 'frontend-app'."
bb_clone_repo
Clones a Bitbucket repository to a specified parent directory. The repository will be cloned into a subdirectory named after the repository slug under this targetPath
.
IMPORTANT (Tool Usage): When using this tool via an MCP client, targetPath
MUST be an absolute path (e.g., /Users/me/clones/bitbucket
). If a relative path is provided to the tool, it will be resolved against the server's temporary working directory, which is likely not the user's intended location.
"Clone the 'backend-api' repo into '/Users/me/clones/bitbucket'."
bb_get_commit_history
Retrieve the commit history for a repository.
or (filter by branch and path):
"Show me the commit history for the 'backend-api' repository." "Get commits on the develop branch for UserService.java."
Command-Line Interface (CLI)
The CLI uses kebab-case for commands (e.g., ls-workspaces
) and options (e.g., --workspace-slug
).
Quick Use with npx
Install Globally
Then run directly:
Discover More CLI Options
Use --help
to see flags and usage for all available commands:
Or get detailed help for a specific command:
License
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
An integration tool that enables AI assistants like Claude to directly access and interact with Bitbucket repositories, pull requests, and code without requiring copy/paste operations.
Related MCP Servers
- AsecurityAlicenseAqualityEnables AI assistants to interact with GitHub through the PyGithub library, providing tools for managing issues, repositories, pull requests, and other GitHub operations with intelligent parameter handling and error management.Last updated -19PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with GitHub repositories, issues, and pull requests.Last updated -129Python
- -securityFlicense-qualityA Multi-Claude Program for interacting with GitHub APIs through Claude Desktop, allowing users to search repositories, manage issues, pull requests, repository settings, workflows, and collaborators.Last updated -1Python
- -securityFlicense-qualityA Python implementation of an MCP server that enables secure, local Bitbucket integration for AI applications, providing tools for repository management, branch creation, file operations, issue tracking, and pull request creation.Last updated -1Python
Appeared in Searches
- A platform for code hosting and collaboration
- Exploring a GitHub repository and creating a detailed flowchart of its functionality
- A server for reading and navigating GitHub repositories using provided URLs
- A platform for managing and hosting Git repositories
- DevSecOps tools for integration with GitLab or development environments