This MCP server provides tools to interact with Bitbucket Server pull requests through the Model Context Protocol, enabling you to manage repositories, create and merge pull requests, and participate in code reviews.
The easiest way to install the Bitbucket Server MCP for Claude Desktop is through Smithery:
npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude
If you prefer to install manually:
npm install
npm run build
Configure the server in your VSCode MCP settings file:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-server/build/index.js"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token",
// Or alternatively:
// "BITBUCKET_USERNAME": "your-username",
// "BITBUCKET_PASSWORD": "your-password",
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}
BITBUCKET_URL
: Your Bitbucket Server instance URLBITBUCKET_TOKEN
: Personal access tokenBITBUCKET_USERNAME
and BITBUCKET_PASSWORD
: Basic auth credentialsBITBUCKET_DEFAULT_PROJECT
(optional): Default project key when not specified in commandsList all accessible projects:
list_projects
List repositories in default project:
list_repositories
List repositories in specific project:
list_repositories --project "MYPROJECT"
Pagination support:
list_projects --limit 10 --start 0
Create a pull request:
create_pull_request --repository "my-repo" --title "Feature: New functionality" --sourceBranch "feature/new-feature" --targetBranch "main"
Create PR with description and specific project:
create_pull_request --project "MYPROJECT" --repository "my-repo" --title "Bugfix: Critical issue" --sourceBranch "bugfix/critical" --targetBranch "develop" --description "Fixes critical issue #123"
Get pull request details:
get_pull_request --repository "my-repo" --prId 123
Merge a pull request:
merge_pull_request --repository "my-repo" --prId 123 --strategy "squash" --message "Feature: New functionality (#123)"
Add a comment to a PR:
add_comment --repository "my-repo" --prId 123 --text "Could you explain this implementation further?"
View code differences:
get_diff --repository "my-repo" --prId 123
Check review status:
get_reviews --repository "my-repo" --prId 123
Decline a pull request:
decline_pull_request --repository "my-repo" --prId 123 --message "Needs significant rework"
list_projects
: Discovers all accessible Bitbucket projectslist_repositories
: Explores repositories within specific projects or across all projectscreate_pull_request
: Creates new pull requests with customizable title, description, and reviewersget_pull_request
: Retrieves detailed PR informationmerge_pull_request
: Integrates approved changes with support for different merge strategiesdecline_pull_request
: Rejects PRs with feedbackadd_comment
: Adds review comments or feedback to pull requestsget_diff
: Retrieves code differences in the PRget_reviews
: Fetches review history and approval statusTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "bitbucket" '{"command":"node","args":["/path/to/bitbucket-server/build/index.js"],"env":{"BITBUCKET_URL":"https://your-bitbucket-server.com","BITBUCKET_TOKEN":"your-access-token","BITBUCKET_DEFAULT_PROJECT":"your-default-project"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": [
"/path/to/bitbucket-server/build/index.js"
],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token",
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": [
"/path/to/bitbucket-server/build/index.js"
],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token",
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect