Back to MCP directory
publicPublicdnsLocal runtime

mcp-bitbucket

一个用于Bitbucket集成的MCP服务器Python实现,提供多种Bitbucket操作工具,如仓库管理、分支操作、文件读写等,支持本地运行并与AI应用安全交互。

article

README

🚀 MCP Bitbucket Python 🦊

MCP Bitbucket Python是一个用Python实现的MCP服务器,用于与Bitbucket进行集成。MCP(模型上下文协议)可让AI应用程序安全地访问本地工具,该服务器会在与AI应用程序相同的机器上本地运行。

🚀 快速开始

安装

# 本地安装服务器
git clone https://github.com/kallows/mcp-bitbucket.git

环境配置

服务器需要将Bitbucket凭证设置为环境变量:

export BITBUCKET_USERNAME="your-username"
export BITBUCKET_APP_PASSWORD="your-app-password"

✨ 主要特性

此MCP服务器提供了以下Bitbucket集成工具:

  • bb_create_repository:创建新的Bitbucket仓库
    • 必填:名称(仓库名称)
    • 可选:描述、工作区(默认为kallows)、项目键、是否私有(默认:true)、是否有问题跟踪(默认:true)
  • bb_create_branch:在仓库中创建新分支
    • 必填:repo_slug、分支(新分支的名称)
    • 可选:工作区(默认为kallows)、起始点(默认为主分支)
  • bb_delete_repository:删除Bitbucket仓库
    • 必填:repo_slug
    • 可选:工作区(默认为kallows)
  • bb_read_file:从仓库读取文件
    • 必填:repo_slug、路径(仓库中的文件路径)
    • 可选:工作区(默认为kallows)、分支(默认为主/主分支)
  • bb_write_file:创建或更新仓库中的文件
    • 必填:repo_slug、路径、内容
    • 可选:工作区(默认为kallows)、分支(默认为主分支)、消息(提交信息)
  • bb_create_issue:在仓库中创建问题
    • 必填:repo_slug、标题、内容
    • 可选:工作区(默认为kallows)、类型(bug/enhancement/proposal/task)、优先级(trivial/minor/major/critical/blocker)
  • bb_delete_issue:删除仓库中的问题
    • 必填:repo_slug、问题ID
    • 可选:工作区(默认为kallows)
  • bb_search_repositories:使用查询语法搜索Bitbucket仓库
    • 必填:查询(例如:'name ~ "test"' 或 'project.key = "PROJ"')
    • 可选:工作区(默认为kallows)、页码(默认:1)、每页长度(默认:10,最大:100)
  • bb_delete_file:删除仓库中的文件
    • 必填:repo_slug、路径
    • 可选:工作区(默认为kallows)、分支(默认为主分支)、消息(提交信息)
  • bb_create_pull_request:创建拉取请求
    • 必填:repo_slug、标题、源分支
    • 可选:工作区(默认为kallows)、目标分支(默认为主分支)、描述、是否关闭源分支(默认:true)

🔧 技术细节

项目结构

mcp-bitbucket/
├── README.md
├── pyproject.toml
├── src/
│   └── bitbucket_api/
│       ├── __init__.py
│       └── server.py
└── tests/
    ├── __init__.py
    ├── test_bb_api.py
    └── test_bb_integration.py
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client