Atlassian Bitbucket
About
Interact with Atlassian Bitbucket Cloud to manage repositories, pull requests, workspaces, and code.
Details
- Author
- askanuradha
- Categories
- Developer Tools, Other, Infrastructure, Project Management
Jump to
Setup
Install Atlassian Bitbucket in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/askanuradha/mcp-server-atlassian-bitbucket
Follow the installation instructions in the repository README, then restart your MCP client.
Interact with Atlassian Bitbucket Cloud to manage repositories, pull requests, workspaces, and code.
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.
- 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.
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.
- Node.js(>=18.x):Download
- Bitbucket Cloud Account
Choose one of the following authentication methods:
Option A: Bitbucket App Password (Recommended)
Generate one fromBitbucket App Passwords. Minimum permissions:
- Workspaces: Read
- Repositories: Read
- Pull Requests: Read
You can also setBITBUCKET_DEFAULT_WORKSPACEto specify a default workspace when not explicitly provided.
Generate one fromAtlassian API Tokens.
Note:Bitbucket App Passwords are strongly recommended as they provide more granular, Bitbucket-specific permissions.
{ "bitbucket": { "environments": { "ATLASSIAN_BITBUCKET_USERNAME": "<your_username>", "ATLASSIAN_BITBUCKET_APP_PASSWORD": "<your_app_password>" } } }
{ "bitbucket": { "environments": { "ATLASSIAN_SITE_NAME": "bitbucket", "ATLASSIAN_USER_EMAIL": "<your_email>", "ATLASSIAN_API_TOKEN": "<your_api_token>" } } }
export ATLASSIAN_BITBUCKET_USERNAME="<your_username>" export ATLASSIAN_BITBUCKET_APP_PASSWORD="<your_app_password>"
npx -y @aashari/mcp-server-atlassian-bitbucket ls-workspaces
npm install -g @aashari/mcp-server-atlassian-bitbucket mcp-atlassian-bitbucket ls-workspaces
Configure your MCP-compatible client (e.g., Claude, Cursor AI):
{ "mcpServers": { "bitbucket": { "command": "npx", "args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"] } } }
MCP tools usesnake_casenames,camelCaseparameters, 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.
{ "query": "devteam" }
{ "workspaceSlug": "acme-corp" }
{ "workspaceSlug": "acme-corp", "projectKey": "PROJ" }
{ "projectKey": "PROJ" }
{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api" }
{ "workspaceSlug": "acme-corp", "query": "Logger", "scope": "code", "language": "typescript" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "state": "OPEN" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42", "content": "Looks good." }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42", "content": "Consider refactoring.", "inline": { "path": "src/utils.js", "line": 42 } }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "title": "Add login screen", "sourceBranch": "feature/login" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "newBranchName": "feature/new-feature", "sourceBranchOrCommit": "main" }
{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api", "targetPath": "/Users/me/projects" }
{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api" }
{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api", "revision": "develop", "path": "src/main/java/com/acme/service/UserService.java" }
{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api", "filePath": "src/main/java/com/acme/service/Application.java", "revision": "main" }
{ "workspaceSlug": "acme-corp", "repoSlug": "web-app", "sourceBranch": "develop", "targetBranch": "main" }
{ "workspaceSlug": "acme-corp", "repoSlug": "web-app", "sourceCommit": "a1b2c3d", "targetCommit": "e4f5g6h" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app" }
{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "query": "feature/", "sort": "name" }
CLI commands usekebab-case. Run--helpfor 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 all workspaces mcp-atlassian-bitbucket ls-workspaces # Get details of a specific workspace mcp-atlassian-bitbucket get-workspace --workspace-slug acme-corp # List repositories in a workspace mcp-atlassian-bitbucket ls-repos --workspace-slug acme-corp --project-key PROJ # Get details of a specific repository mcp-atlassian-bitbucket get-repo --workspace-slug acme-corp --repo-slug backend-api
# List open pull requests in a repository mcp-atlassian-bitbucket ls-prs --workspace-slug acme-corp --repo-slug frontend-app --state OPEN # Get details of a specific pull request with code changes mcp-atlassian-bitbucket get-pr --workspace-slug acme-corp --repo-slug frontend-app --pr-id 42 # List comments on a pull request mcp-atlassian-bitbucket ls-pr-comments --workspace-slug acme-corp --repo-slug frontend-app --pr-id 42 # Add a comment to a pull request mcp-atlassian-bitbucket add-pr-comment --workspace-slug acme-corp --repo-slug frontend-app --pr-id 42 --content "Looks good to merge." # Create a new pull request mcp-atlassian-bitbucket add-pr --workspace-slug acme-corp --repo-slug frontend-app --title "Add login screen" --source-branch feature/login
# Search for code mcp-atlassian-bitbucket search --workspace-slug acme-corp --query "Logger" --scope code --language typescript # View commit history mcp-atlassian-bitbucket get-commit-history --workspace-slug acme-corp --repo-slug backend-api --revision develop # Get file content mcp-atlassian-bitbucket get-file --workspace-slug acme-corp --repo-slug backend-api --file-path "src/Application.java" --revision main # Compare branches mcp-atlassian-bitbucket diff-branches --workspace-slug acme-corp --repo-slug web-app --source-branch develop --target-branch main # Compare commits mcp-atlassian-bitbucket diff-commits --workspace-slug acme-corp --repo-slug web-app --source-commit a1b2c3d --target-commit e4f5g6h
# List branches mcp-atlassian-bitbucket list-branches --workspace-slug acme-corp --repo-slug frontend-app --query "feature/" --sort name # Create a new branch mcp-atlassian-bitbucket add-branch --workspace-slug acme-corp --repo-slug frontend-app --new-branch-name feature/new-feature --source-branch-or-commit main # Clone a repository mcp-atlassian-bitbucket clone --workspace-slug acme-corp --repo-slug backend-api --target-path ./cloned-projects
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: backend-api Workspace: acme-corp Full Name: acme-corp/backend-api Language: Java Created: 2024-01-15 by John Smith Updated: 2025-05-10 (2 days ago) ## Overview Spring Boot backend API for the ACME product suite. ## Statistics - Default Branch: main - Size: 24.5 MB - Commits: 358 - Open PRs: 4 - Forks: 3 ## Recent Activity - PR #42: "Add OAuth2 support" by Jane Doe (Open) - PR #41: "Fix pagination bug" by Alex Kim (Merged) - PR #40: "Update dependencies" by John Smith (Merged) Repository URL: https://bitbucket.org/acme-corp/backend-api
# Pull Request #42: Add OAuth2 support Repository: acme-corp/backend-api Author: Jane Doe State: OPEN Created: 2025-05-15 (4 days ago) Updated: 2025-05-18 (yesterday) ## Description Implements OAuth2 authentication flow with support for: - Authorization code grant - Refresh tokens - Token caching ## Changes - Files changed: 7 - Additions: 245 lines - Deletions: 32 lines ## Diff for src/auth/OAuthService.java @@ -10,6 +10,25 @@ public class OAuthService { private final TokenRepository tokenRepository; private final HttpClient httpClient; + @Autowired + public OAuthService( + TokenRepository tokenRepository, + HttpClient httpClient) { + this.tokenRepository = tokenRepository; + this.httpClient = httpClient; + } + + public TokenResponse refreshToken(String refreshToken) { + // Validate refresh token + if (StringUtils.isEmpty(refreshToken)) { + throw new InvalidTokenException("Refresh token cannot be empty"); + } + + // Call OAuth server for new access token + return httpClient.post("/oauth/token") + .body(Map.of("grant_type", "refresh_token", "refresh_token", refreshToken)) + .execute() + .as(TokenResponse.class); + } ## Comments (3) 1. John Smith (2 days ago): > Please add unit tests for the refresh token flow 2. Jane Doe (yesterday): > Added tests in the latest commit 3. Approval by: Alex Kim (yesterday) Pull Request URL: https://bitbucket.org/acme-corp/backend-api/pull-requests/42
# Clone repository git clone https://github.com/aashari/mcp-server-atlassian-bitbucket.git cd mcp-server-atlassian-bitbucket # Install dependencies npm install # Run in development mode npm run dev:server # Run tests npm test
- 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.
Manage pull requests on Bitbucket Server.
Model Context Protocol (MCP) server for GitLab — exposes 1006 GitLab REST & GraphQL API operations as MCP tools (28 meta-tools / 43 enterprise), 24 resources, 38 prompts, and 17 completion types for AI assistants. Written in Go, single static binary, stdio and HTTP transport.
Gitee API integration, repository, issue, and pull request management, and more.
Perform Git operations on Azure DevOps repositories using a Personal Access Token (PAT).
An improved GitLab MCP server with bug fixes, providing access to GitLab projects, issues, and merge requests.
An improved GitLab MCP server with bug fixes and enhancements for accessing GitLab resources.
Access the Bitbucket Cloud API for automation, CI/CD pipelines, and integrations.
Manage Bitbucket repositories, pull requests, and pipelines via the Bitbucket API for both Cloud and Server.
A custom GitLab server for interacting with repositories, issues, and merge requests. Requires a GitLab Personal Access Token.
A server for seamless integration with self-hosted Gitea platforms, allowing management of repositories and other resources.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





