The Atlassian Bitbucket MCP Server enables AI systems to securely interact with Bitbucket Cloud repositories, pull requests, workspaces, and code in real time.
With this server, you can:
- Access and manage workspaces: List, filter, and retrieve workspace information
- Explore repositories: Search, list, and get repository metadata
- Manage pull requests: List, filter, create, and comment on PRs
- Search and access code: Perform advanced searches, retrieve file content
- Work with branches: Create branches, list them, and view diffs
- Track commits: Access commit history and compare changes
- Clone repositories: Download repositories locally for development
The server operates locally with your credentials (no remote token storage) and provides Markdown-formatted responses for seamless AI system integration.
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
A Node.js/TypeScript Model Context Protocol (MCP) server for Atlassian Bitbucket Cloud. Enables AI systems (e.g., LLMs like Claude or Cursor AI) to securely interact with your repositories, pull requests, workspaces, and code in real time.
Why Use This Server?
- Minimal Input, Maximum Output: Simple identifiers provide comprehensive details without requiring extra flags.
- Rich Code Visualization: Get detailed insights into code changes with file statistics, diff views, and smart context.
- Secure Local Authentication: Run locally with your credentials, never storing tokens on remote servers.
- Intuitive Markdown Responses: Well-structured, consistent Markdown formatting for all outputs.
- Full Bitbucket Integration: Access workspaces, repositories, pull requests, comments, code search, and more.
What is MCP?
Model Context Protocol (MCP) is an open standard for securely connecting AI systems to external tools and data sources. This server implements MCP for Bitbucket Cloud, enabling AI assistants to interact with your Bitbucket data programmatically.
Prerequisites
- Node.js (>=18.x): Download
- Bitbucket Cloud Account
Setup
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
You can also set BITBUCKET_DEFAULT_WORKSPACE
to specify a default workspace when not explicitly provided.
Option B: Atlassian API Token
Generate one from Atlassian API Tokens.
Note: Bitbucket App Passwords are strongly recommended as they provide more granular, Bitbucket-specific permissions.
Step 2: Configure Credentials
Option A: MCP Config File (Recommended)
Edit or create ~/.mcp/configs.json
:
Using Bitbucket App Password:
Using Atlassian API Token:
Option B: Environment Variables
Step 3: Install and Run
Quick Start with npx
Global Installation
Step 4: Connect to AI Assistant
Configure your MCP-compatible client (e.g., Claude, Cursor AI):
MCP Tools
MCP tools use snake_case
names, camelCase
parameters, and return Markdown-formatted responses.
- bb_ls_workspaces: Lists available workspaces (
query
: str opt). Use: View accessible workspaces. - bb_get_workspace: Gets workspace details (
workspaceSlug
: str req). Use: View workspace information. - bb_ls_repos: Lists repositories (
workspaceSlug
: str opt,projectKey
: str opt,query
: str opt,role
: str opt). Use: Find repositories. - bb_get_repo: Gets repository details (
workspaceSlug
: str req,repoSlug
: str req). Use: Access repo information. - bb_search: Searches Bitbucket content (
workspaceSlug
: str req,query
: str req,scope
: str opt,language
: str opt,extension
: str opt). Use: Find code or PRs. - bb_ls_prs: Lists pull requests (
workspaceSlug
: str req,repoSlug
: str req,state
: str opt). Use: View open or merged PRs. - bb_get_pr: Gets PR details (
workspaceSlug
: str req,repoSlug
: str req,prId
: str req). Use: View PR details with diffs. - bb_ls_pr_comments: Lists PR comments (
workspaceSlug
: str req,repoSlug
: str req,prId
: str req). Use: View PR discussions. - bb_add_pr_comment: Adds comment to PR (
workspaceSlug
: str req,repoSlug
: str req,prId
: str req,content
: str req,inline
: obj opt). Use: Add feedback to PRs. - bb_add_pr: Creates a PR (
workspaceSlug
: str req,repoSlug
: str req,title
: str req,sourceBranch
: str req,targetBranch
: str opt). Use: Create new PRs. - bb_add_branch: Creates a branch (
workspaceSlug
: str req,repoSlug
: str req,newBranchName
: str req,sourceBranchOrCommit
: str opt). Use: Create a feature branch. - bb_clone_repo: Clones a repository (
workspaceSlug
: str req,repoSlug
: str req,targetPath
: str req). Use: Clone code locally. - bb_get_commit_history: Gets commit history (
workspaceSlug
: str req,repoSlug
: str req,revision
: str opt,path
: str opt). Use: View code history. - bb_get_file: Gets file content (
workspaceSlug
: str req,repoSlug
: str req,filePath
: str req,revision
: str opt). Use: View specific file. - bb_diff_branches: Shows diff between branches (
workspaceSlug
: str req,repoSlug
: str req,sourceBranch
: str req,targetBranch
: str req). Use: Compare branches. - bb_diff_commits: Shows diff between commits (
workspaceSlug
: str req,repoSlug
: str req,sourceCommit
: str req,targetCommit
: str req). Use: Compare commits. - bb_list_branches: Lists branches (
workspaceSlug
: str req,repoSlug
: str req,query
: str opt,sort
: str opt). Use: View all branches.
bb_ls_workspaces
List All Workspaces:
Search Workspaces:
bb_get_workspace
Get Workspace Details:
bb_ls_repos
List Repos in Workspace:
List Repos Using Default Workspace:
bb_get_repo
Get Repository Details:
bb_search
Search Code:
bb_ls_prs
List Open PRs:
bb_get_pr
Get PR Details:
bb_ls_pr_comments
List PR Comments:
bb_add_pr_comment
Add General Comment:
Add Inline Comment:
bb_add_pr
Create Pull Request:
bb_add_branch
Create New Branch:
bb_clone_repo
Clone Repository:
bb_get_commit_history
View Commit History:
Filtered Commit History:
bb_get_file
Get File Content:
bb_diff_branches
Compare Branches:
bb_diff_commits
Compare Commits:
bb_list_branches
List All Branches:
Filtered Branches:
CLI Commands
CLI commands use kebab-case
. Run --help
for details (e.g., mcp-atlassian-bitbucket ls-workspaces --help
).
- ls-workspaces: Lists workspaces (
--query
). Ex:mcp-atlassian-bitbucket ls-workspaces
. - get-workspace: Gets workspace details (
--workspace-slug
). Ex:mcp-atlassian-bitbucket get-workspace --workspace-slug acme-corp
. - ls-repos: Lists repos (
--workspace-slug
,--project-key
,--query
). Ex:mcp-atlassian-bitbucket ls-repos --workspace-slug acme-corp
. - get-repo: Gets repo details (
--workspace-slug
,--repo-slug
). Ex:mcp-atlassian-bitbucket get-repo --workspace-slug acme-corp --repo-slug backend-api
. - search: Searches code (
--workspace-slug
,--query
,--scope
,--language
). Ex:mcp-atlassian-bitbucket search --workspace-slug acme-corp --query "auth"
. - ls-prs: Lists PRs (
--workspace-slug
,--repo-slug
,--state
). Ex:mcp-atlassian-bitbucket ls-prs --workspace-slug acme-corp --repo-slug backend-api
. - get-pr: Gets PR details (
--workspace-slug
,--repo-slug
,--pr-id
). Ex:mcp-atlassian-bitbucket get-pr --workspace-slug acme-corp --repo-slug backend-api --pr-id 42
. - ls-pr-comments: Lists PR comments (
--workspace-slug
,--repo-slug
,--pr-id
). Ex:mcp-atlassian-bitbucket ls-pr-comments --workspace-slug acme-corp --repo-slug backend-api --pr-id 42
. - add-pr-comment: Adds PR comment (
--workspace-slug
,--repo-slug
,--pr-id
,--content
). Ex:mcp-atlassian-bitbucket add-pr-comment --workspace-slug acme-corp --repo-slug backend-api --pr-id 42 --content "Looks good"
. - add-pr: Creates PR (
--workspace-slug
,--repo-slug
,--title
,--source-branch
). Ex:mcp-atlassian-bitbucket add-pr --workspace-slug acme-corp --repo-slug backend-api --title "New feature" --source-branch feature/login
. - get-file: Gets file content (
--workspace-slug
,--repo-slug
,--file-path
). Ex:mcp-atlassian-bitbucket get-file --workspace-slug acme-corp --repo-slug backend-api --file-path src/main.js
. - add-branch: Creates branch (
--workspace-slug
,--repo-slug
,--new-branch-name
). Ex:mcp-atlassian-bitbucket add-branch --workspace-slug acme-corp --repo-slug backend-api --new-branch-name feature/new
.
List and View Workspaces/Repos
Working with Pull Requests
Code and Commits
Branch Management
Response Format
All responses are Markdown-formatted, including:
- Title: Operation performed or entity viewed.
- Context: Workspace, repository, pull request, or branch information.
- Content: Primary data such as file content, PR details, or search results.
- Metadata: Timestamps, authors, and statistics.
- Diffs: Code changes with syntax highlighting for diffs between branches/commits.
Repository Details
Pull Request Review
Development
Contributing
Contributions are welcome! Please:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/xyz
). - Commit changes (
git commit -m "Add xyz feature"
). - Push to the branch (
git push origin feature/xyz
). - Open a pull request.
See CONTRIBUTING.md for details.
License
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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
- -securityFlicense-qualityA custom server implementation that allows AI assistants to interact with GitLab repositories, providing capabilities for searching, fetching files, creating/updating content, and managing issues and merge requests.Last updated -JavaScript
- -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
- -securityAlicense-qualityConnects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.Last updated -JavaScriptMIT License