Get the FREE Ultimate OpenClaw Setup Guide →

bitbucket

Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio matanyemini-bitbucket-mcp npx -y bitbucket-mcp@latest \
  --env BITBUCKET_URL="https://api.bitbucket.org/2.0" \
  --env BITBUCKET_PASSWORD="your-app-password" \
  --env BITBUCKET_USERNAME="your-username" \
  --env BITBUCKET_WORKSPACE="your-workspace"

How to use

This MCP server provides a Connector to Bitbucket data and actions, exposing tools to list and retrieve repositories, fetch repository details, and access pull requests within a given workspace. It follows the Model Context Protocol so AI assistants can discover and invoke Bitbucket-related capabilities in a structured way. Use the Baton-like tools exposed by the MCP to browse repositories, inspect pull requests, and retrieve metadata without performing destructive changes. The server emphasizes safety by avoiding delete operations and includes CodeQL checks when analyzing pull requests.

To use with Cursor or another MCP consumer, configure an MCP entry that runs the bitbucket-mcp package via NPX (as shown in the integration example). The available tools allow paging through lists (repositories, pull requests, etc.), fetching specific items by ID, and extracting details like repository name, description, owner, and PR status. You can access the Bitbucket data through the tool calls and compose prompts that reference repository and PR attributes, enabling operations such as review workflows or status checks within your AI assistant workflows.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to Bitbucket with a valid app password or token

Installation steps:

  1. Prepare environment variables for Bitbucket access (example):
# API-based access (recommended)
export BITBUCKET_URL="https://api.bitbucket.org/2.0"
export BITBUCKET_WORKSPACE="your-workspace"
export BITBUCKET_USERNAME="your-username"
export BITBUCKET_PASSWORD="your-app-password"
  1. Run the MCP server using NPX (no global install required):
npx -y bitbucket-mcp@latest
  1. Optional: install globally if you prefer a persistent binary (not required):
# Global install (optional)
npm install -g bitbucket-mcp

# Run globally installed version (Option A)
BITBUCKET_URL="https://api.bitbucket.org/2.0" \
BITBUCKET_WORKSPACE="your-workspace" \
BITBUCKET_USERNAME="your-username" \
BITBUCKET_PASSWORD="your-app-password" \
bitbucket-mcp
  1. For Cursor integration, configure the MCP from the Cursor settings as shown in the README example, ensuring the environment variables are provided in the configuration.

Additional notes

Notes and tips:

  • Use a dedicated Bitbucket app password with at least Read permissions for Repositories and Pull requests.
  • If you encounter authentication issues, verify that you are not using a regular Bitbucket password and that BITBUCKET_PASSWORD contains the app password.
  • The MCP supports non-destructive operations; avoid enabling dangerous tools unless you explicitly intend to allow deletions or other risky actions.
  • You can override the default API URL with BITBUCKET_URL if you are using self-hosted Bitbucket Server/Cloud variants.
  • In Cursor integration, you can embed the runtime configuration and reuse the same environment variables across sessions for consistent access.

Related MCP Servers

Sponsor this space

Reach thousands of developers