Model Context Protocol Server

Bitbucket MCP Server

Connect AI assistants to Bitbucket Cloud with 25+ tools for repositories, pull requests, branches, commits, issues, pipelines, and code search.

Full Bitbucket Cloud coverage

Everything you need to interact with Bitbucket through AI assistants

Repositories

Create, list, update, and delete repositories. Manage forks and access files.

Pull Requests

Full PR lifecycle: create, review, comment, approve, and merge.

Issues

Create and manage issues with priorities, assignees, and states.

Pipelines

Trigger, monitor, and control CI/CD pipeline runs.

Code Search

Search across all repositories in your workspace.

OAuth 2.0

Secure auth with automatic token refresh.

Installation

Install the package globally or use npx to run it directly

Terminal
# Using npm
npm install -g @lexmata/bitbucket-mcp

# Using pnpm
pnpm add -g @lexmata/bitbucket-mcp

# Or run directly with npx
npx @lexmata/bitbucket-mcp

Configuration

Choose your preferred authentication method

1

OAuth 2.0

Recommended
  1. 1. Create an OAuth consumer in your workspace settings
  2. 2. Set callback URL to http://localhost:9876/callback
  3. 3. Run the OAuth flow script to get tokens
node scripts/oauth-flow.js "CLIENT_ID" "CLIENT_SECRET"
2

App Password

Simple
  1. 1. Go to Personal Settings → App passwords
  2. 2. Create a new app password with required permissions
  3. 3. Use your username and the app password
BITBUCKET_USERNAME=your-username BITBUCKET_ACCESS_TOKEN=app-password

MCP Configuration

Add to your Claude Desktop or Cursor configuration file

mcp.json
{
  "mcpServers": {
    "bitbucket": {
      "command": "npx",
      "args": ["@lexmata/bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-username",
        "BITBUCKET_ACCESS_TOKEN": "your-app-password"
      }
    }
  }
}
Cursor ~/.cursor/mcp.json
Claude (macOS) ~/Library/.../Claude/
Claude (Linux) ~/.config/Claude/

Available Tools

25+ tools covering all major Bitbucket operations

Tool Description
list_repositoriesList repositories in a workspace
get_repositoryGet details of a specific repository
create_repositoryCreate a new repository
delete_repositoryDelete a repository
list_repository_forksList all forks of a repository
get_file_contentGet the content of a file

MCP Resources

Access Bitbucket data through standardized resource URIs

Repository

bitbucket://repository/{workspace}/{repo}

Pull Request

bitbucket://pullrequest/{workspace}/{repo}/{id}

File

bitbucket://file/{workspace}/{repo}/{path}