You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mcp-bitbucket

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-bitbucket

Model Context Protocol server for Bitbucket integration - manage pull requests, comments, and diffs

0.0.7
latest
Source
npmnpm
Version published
Weekly downloads
20
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

MCP Bitbucket Server

A Model Context Protocol (MCP) server that provides access to Bitbucket pull requests, allowing users to list, filter, and retrieve pull requests by state (OPEN, MERGED, DECLINED), add comments, and inspect diffs.

Features

  • Pull Request Management: List, filter, and retrieve pull requests by state (OPEN, MERGED, DECLINED) with pagination support
  • Comment System: Add general and inline comments to pull requests
  • Diff Inspection: Retrieve consolidated PR diff for comprehensive code review (ignores whitespace changes by default)
  • Branch/PR_ID based Search: Find pull requests by source branch name or PR ID
  • Target Branch Filtering: Filter pull requests by destination/target branch
  • Pipeline Management: List and filter CI/CD pipelines by state and target branch with automatic PR ID extraction from commit messages
  • Commit Message Fetching: Automatically retrieves commit message details when not available in pipeline response
  • Environment-based Configuration: Configure repository via environment variables

API

Tools

  • list_pull_requests

    • List pull requests from the configured Bitbucket repository
    • Input: state (OPEN/MERGED/DECLINED), limit (1-100) default 50, page (pagination), target_branch (filter by target branch)
    • Returns: Formatted list of pull requests with metadata and pagination info
  • get_pr_details

    • Get pull request details with commit messages and consolidated PR diff
    • Input: source_branch OR pr_id, include_diff (optional, defaults to false)
    • Returns: Complete pull request information with consolidated diff (ignores whitespace and binary files by default)
  • add_pr_comment

    • Add a general comment to a pull request
    • Input: pr_id, content
    • Returns: Created comment details
  • add_pr_inline_comment

    • Add an inline comment to a specific line in a pull request
    • Input: pr_id, content, file_path, line
    • Returns: Created inline comment details
  • list_pipelines

    • List pipelines from the configured Bitbucket repository with commit message details
    • Input: state (IN_PROGRESS/SUCCESSFUL/FAILED/STOPPED/SKIPPED/PENDING/ERROR), limit (1-100) default 10, page (pagination), target_branch (filter by target branch)
    • Returns: Formatted list of pipelines with metadata, PR ID extracted from commit messages, commit details, and pagination info

Prerequisites

  • Node.js (version 18.x or higher)
  • Bitbucket Cloud account
  • Bitbucket App Password with appropriate permissions

Setup

1. Generate Bitbucket App Password

Generate one from Bitbucket App Passwords. Minimum permissions:

  • Workspaces: Read
  • Repositories: Read
  • Pull Requests: Read, Write (if you want to add comments)

Usage

MCP Server Configuration

{
  "mcpServers": {
    "mcp-bitbucket": {
      "command": "npx",
      "args": ["mcp-bitbucket"],
      "env": {
        "BITBUCKET_USERNAME": "<your_username>",
        "BITBUCKET_PASSWORD": "<your_app_password>",
        "BITBUCKET_URL": "https://bitbucket.org/<workspace>/<repo_name>"
      }
    }
  }
}

Use Case

  • Review the PR diff and add that as a comment

Security Note

This server uses Bitbucket App Passwords for authentication. Create an App Password in your Bitbucket settings with appropriate permissions for repositories and pull requests.

License

MIT

Keywords

modelcontextprotocol

FAQs

Package last updated on 19 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts