
Bitbucket
Connects to Bitbucket Cloud and Server APIs to manage pull requests, code reviews, and branch workflows. Provides 29 tools for creating, updating, merging PRs and handling code review operations.
Integrates with Bitbucket's REST APIs to enable repository management, pull request handling, and workspace operations with TypeScript-based error handling and pagination support
What it does
- Create and update pull requests
- Merge pull requests with different strategies
- Add inline and threaded comments to PRs
- Approve or request changes on pull requests
- Retrieve structured line-by-line diffs
- Manage PR tasks and convert comments to tasks
Best for
About Bitbucket
Bitbucket is a community-built MCP server published by aashari that provides AI assistants with tools and capabilities via the Model Context Protocol. Easily enable Bitbucket and Jira integration with REST APIs for seamless repository management, pull requests, and works It is categorized under developer tools, productivity. This server exposes 6 tools that AI clients can invoke during conversations and coding sessions.
How to install
You can install Bitbucket in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
Bitbucket is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (6)
Read any Bitbucket data. Returns TOON format by default (30-60% fewer tokens than JSON). **IMPORTANT - Cost Optimization:** - ALWAYS use `jq` param to filter response fields. Unfiltered responses are very expensive! - Use `pagelen` query param to restrict result count (e.g., `pagelen: "5"`) - If unsure about available fields, first fetch ONE item with `pagelen: "1"` and NO jq filter to explore the schema, then use jq in subsequent calls **Schema Discovery Pattern:** 1. First call: `path: "/workspaces", queryParams: {"pagelen": "1"}` (no jq) - explore available fields 2. Then use: `jq: "values[*].{slug: slug, name: name, uuid: uuid}"` - extract only what you need **Output format:** TOON (default, token-efficient) or JSON (`outputFormat: "json"`) **Common paths:** - `/workspaces` - list workspaces - `/repositories/{workspace}` - list repos in workspace - `/repositories/{workspace}/{repo}` - get repo details - `/repositories/{workspace}/{repo}/pullrequests` - list PRs - `/repositories/{workspace}/{repo}/pullrequests/{id}` - get PR details - `/repositories/{workspace}/{repo}/pullrequests/{id}/comments` - list PR comments - `/repositories/{workspace}/{repo}/pullrequests/{id}/diff` - get PR diff - `/repositories/{workspace}/{repo}/refs/branches` - list branches - `/repositories/{workspace}/{repo}/commits` - list commits - `/repositories/{workspace}/{repo}/src/{commit}/{filepath}` - get file content - `/repositories/{workspace}/{repo}/diff/{source}..{destination}` - compare branches/commits **Query params:** `pagelen` (page size), `page` (page number), `q` (filter), `sort` (order), `fields` (sparse response) **Example filters (q param):** `state="OPEN"`, `source.branch.name="feature"`, `title~"bug"` **JQ examples:** `values[*].slug`, `values[0]`, `values[*].{name: name, uuid: uuid}` The `/2.0` prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Create Bitbucket resources. Returns TOON format by default (token-efficient). **IMPORTANT - Cost Optimization:** - Use `jq` param to extract only needed fields from response (e.g., `jq: "{id: id, title: title}"`) - Unfiltered responses include all metadata and are expensive! **Output format:** TOON (default) or JSON (`outputFormat: "json"`) **Common operations:** 1. **Create PR:** `/repositories/{workspace}/{repo}/pullrequests` body: `{"title": "...", "source": {"branch": {"name": "feature"}}, "destination": {"branch": {"name": "main"}}}` 2. **Add PR comment:** `/repositories/{workspace}/{repo}/pullrequests/{id}/comments` body: `{"content": {"raw": "Comment text"}}` 3. **Approve PR:** `/repositories/{workspace}/{repo}/pullrequests/{id}/approve` body: `{}` 4. **Request changes:** `/repositories/{workspace}/{repo}/pullrequests/{id}/request-changes` body: `{}` 5. **Merge PR:** `/repositories/{workspace}/{repo}/pullrequests/{id}/merge` body: `{"merge_strategy": "squash"}` (strategies: merge_commit, squash, fast_forward) The `/2.0` prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Replace Bitbucket resources (full update). Returns TOON format by default. **IMPORTANT - Cost Optimization:** - Use `jq` param to extract only needed fields from response - Example: `jq: "{uuid: uuid, name: name}"` **Output format:** TOON (default) or JSON (`outputFormat: "json"`) **Common operations:** 1. **Update repository:** `/repositories/{workspace}/{repo}` body: `{"description": "...", "is_private": true, "has_issues": true}` 2. **Create/update file:** `/repositories/{workspace}/{repo}/src` Note: Use multipart form data for file uploads (complex - prefer PATCH for metadata) 3. **Update branch restriction:** `/repositories/{workspace}/{repo}/branch-restrictions/{id}` body: `{"kind": "push", "pattern": "main", "users": [{"uuid": "..."}]}` The `/2.0` prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Partially update Bitbucket resources. Returns TOON format by default. **IMPORTANT - Cost Optimization:** Use `jq` param to filter response fields. **Output format:** TOON (default) or JSON (`outputFormat: "json"`) **Common operations:** 1. **Update PR title/description:** `/repositories/{workspace}/{repo}/pullrequests/{id}` body: `{"title": "New title", "description": "Updated description"}` 2. **Update PR reviewers:** `/repositories/{workspace}/{repo}/pullrequests/{id}` body: `{"reviewers": [{"uuid": "{user-uuid}"}]}` 3. **Update repository properties:** `/repositories/{workspace}/{repo}` body: `{"description": "New description"}` 4. **Update comment:** `/repositories/{workspace}/{repo}/pullrequests/{pr_id}/comments/{comment_id}` body: `{"content": {"raw": "Updated comment"}}` The `/2.0` prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Delete Bitbucket resources. Returns TOON format by default. **Output format:** TOON (default) or JSON (`outputFormat: "json"`) **Common operations:** 1. **Delete branch:** `/repositories/{workspace}/{repo}/refs/branches/{branch_name}` 2. **Delete PR comment:** `/repositories/{workspace}/{repo}/pullrequests/{pr_id}/comments/{comment_id}` 3. **Decline PR:** `/repositories/{workspace}/{repo}/pullrequests/{id}/decline` 4. **Remove PR approval:** `/repositories/{workspace}/{repo}/pullrequests/{id}/approve` 5. **Delete repository:** `/repositories/{workspace}/{repo}` (caution: irreversible) Note: Most DELETE endpoints return 204 No Content on success. The `/2.0` prefix is added automatically. API reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Connect AI to Your Bitbucket Repositories
Transform how you work with Bitbucket by connecting Claude, Cursor AI, and other AI assistants directly to your repositories, pull requests, and code. Get instant insights, automate code reviews, and streamline your development workflow.
What You Can Do
- Ask AI about your code: "What's the latest commit in my main repository?"
- Get PR insights: "Show me all open pull requests that need review"
- Search your codebase: "Find all JavaScript files that use the authentication function"
- Review code changes: "Compare the differences between my feature branch and main"
- Manage pull requests: "Create a PR for my new-feature branch"
- Automate workflows: "Add a comment to PR #123 with the test results"
Perfect For
- Developers who want AI assistance with code reviews and repository management
- Team Leads needing quick insights into project status and pull request activity
- DevOps Engineers automating repository workflows and branch management
- Anyone who wants to interact with Bitbucket using natural language
Requirements
- Node.js 18.0.0 or higher
- Bitbucket Cloud account (not Bitbucket Server/Data Center)
- Authentication credentials: Scoped API Token (recommended) or App Password (legacy)
Quick Start
Get up and running in 2 minutes:
1. Get Your Bitbucket Credentials
IMPORTANT: Bitbucket App Passwords are being deprecated and will be removed by June 2026. We recommend using Scoped API Tokens for new setups.
Option A: Scoped API Token (Recommended - Future-Proof)
Bitbucket is deprecating app passwords. Use the new scoped API tokens instead:
- Go to Atlassian API Tokens
- Click "Create API token with scopes"
- Select "Bitbucket" as the product
- Choose the appropriate scopes:
- For read-only access:
repository,workspace - For full functionality:
repository,workspace,pullrequest
- For read-only access:
- Copy the generated token (starts with
ATATT) - Use with your Atlassian email as the username
Option B: App Password (Legacy - Will be deprecated)
Generate a Bitbucket App Password (legacy method):
- Go to Bitbucket App Passwords
- Click "Create app password"
- Give it a name like "AI Assistant"
- Select these permissions:
- Workspaces: Read
- Repositories: Read (and Write if you want AI to create PRs/comments)
- Pull Requests: Read (and Write for PR management)
2. Try It Instantly
# Set your credentials (choose one method)
# Method 1: Scoped API Token (recommended - future-proof)
export ATLASSIAN_USER_EMAIL="[email protected]"
export ATLASSIAN_API_TOKEN="your_scoped_api_token" # Token starting with ATATT
# OR Method 2: Legacy App Password (will be deprecated June 2026)
export ATLASSIAN_BITBUCKET_USERNAME="your_username"
export ATLASSIAN_BITBUCKET_APP_PASSWORD="your_app_password"
# List your workspaces
npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/workspaces"
# List repositories in a workspace
npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/repositories/your-workspace"
# Get pull requests for a repository
npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/repositories/your-workspace/your-repo/pullrequests"
# Get repository details with JMESPath filtering
npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/repositories/your-workspace/your-repo" --jq "{name: name, language: language}"
Connect to AI Assistants
For Claude Desktop Users
Add this to your Claude configuration file (~/.claude/claude_desktop_config.json):
Option 1: Scoped API Token (recommended - future-proof)
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
"env": {
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_scoped_api_token"
}
}
}
}
Option 2: Legacy App Password (will be deprecated June 2026)
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-bitbucket"],
"env": {
"ATLASSIAN_BITBUCKET_USERNAME": "your_username",
"ATLASSIAN_BITBUCKET_APP_PASSWORD": "your_app_password"
}
}
}
}
Restart Claude Desktop, and you'll see the bitbucket server in the status bar.
For Other AI Assistants
Most AI assistants support MCP. You can either:
Option 1: Use npx (recommended - always latest version):
Configure your AI assistant to run: npx -y @aashari/mcp-server-atlassian-bitbucket
Option 2: Install globally:
npm install -g @aashari/mcp-server-atlassian-bitbucket
Then configure your AI assistant to use the MCP server with STDIO transport.
Supported AI assistants:
- Claude Desktop (official support)
- Cursor AI
- Continue.dev
- Cline
- Any MCP-compatible client
Alternative: Configuration File
Create ~/.mcp/configs.json for system-wide configuration:
Option 1: Scoped API Token (recommended - future-proof)
{
"bitbucket": {
"environments": {
"ATLASSIAN_USER_EMAIL": "[email protected]",
"ATLASSIAN_API_TOKEN": "your_scoped_api_token",
"BITBUCKET_DEFAULT_WORKSPACE": "your_main_workspace"
}
}
}
Option 2: Legacy App Password (will be deprecated June 2026)
{
"bitbucket": {
"environments": {
"ATLASSIAN_BITBUCKET_USERNAME": "your_username",
"ATLASSIAN_BITBUCKET_APP_PASSWORD": "your_app_password",
"BITBUCKET_DEFAULT_WORKSPACE": "your_main_workspace"
}
}
}
Alternative config keys: The system also accepts "atlassian-bitbucket", "@aashari/mcp-server-atlassian-bitbucket", or "mcp-server-atlassian-bitbucket" instead of "bitbucket".
Available Tools
This MCP server provides 6 generic tools that can access any Bitbucket API endpoint:
| Tool | Description | Parameters |
|---|---|---|
bb_get | GET any Bitbucket API endpoint (read data) | path, queryParams?, jq?, outputFormat? |
bb_post | POST to any endpoint (create resources) | path, body, queryParams?, jq?, outputFormat? |
bb_put | PUT to any endpoint (replace resources) | path, body, queryParams?, jq?, outputFormat? |
bb_patch | PATCH any endpoint (partial updates) | path, body, queryParams?, jq?, outputFormat? |
bb_delete | DELETE any endpoint (remove resources) | path, queryParams?, jq?, outputFormat? |
bb_clone | Clone a repository locally | workspaceSlug?, repoSlug, targetPath |
Tool Parameters
All API tools support these common parameters:
path(required): API endpoint path starting with/(the/2.0prefix is added automatically)queryParams(optional): Key-value pairs for query parameters (e.g.,{"pagelen": "25", "page": "2"})jq(optional): JMESPath expression to filter/transform the response - highly recommended to reduce token costsoutputFormat(optional):"toon"(default, 30-60% fewer tokens) or"json"body(required for POST/PUT/PATCH): Request body as JSON object
Common API Paths
All paths automatically have /2.0 prepended. Full Bitbucket Cloud REST API 2.0 reference: https://developer.atlassian.com/cloud/bitbucket/rest/
Workspaces & Repositories:
/workspaces- List all workspaces/repositories/{workspace}- List repos in workspace/repositories/{workspace}/{repo}- Get repo details/repositories/{workspace}/{repo}/refs/branches- List branches/repositories/{workspace}/{repo}/refs/branches/{branch_name}- Get/delete branch/repositories/{workspace}/{repo}/commits- List commits/repositories/{workspace}/{repo}/commits/{commit}- Get commit details/repositories/{workspace}/{repo}/src/{commit}/{filepath}- Get file content
Pull Requests:
/repositories/{workspace}/{repo}/pullrequests- List PRs (GET) or create PR (POST)/repositories/{workspace}/{repo}/pullrequests/{id}- Get/update/delete PR/repositories/{workspace}/{repo}/pullrequests/{id}/diff- Get PR diff/repositories/{workspace}/{repo}/pullrequests/{id}/comments- List/add PR comments/repositories/{workspace}/{repo}/pullrequests/{id}/approve- Approve PR (POST) or remove approval (DELETE)/repositories/{workspace}/{repo}/pullrequests/{id}/request-changes- Request changes (POST)/repositories/{workspace}/{repo}/pullrequests/{id}/merge- Merge PR (POST)/repositories/{workspace}/{repo}/pullrequests/{id}/decline- Decline PR (POST)
Comparisons:
/repositories/{workspace}/{repo}/diff/{source}..{destination}- Compare branches/commits
Other Resources:
/repositories/{workspace}/{repo}/issues- List/manage issues/repositories/{workspace}/{repo}/downloads- List/manage downloads/repositories/{workspace}/{repo}/pipelines- Access Bitbucket Pipelines/repositories/{workspace}/{repo}/deployments- View deployments
TOON Output Format
What is TOON? Token-Oriented Object Notation is a format optimized for LLMs that reduces token consumption by 30-60% compared to JSON. It uses tabular arrays and minimal syntax while preserving all data.
Default behavior: All tools return TOON format by default. You can override this with outputFormat: "json" if needed.
Example comparison:
JSON (verbose):
{
"values": [
{"name": "repo1", "slug": "repo-1"},
{
---
*README truncated. [View full README on GitHub](https://github.com/aashari/mcp-server-atlassian-bitbucket).*
Alternatives
Related Skills
Browse all skillsUI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Leveraging AI coding assistants and tools to boost development productivity, while maintaining oversight to ensure quality results.
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Creates educational Teams channel posts for internal knowledge sharing about Claude Code features, tools, and best practices. Applies when writing posts, announcements, or documentation to teach colleagues effective Claude Code usage, announce new features, share productivity tips, or document lessons learned. Provides templates, writing guidelines, and structured approaches emphasizing concrete examples, underlying principles, and connections to best practices like context engineering. Activates for content involving Teams posts, channel announcements, feature documentation, or tip sharing.
Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.