Token导航 LogoToken导航TokenDH.com
Bitbucket MCP (Lawp09) logo
开发工具stdio官方级别未说明来源级核验

Bitbucket MCP (Lawp09)

MCP Server

Bitbucket MCP 服务器是一个连接 AI 助手(如 Claude Code、VS Code 的 GitHub Copilot、Cursor 等)到 Bitbucket Cloud 存储库的工具,支持通过自然语言审查拉取请求、监控管道和管理代码。

工具数

45

提示词数

0

GitHub Stars

2

资源数

0
代码审查CI/CDPythonClaudeClaudeCursorVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

lawp09

提供方

lawp09

最后核验

2026/5/17 20:47

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx --from bitbucket-mcp-py bitbucket-mcp

详细介绍

比特桶MCP服务器(Python)

![PyPI](https://pypi.org/project/bitbucket-mcp-py/) ![Python](https://pypi.org/project/bitbucket-mcp-py/) ![CI](https://github.com/lawp09/bitbucket-mcp/actions/workflows/ci.yml) ![CodeQL](https://github.com/lawp09/bitbucket-mcp/actions/workflows/codeql.yml) ![License: MIT](https://opensource.org/licenses/MIT)

连接 克劳德代码, VS代码(GitHub副本), 光标,以及任何与MCP兼容的AI助手到您的Bitbucket Cloud存储库。审查拉取请求、监控管道和管理代码——所有这些都是通过自然语言完成的。

特性

  • 45个MCP工具 --存储库、拉取请求、注释、任务、差异、管道、构建状态、审阅者、PR草案、批处理审阅
  • 反应平淡 -去除API噪声以降低LLM令牌使用率
  • 可配置的 --通过启用/禁用工具 configs/tools.jsonBITBUCKET_TOOLS_CONFIG env 是
  • 安全凭据 --环境变量或系统密钥链

快速开始

1.安装

运行服务器的推荐方式是通过 uvx (零安装,隔离环境):

# Always latest version
uvx --from bitbucket-mcp-py bitbucket-mcp

# Pin a specific version
uvx --from bitbucket-mcp-py==1.8.1 bitbucket-mcp
为什么 --from? PyPI包是 bitbucket-mcp-py 但命令入口点是 bitbucket-mcpThe --from flag告诉uvx要安装哪个程序包。

Alternative install methods

模式命令最适合
pip全球pip install bitbucket-mcp-py简单、持久的安装
本地开发人员pip install -e . 在项目目录中为项目做出贡献
码头工人请参阅基于容器的工作流

2.配置凭据

设置以下环境变量(或使用 .env 文件--请参见 凭证):

变量描述
BITBUCKET_USERNAME您的Bitbucket电子邮件
BITBUCKET_TOKEN您的Bitbucket API代币
BITBUCKET_WORKSPACE你的工作空间蛞蝓
获取您的API代币 在:https://id.atlassian.com/manage-profile/security/api-tokens ⚠️ 使用作用域令牌,而不是全局令牌。 创建令牌时,选择特定范围(例如。 Repositories: Read, Pull requests: Read/Write).没有显式作用域的全局令牌不适用于此MCP服务器。

3.配置您的AI助手

克劳德代码(推荐)

选项A-CLI(最快):

claude mcp add bitbucket-mcp \
  -e BITBUCKET_USERNAME=your-email@example.com \
  -e BITBUCKET_TOKEN=your-api-token \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -- uvx --from bitbucket-mcp-py bitbucket-mcp

选项B-JSON配置 (~/.claude.json 或项目 .mcp.json):

{
  "mcpServers": {
    "bitbucket-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

VS代码(GitHub副本)

添加 .vscode/mcp.json (工作空间)或 ~/Library/Application Support/Code/User/mcp.json (全局,macOS):

{
  "servers": {
    "bitbucket-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

光标

添加 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

可用工具

类别工具
仓库list_repositories, get_repository
拉取请求get_pull_requests, get_pull_request, create_pull_request, update_pull_request, approve_pull_request, unapprove_pull_request, request_changes_pull_request, unrequest_changes_pull_request, decline_pull_request, merge_pull_request
评论get_pull_request_comments, add_pull_request_comment, get_pull_request_comment, update_pull_request_comment, delete_pull_request_comment, resolve_pull_request_comment, reopen_pull_request_comment, get_pull_request_activity
任务公关get_pull_request_tasks, get_pull_request_task, create_pull_request_task, update_pull_request_task, delete_pull_request_task
差异/评论get_pull_request_diff, get_pull_request_patch, get_pull_request_diffstat, get_pull_request_commits
公关发现get_pull_requests_pending_review
构建/CIget_pull_request_statuses, get_commit_statuses
管道list_pipeline_runs, get_pipeline_run, get_pipeline_steps, get_pipeline_step_logs, run_pipeline, stop_pipeline
审稿人get_effective_default_reviewers, suggest_pull_request_reviewers
PR草案create_draft_pull_request, publish_draft_pull_request, convert_pull_request_to_draft
批量审核submit_pull_request_batch_review
评审总结get_pull_request_review_summary
默认情况下禁用: merge_pull_request (安全), stop_pipeline (安全), get_pull_request_patch (git am格式——不适用于AI审查), convert_pull_request_to_draft (API不支持Bitbucket)。启用 configs/tools.json.

自定义工具配置

默认情况下,服务器读取 configs/tools.json 与包裹捆绑在一起。您可以在运行时指向自定义文件,而无需重新生成:

export BITBUCKET_TOOLS_CONFIG=/path/to/my-tools.json

后备链 (首场比赛获胜):

  1. BITBUCKET_TOOLS_CONFIG 环境变量
  2. 内建 configs/tools.json
故障安全行为 --如果 BITBUCKET_TOOLS_CONFIG 如果设置了,但文件丢失或包含无效的JSON,服务器将在启动时引发错误(显式失败,而不是默默地忽略覆盖)。如果缺少内置默认值,则启用所有工具。
代币提示get_pull_request_diff 接受可选 path 用于将差异过滤到单个文件的参数,在大型PR上将令牌使用量减少约95%: `` get_pull_request_diff(repo_slug, pull_request_id, path="src/services/myService.ts") ``

凭证

选项1: .env 文件(推荐)

cp .env.example .env
# Edit .env with your credentials

选项2:系统钥匙链(最安全)

pip install 'bitbucket-mcp-py[keyring]'
python3 -c "import keyring; keyring.set_password('bitbucket-mcp', 'bitbucket_token', 'YOUR_TOKEN')"

Docker(替代方案)

如果您更喜欢在容器中运行服务器:

docker build -t bitbucket-mcp-py .
docker run -d --name bitbucket-mcp --env-file .env bitbucket-mcp-py

然后配置您的AI助手以使用 docker exec:

{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "docker",
      "args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
    }
  }
}

发展

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest tests/ -v

# Run specific test
uv run pytest tests/test_client.py -v

需求

  • Python 3.12+
  • 比特桶API代币

许可证

麻省理工学院

参考文献

目录标签

目录标签

代码审查CI/CDPythonClaudeBitbucket本地部署MCPAI助手

支持客户端

ClaudeCursorVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

45

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP