Skip to main content
Glama

Bitbucket Server MCP

by garc33

Bitbucket 服务器 MCP

用于管理 Bitbucket Server 拉取请求的 MCP(模型上下文协议)服务器。该服务器提供通过 MCP 协议与 Bitbucket Server API 交互的工具和资源。

要求

  • Node.js >= 16

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Bitbucket Server:

npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude

手动安装

npm install

建造

npm run build

特征

该服务器为 Bitbucket Server 集成提供了以下工具:

create_pull_request

创建一个新的拉取请求。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • title (必填):PR 标题
  • description :PR 描述
  • sourceBranch (必需):源分支名称
  • targetBranch (必填):目标分支名称
  • reviewers :审阅者用户名数组

get_pull_request

检索有关特定拉取请求的详细信息。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID

merge_pull_request

合并拉取请求。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID
  • message :合并提交消息
  • strategy :以下之一:
    • merge-commit (默认)
    • squash
    • fast-forward

decline_pull_request

拒绝拉取请求。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID
  • message :拒绝的原因

add_comment

向拉取请求添加评论。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID
  • text (必填):评论文本
  • parentId :回复的父评论 ID

get_diff

检索拉取请求的差异。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID
  • contextLines :上下文行数(默认值:10)

get_reviews

获取拉取请求的审核历史记录,包括批准和审核。

参数:

  • project :Bitbucket 项目密钥(如果设置,则默认为 BITBUCKET_DEFAULT_PROJECT)
  • repository (必需):存储库 slug
  • prId (必填):拉取请求 ID

依赖项

  • @modelcontextprotocol/sdk - 用于 MCP 协议实现的 SDK
  • axios - 用于 API 请求的 HTTP 客户端
  • winston - 日志框架

配置

该服务器需要在 VSCode MCP 设置文件中进行配置。以下是示例配置:

{ "mcpServers": { "bitbucket": { "command": "node", "args": ["/path/to/bitbucket-server/build/index.js"], "env": { "BITBUCKET_URL": "https://your-bitbucket-server.com", // Authentication (choose one): // Option 1: Personal Access Token "BITBUCKET_TOKEN": "your-access-token", // Option 2: Username/Password "BITBUCKET_USERNAME": "your-username", "BITBUCKET_PASSWORD": "your-password", // Optional: Default project "BITBUCKET_DEFAULT_PROJECT": "your-default-project" } } } }

环境变量

  • BITBUCKET_URL (必需):Bitbucket Server 实例的基本 URL
  • 身份验证(需要以下其中一项):
    • BITBUCKET_TOKEN :个人访问令牌
    • BITBUCKET_USERNAMEBITBUCKET_PASSWORD :基本身份验证凭据
  • BITBUCKET_DEFAULT_PROJECT :工具调用中未指定时使用的默认项目密钥

日志记录

服务器使用 Winston 将所有操作记录到bitbucket.log以进行调试和监控。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

通过 MCP 协议实现与 Bitbucket Server 的交互,实现拉取请求管理,支持创建、合并、评论、审核拉取请求等操作。

  1. 要求
    1. 安装
      1. 通过 Smithery 安装
      2. 手动安装
    2. 建造
      1. 特征
        1. create_pull_request
        2. get_pull_request
        3. merge_pull_request
        4. decline_pull_request
        5. add_comment
        6. get_diff
        7. get_reviews
      2. 依赖项
        1. 配置
          1. 环境变量
        2. 日志记录

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            MCP Tool Server for Gitee, supporting the management of repository files/branches, Issues, and Pull Requests.
            Last updated -
            20
            10
            4
            TypeScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            An MCP server that fetches GitHub Pull Request comments with file paths, line ranges, and replies using a GitHub personal access token.
            Last updated -
            TypeScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            Gitee API integration, repository, issue, and pull request management, and more.
            Last updated -
            25
            Go
            MIT License
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            A Python implementation of an MCP server that enables secure, local Bitbucket integration for AI applications, providing tools for repository management, branch creation, file operations, issue tracking, and pull request creation.
            Last updated -
            1
            Python

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/garc33/bitbucket-server-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server