Atlassian Bitbucket MCP Server

Atlassian Bitbucket MCP Server

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.

aashari

Developer Tools
Visit Server

Tools

list-workspaces

List Bitbucket workspaces available to your account. PURPOSE: Discovers workspaces you have access to with their slugs, names, and permission levels to help navigate Bitbucket's organization structure. WHEN TO USE: - When you need to discover what workspaces exist in your Bitbucket account - When you want to find the slugs needed for other Bitbucket operations - When you need to check what workspaces you have access to and their permission levels - Before accessing repositories or pull requests that require workspace information - When you're unfamiliar with the workspace organization structure WHEN NOT TO USE: - When you already know the workspace slug (use get-workspace or list-repositories instead) - When you need detailed workspace information (use get-workspace instead) - When you need to find specific repositories (use list-repositories after identifying the workspace) RETURNS: Formatted list of workspaces with slugs, names, and permission information, plus pagination details if available. EXAMPLES: - List all workspaces: {} - With sorting: {sort: "name"} - With pagination: {limit: 10, cursor: "next-page-token"} ERRORS: - Authentication failures: Check your Bitbucket credentials - No workspaces found: You might not have access to any workspaces - Rate limiting: Use pagination and reduce query frequency

get-workspace

Get detailed information about a specific Bitbucket workspace by slug. PURPOSE: Retrieves comprehensive workspace metadata including projects, permissions, and configuration. WHEN TO USE: - When you need detailed information about a specific workspace - When you need to check workspace permissions or membership - When you need to verify workspace settings or configuration - After using list-workspaces to identify the relevant workspace - Before performing operations that require detailed workspace context WHEN NOT TO USE: - When you don't know which workspace to look for (use list-workspaces first) - When you just need basic workspace information (slug, name) - When you're only interested in repositories (use list-repositories directly) RETURNS: Detailed workspace information including slug, name, type, description, projects, and permission levels. EXAMPLES: - Get workspace: {workspace: "myteam"} ERRORS: - Workspace not found: Verify the workspace slug is correct - Permission errors: Ensure you have access to the requested workspace - Rate limiting: Cache workspace information when possible

list-repositories

List Bitbucket repositories within a specific workspace. PURPOSE: Discovers repositories in a workspace with their slugs, names, and URLs to help navigate code resources. WHEN TO USE: - When you need to find repositories within a specific workspace - When you need repository slugs for other Bitbucket operations - When you want to explore available repositories before accessing specific content - When you need to check repository visibility and access levels - When looking for repositories with specific characteristics (language, size, etc.) WHEN NOT TO USE: - When you don't know which workspace to look for repos in (use list-workspaces first) - When you already know the repository slug (use get-repository instead) - When you need detailed repository information (use get-repository instead) - When you need to access pull requests or branches (use dedicated tools after identifying the repo) RETURNS: Formatted list of repositories with slugs, names, descriptions, URLs, and metadata, plus pagination info. EXAMPLES: - List all repos in workspace: {workspace: "myteam"} - With sorting: {workspace: "myteam", sort: "name"} - With filtering: {workspace: "myteam", query: "api"} - With pagination: {workspace: "myteam", limit: 10, cursor: "next-page-token"} ERRORS: - Workspace not found: Verify the workspace slug is correct - Authentication failures: Check your Bitbucket credentials - Permission errors: Ensure you have access to the requested workspace - Rate limiting: Use pagination and reduce query frequency

get-repository

Get detailed information about a specific Bitbucket repository. PURPOSE: Retrieves comprehensive repository metadata including branches, settings, permissions, and more. WHEN TO USE: - When you need detailed information about a specific repository - When you need repository URLs, clone links, or other reference information - When you need to check repository settings or permissions - After using list-repositories to identify the relevant repository - Before performing operations that require repository context (PRs, branches) WHEN NOT TO USE: - When you don't know which repository to look for (use list-repositories first) - When you just need basic repository information - When you're looking for pull request details (use list-pullrequests instead) - When you need content from multiple repositories (use list-repositories instead) RETURNS: Detailed repository information including slug, name, description, URLs, branch information, and settings. EXAMPLES: - Get repository: {workspace: "myteam", repoSlug: "project-api"} ERRORS: - Repository not found: Verify workspace and repository slugs - Permission errors: Ensure you have access to the requested repository - Rate limiting: Cache repository information when possible

list-pull-requests

List Bitbucket pull requests with optional filtering capabilities. PURPOSE: Allows you to find and browse pull requests across repositories with filtering options. WHEN TO USE: - When you need to find pull requests within a specific repository - When you want to check PR status (open, merged, declined, etc.) - When you need to track code review activity and progress - When you need PR IDs for other Bitbucket operations - When monitoring contributions from specific authors WHEN NOT TO USE: - When you don't know which repository to look in (use list-repositories first) - When you already know the PR ID (use get-pull-request instead) - When you need detailed PR content or comments (use get-pull-request instead) - When you need to browse repositories rather than PRs (use list-repositories) RETURNS: Formatted list of pull requests with IDs, titles, states, authors, branch information, and URLs, plus pagination info. EXAMPLES: - List all PRs in a repo: {workspace: "myteam", repoSlug: "project-api"} - Filter by state: {workspace: "myteam", repoSlug: "project-api", state: "OPEN"} - With pagination: {workspace: "myteam", repoSlug: "project-api", limit: 10, cursor: "next-page-token"} ERRORS: - Repository not found: Verify workspace and repository slugs - Authentication failures: Check your Bitbucket credentials - Permission errors: Ensure you have access to the requested repository - Rate limiting: Use pagination and reduce query frequency

get-pull-request

