MCP Bitbucket Server
Allows creating, listing, and preparing pull requests with automatic title and description generation, using the Bitbucket API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Bitbucket Serverlist my open pull requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Bitbucket Server
An MCP (Model Context Protocol) server to interact with Bitbucket through automated tools.
Installation
1. Clone the repository
git clone <repository-url>
cd bitbucket2. Install dependencies
Option A: With pnpm (recommended)
pnpm installOption B: With npm
npm install3. Configure environment variables
Create a .env file in the project root with your Bitbucket credentials:
BITBUCKET_EMAIL=your_email@example.com
BITBUCKET_API_TOKEN=your_api_token
BITBUCKET_WORKSPACE=your_workspace
BITBUCKET_REVIEWER_UUID=reviewer_uuid_optional
BITBUCKET_API_BASE_URL=https://api.bitbucket.org/2.0
BITBUCKET_DEFAULT_DESTINATION_BRANCH=develop
BITBUCKET_CLOSE_SOURCE_BRANCH=trueVariable descriptions:
BITBUCKET_EMAIL: Your Bitbucket account emailBITBUCKET_API_TOKEN: Your Bitbucket App Password (not your regular password)BITBUCKET_WORKSPACE: Your Bitbucket workspace nameBITBUCKET_REVIEWER_UUID: (Optional) UUID of the default reviewer for pull requests. Use a comma-separated list for several reviewersBITBUCKET_API_BASE_URL: (Optional) Base URL for Bitbucket API (default: https://api.bitbucket.org/2.0)BITBUCKET_DEFAULT_DESTINATION_BRANCH: (Optional) Default destination branch for pull requests (default: develop)BITBUCKET_CLOSE_SOURCE_BRANCH: (Optional) Whether to close source branch after merge (default: true)
Related MCP server: Atlassian Bitbucket MCP
MCP Configuration
Add the following configuration to your MCP settings file (usually in ~/.config/mcp/settings.json or similar):
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["tsx", "/full/path/to/project/src/server.ts"],
"env": {
"BITBUCKET_EMAIL": "your_email@example.com",
"BITBUCKET_API_TOKEN": "your_api_token",
"BITBUCKET_WORKSPACE": "your_workspace",
"BITBUCKET_REVIEWER_UUID": "reviewer_uuid_optional",
"BITBUCKET_API_BASE_URL": "https://api.bitbucket.org/2.0",
"BITBUCKET_DEFAULT_DESTINATION_BRANCH": "develop",
"BITBUCKET_CLOSE_SOURCE_BRANCH": "true"
}
}
}
}Note: Replace /full/path/to/project with the absolute path where you have cloned this project.
Usage
Once configured, you can use the following tools from your MCP client:
Prepare Pull Request (
prepare-pull-request-automatically): Automatically generate the title, description, branches and project for a pull requestCreate Pull Request (
create-pull-request): Create a pull request (optionally as a draft)List Pull Requests (
list-pull-request): View the open pull requests of a repositoryReview Pull Request (
review-pull-request): Show the diff, metadata, approvals and comments of a pull requestComment Pull Request (
comment-pull-request): Add a comment to an existing pull request
Using it with a skill (recommended)
The MCP tools work on their own, but the assistant gets much better results when it also has a skill: a short instructions file that tells it when to use each tool, in which order, and which rules to follow. Without one, the assistant may skip the confirmation step, guess the wrong parameters, or fall back to calling the Bitbucket API with curl.
Skills are a Claude Code feature. If you use another MCP client, you can put the same guidance in its system prompt or custom instructions.
Example skill
This repository includes a ready-to-use example in skills/bitbucket/SKILL.md. You can use it as is or adapt it to your team's conventions.
To install it for all your projects:
mkdir -p ~/.claude/skills/bitbucket
cp skills/bitbucket/SKILL.md ~/.claude/skills/bitbucket/SKILL.mdTo use it only in one project, copy it to <your-project>/.claude/skills/bitbucket/SKILL.md instead.
What your skill should cover
If you write your own skill, make sure it covers at least:
When to use it: any task about pull requests or code review, and only when the repository is hosted on Bitbucket.
Tools only: always use the MCP tools, never
curlor manual API calls. If the MCP fails, report it and ask the user what to do.Creating a PR: call
prepare-pull-request-automaticallyfirst, passing any value the user already gave (title, branches, draft…). Then show the summary, ask for confirmation, and only then callcreate-pull-request.Draft PRs: pass
draft: trueto both tools when the user asks for a draft or WIP PR.The
projectparameter: it's the repository slug. If the user doesn't give it, take it from theoriginremote of the current repository.Reviewing and commenting: if there's no PR ID, call
list-pull-requestfirst (it only returns open PRs, with no filters). Then usereview-pull-requestandcomment-pull-request.Comments: ask for the text if it's missing, prefix it with
[AI], and confirm with the user before posting a comment written by the assistant.
Add your own conventions on top: PR title format, description template, which branch to target, language of the comments, etc.
Development
To run the server in development mode:
With pnpm:
pnpm run inspectorWith npm:
npm run inspectorRequirements
Node.js 18+
pnpm or npm
Bitbucket account with App Password configured
This server cannot be deployed
Maintenance
Related MCP Connectors
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Model Context Protocol server for Studex tools, notifications, and profile integrations
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Model Context Protocol server for todo.vu task management and time tracking.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to manage Bitbucket Cloud repositories, pull requests, branches, commits, pipelines, issues, and webhooks through the Model Context Protocol.8106 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Bitbucket through the Model Context Protocol, allowing users to manage pull requests, add comments, review code, create tasks, and perform other repository operations using natural language.7MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to interact with Bitbucket repositories, primarily focusing on retrieving and reviewing pull request context. It provides a suite of tools for repository operations, allowing users to manage pull requests and explore Bitbucket resources through the Model Context Protocol.75 npmISC
- AlicenseBqualityDmaintenanceEnables LLMs to interact with Bitbucket repositories to manage pull requests, branches, and commits through the Model Context Protocol. It supports repository operations such as searching code, accessing file contents, and comparing branches using natural language.164,964 npmMIT