MCP比特桶Python🦊
用于Bitbucket集成的MCP服务器的Python实现。MCP(模型上下文协议)为AI应用程序提供安全的本地工具访问。服务器与您的AI应用程序在同一台机器上本地运行。
安装
# Install the server locally
git clone https://github.com/kallows/mcp-bitbucket.git可用工具
此MCP服务器提供以下Bitbucket集成工具:
bb_create_repository:创建新的Bitbucket存储库
- 必填项:名称(存储库名称) - 可选:描述、工作区(默认为kallows)、project_key、is_private(默认:true)、has_issues(默认:true)
bb_create_branch:在存储库中创建新分支
- 必填项:repo_slug,分支(新分支的名称) - 可选:工作区(默认为kallows),start_point(默认为main)
bb_delete_repository:删除Bitbucket存储库
- 必需:repo_slug - 可选:工作区(默认为kallows)
bb_read_file:从存储库读取文件
- 必需:repo_slug,路径(存储库中的文件路径) - 可选:工作区(默认为kallows)、分支(默认为main/master)
bb_write_file:在存储库中创建或更新文件
- 必填项:repo_slug、路径、内容 - 可选:工作区(默认为kallows)、分支(默认为main)、消息(commit message)
bb_create_issue:在存储库中创建问题
- 必填项:repo_slug、标题、内容 - 可选:工作区(默认为kallows)、类型(bug/增强/建议/任务)、优先级(琐碎/次要/主要/关键/阻止)
bb_delete_issue:从存储库中删除问题
- 必填项:repo_slug、issue_id - 可选:工作区(默认为kallows)
bb_search_repositories:使用查询语法搜索Bitbucket存储库
- 必填项:查询(例如,“name~”test“”或“project.key=”PROJ“”) - 可选:工作区(默认为kallows)、页面(默认:1)、页面长度(默认:10,最大:100)
bb_delete_file:从存储库中删除文件
- 必需:repo_slug,路径 - 可选:工作区(默认为kallows)、分支(默认为main)、消息(commit message)
bb_create_pull_request:创建pull请求
- 必填项:repo_slug、title、source_branch - 可选:工作区(默认为kallows)、destination_branch(默认为main)、描述、close_source_brance(默认为true)
环境设置
服务器要求将Bitbucket凭据设置为环境变量:
export BITBUCKET_USERNAME="your-username"
export BITBUCKET_APP_PASSWORD="your-app-password"项目结构
mcp-bitbucket/
├── README.md
├── pyproject.toml
├── src/
│ └── bitbucket_api/
│ ├── __init__.py
│ └── server.py
└── tests/
├── __init__.py
├── test_bb_api.py
└── test_bb_integration.py