Get detailed information about a specific Bitbucket pull request. PURPOSE: Retrieves comprehensive PR data including description, comments, diff stats, reviewers, and branch information. WHEN TO USE: - When you need the full description and context of a specific PR - When you need to see comments, reviews, or approvals - When you need details about the source and destination branches - When you need diff statistics or changed files information - After using list-pull-requests to identify the relevant PR ID WHEN NOT TO USE: - When you don't know which PR to look for (use list-pull-requests first) - When you need to browse multiple PRs (use list-pull-requests instead) - When you only need basic PR information without comments or details - When you need repository information rather than PR details (use get-repository) RETURNS: Detailed PR information including title, description, status, author, reviewers, branches, comments, and related timestamps. EXAMPLES: - Get PR details: {workspace: "myteam", repoSlug: "project-api", id: 42} ERRORS: - PR not found: Verify workspace, repository slugs, and PR ID - Permission errors: Ensure you have access to the requested PR - Rate limiting: Cache PR information when possible for frequently referenced PRs

README

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 and repoSlug 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.


Step 2: Configure Credentials

Method A: MCP Config File (Recommended)

Create or edit ~/.mcp/configs.json:

Using Bitbucket App Password:

{
	"@aashari/mcp-server-atlassian-bitbucket": {
		"environments": {
			"ATLASSIAN_BITBUCKET_USERNAME": "<your_username>",
			"ATLASSIAN_BITBUCKET_APP_PASSWORD": "<your_app_password>"
		}
	}
}

Using Atlassian API Token:

{
	"@aashari/mcp-server-atlassian-bitbucket": {
		"environments": {
			"ATLASSIAN_SITE_NAME": "bitbucket",
			"ATLASSIAN_USER_EMAIL": "<your_email>",
			"ATLASSIAN_API_TOKEN": "<your_api_token>"
		}
	}
}

Method B: Environment Variables

Pass credentials directly when running the server:

ATLASSIAN_BITBUCKET_USERNAME="<your_username>" \
ATLASSIAN_BITBUCKET_APP_PASSWORD="<your_app_password>" \
npx -y @aashari/mcp-server-atlassian-bitbucket

Step 3: Connect Your AI Assistant

Configure your MCP-compatible client to launch this server.

Claude / Cursor Configuration:

{
	"mcpServers": {
		"aashari/mcp-server-atlassian-bitbucket": {
			"command": "npx",
			"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"]
		}
	}
}

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.

list_workspaces

List available Bitbucket workspaces.

{}

or:

{ "query": "devteam" }

"Show me all my Bitbucket workspaces."


get_workspace

Get full details for a specific workspace.

{ "workspaceSlug": "acme-corp" }

"Tell me more about the 'acme-corp' workspace."


list_repositories

List repositories in a workspace.

{ "workspaceSlug": "acme-corp" }

or:

{ "workspaceSlug": "acme-corp", "query": "api" }

"List repositories in 'acme-corp'."


get_repository

Get details of a specific repository.

{ "workspaceSlug": "acme-corp", "repoSlug": "backend-api" }

"Show me the 'backend-api' repository in 'acme-corp'."


search

Search Bitbucket content.

Repositories:

{ "workspaceSlug": "acme-corp", "query": "api", "scope": "repositories" }

Pull Requests:

{
	"workspaceSlug": "acme-corp",
	"repoSlug": "backend-api",
	"query": "fix",
	"scope": "pullrequests"
}

Commits:

{
	"workspaceSlug": "acme-corp",
	"repoSlug": "backend-api",
	"query": "update",
	"scope": "commits"
}

Code:

{ "workspaceSlug": "acme-corp", "query": "function getUser", "scope": "code" }

"Search for 'function getUser' in the 'acme-corp' workspace."


list_pull_requests

List pull requests in a repository.

{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "state": "OPEN" }

"Show open PRs in 'frontend-app'."


get_pull_request

Get full details of a pull request, including code diffs and file changes.

{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42" }

"Get PR #42 from 'frontend-app' with all code changes."


list_pr_comments

List comments on a specific pull request.

{ "workspaceSlug": "acme-corp", "repoSlug": "frontend-app", "prId": "42" }

"Show me all comments on PR #42."


add_pr_comment

Add a comment to a pull request.

General:

{
	"workspaceSlug": "acme-corp",
	"repoSlug": "frontend-app",
	"prId": "42",
	"content": "Looks good."
}

Inline:

{
	"workspaceSlug": "acme-corp",
	"repoSlug": "frontend-app",
	"prId": "42",
	"content": "Consider refactoring.",
	"inline": { "path": "src/utils.js", "line": 42 }
}

"Add a comment to PR #42 on line 42."


pull_requests_create

Create a new pull request.

{
	"workspaceSlug": "acme-corp",
	"repoSlug": "frontend-app",
	"title": "Add login screen",
	"sourceBranch": "feature/login"
}

"Create a PR from 'feature/login' to 'main'."


Command-Line Interface (CLI)

The CLI uses kebab-case for commands (e.g., list-workspaces) and options (e.g., --workspace-slug).

Quick Use with npx

npx -y @aashari/mcp-server-atlassian-bitbucket list-workspaces
npx -y @aashari/mcp-server-atlassian-bitbucket get-repository \
  --workspace-slug acme-corp \
  --repo-slug backend-api

Install Globally

npm install -g @aashari/mcp-server-atlassian-bitbucket

Then run directly:

mcp-atlassian-bitbucket list-workspaces

Discover More CLI Options

Use --help to see flags and usage for all available commands:

mcp-atlassian-bitbucket --help

Or get detailed help for a specific command:

mcp-atlassian-bitbucket get-repository --help
mcp-atlassian-bitbucket list-pull-requests --help
mcp-atlassian-bitbucket search --help

License

ISC License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python