Back to MCP directory
publicPublicdnsLocal runtime

atlassian-bitbucket-server-mcp

一个集成Atlassian Bitbucket与AI系统的MCP服务器,提供代码库访问、PR操作等API功能

article

README

🚀 Atlassian Bitbucket MCP 服务器

Atlassian Bitbucket MCP 服务器是一个与 AI 系统集成的 Atlassian Bitbucket Server/Data Center 的 Model Context Protocol (MCP) 服务器,它能让 AI 系统与 Bitbucket 仓库进行交互,为开发工作提供便利。

🚀 快速开始

先决条件

  • Node.js(推荐 v20+)
  • npm
  • Python 3(用于 OpenAPI 过滤脚本)
  • Bitbucket Server 访问令牌

安装

git clone [<atlassian-bitbucket-server-mcp>](https://github.com/guenichone/atlassian-bitbucket-server-mcp)  
cd mcp-server-selfhosted-bitbucket  
npm install  
npm run build-app

运行服务器

# 作为 STDIO 服务器(AI 集成的默认选项)
ATLASSIAN_BITBUCKET_SERVER_URL=https://git.your-company.com/ \  
ATLASSIAN_BITBUCKET_ACCESS_TOKEN=your-token \  
npm start  

# 作为 HTTP/SSE 服务器
MCP_TRANSPORT=sse \  
ATLASSIAN_BITBUCKET_SERVER_URL=https://git.your-company.com/ \  
ATLASSIAN_BITBUCKET_ACCESS_TOKEN=your-token \  
npm start

✨ 主要特性

此服务器通过以下方式使 AI 系统能够与 Bitbucket 仓库交互:

  • 访问项目、仓库、分支和文件
  • 提供处理拉取请求的工具
  • 使用官方 Bitbucket OpenAPI 规范实现类型安全的 API 集成

📦 安装指南

使用 Docker CLI

# 构建
docker build -t bitbucket-mcp-server .  

# 运行
docker run --rm -i \  
  -e ATLASSIAN_BITBUCKET_SERVER_URL=https://git.your-company.com/ \  
  -e ATLASSIAN_BITBUCKET_ACCESS_TOKEN=your-token \  
  bitbucket-mcp-server

使用 Makefile(推荐)

该项目包含一个 Makefile,用于简化 Docker 操作:

# 构建 Docker 镜像
make docker-build  

# 使用你的 Bitbucket 凭据运行
BITBUCKET_URL=https://git.your-company.com/ BITBUCKET_TOKEN=your-token make docker-run  

# 一次构建并运行
BITBUCKET_URL=https://git.your-company.com/ BITBUCKET_TOKEN=your-token make docker-all  

# 查看所有可用的 Make 命令和示例
make help

📚 详细文档

环境变量

| 属性 | 详情 | |------|------| | ATLASSIAN_BITBUCKET_SERVER_URL | Bitbucket 服务器 URL | | ATLASSIAN_BITBUCKET_ACCESS_TOKEN | 你的访问令牌 | | MCP_TRANSPORT | stdio(默认)或 sse | | PORT | 使用 SSE 时的 HTTP 端口(默认:3000) |

📄 许可证

MIT - 有关详细信息,请参阅 LICENSE 文件。

致谢

这个项目受到 aashari/mcp-server-atlassian-bitbucket 的启发。

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