Skip to main content
Glama
MatanYemini

Bitbucket MCP

by MatanYemini

Bitbucket MCP

一个模型上下文协议 (MCP) 服务器,用于与 Bitbucket Cloud 和服务器 API 集成。此 MCP 服务器使 Cursor 等 AI 助手能够与您的 Bitbucket 存储库、拉取请求和其他资源进行交互。

安全第一

这是一个安全可靠的软件包——不使用任何 DELETE 操作,因此不存在数据丢失的风险。每个拉取请求都使用 CodeQL 进行分析,以确保代码安全。

CodeQL GitHub 存储库 许可证:MIT npm 版本

Related MCP server: Bitbucket MCP Server

概述

查看官方 npm 软件包。该服务器实现了模型上下文协议标准,为 AI 助手提供访问 Bitbucket 数据和操作的权限。它包含以下工具:

  • 列出和检索存储库

  • 获取存储库详细信息

  • 获取拉取请求

  • 还有更多...

安装

使用 NPX(推荐)

使用此 MCP 服务器的最简单方法是通过 NPX,它允许您无需全局安装即可运行它:

# Run with environment variables
BITBUCKET_URL="https://bitbucket.org/your-workspace" \
BITBUCKET_USERNAME="your-username" \
BITBUCKET_PASSWORD="your-app-password" \
npx -y bitbucket-mcp@latest

手动安装

或者,您可以全局安装它或将其作为项目的一部分安装:

# Install globally
npm install -g bitbucket-mcp

# Or install in your project
npm install bitbucket-mcp

然后运行它:

# If installed globally
BITBUCKET_URL="https://bitbucket.org/your-workspace" \
BITBUCKET_USERNAME="your-username" \
BITBUCKET_PASSWORD="your-app-password" \
bitbucket-mcp

# If installed in your project
BITBUCKET_URL="https://bitbucket.org/your-workspace" \
BITBUCKET_USERNAME="your-username" \
BITBUCKET_PASSWORD="your-app-password" \
npx bitbucket-mcp

配置

环境变量

使用以下环境变量配置服务器:

多变的

描述

必需的

BITBUCKET_URL

Bitbucket 基本 URL(例如“ https://bitbucket.org/your-workspace ”)

是的

BITBUCKET_USERNAME

您的 Bitbucket 用户名

是的*

BITBUCKET_PASSWORD

您的 Bitbucket 应用密码

是的*

BITBUCKET_TOKEN

您的 Bitbucket 访问令牌(用户名/密码的替代)

BITBUCKET_WORKSPACE

未指定时使用的默认工作区

* 必须提供BITBUCKET_TOKENBITBUCKET_USERNAMEBITBUCKET_PASSWORD

创建 Bitbucket 应用程序密码

  1. 登录您的 Bitbucket 帐户

  2. 前往“个人设置”>“应用密码”

  3. 使用以下权限创建新的应用密码:

    • 存储库:阅读

    • 拉取请求:读、写

  4. 复制生成的密码并将其用作BITBUCKET_PASSWORD环境变量

与 Cursor 集成

要将此 MCP 服务器与 Cursor 集成:

  1. 打开游标

  2. 前往“设置”>“扩展程序”

  3. 点击“模型上下文协议”

  4. 添加新的 MCP 配置:

"bitbucket": {
  "command": "npx",
  "env": {
    "BITBUCKET_URL": "https://bitbucket.org/your-workspace",
    "BITBUCKET_USERNAME": "your-username",
    "BITBUCKET_PASSWORD": "your-app-password"
  },
  "args": ["-y", "bitbucket-mcp@latest"]
}
  1. 保存配置

  2. 使用 Cursor 中的“/bitbucket”命令访问 Bitbucket 存储库和拉取请求

使用带光标的本地构建

如果您正在本地开发并想要测试您的更改:

"bitbucket-local": {
  "command": "node",
  "env": {
    "BITBUCKET_URL": "https://bitbucket.org/your-workspace",
    "BITBUCKET_USERNAME": "your-username",
    "BITBUCKET_PASSWORD": "your-app-password"
  },
  "args": ["/path/to/your/local/bitbucket-mcp/dist/index.js"]
}

可用工具

此 MCP 服务器提供与 Bitbucket 仓库和拉取请求交互的工具。以下是可用操作的完整列表:

存储库操作

listRepositories

列出工作区中的存储库。

参数:

  • workspace (可选):Bitbucket 工作区名称

  • limit (可选):返回的最大存储库数量

getRepository

获取特定存储库的详细信息。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

拉取请求操作

getPullRequests

获取存储库的拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • state (可选):拉取请求状态( OPENMERGEDDECLINEDSUPERSEDED

  • limit (可选):返回的最大拉取请求数量

createPullRequest

创建一个新的拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • title :拉取请求标题

  • description :拉取请求描述

  • sourceBranch :源分支名称

  • targetBranch :目标分支名称

  • reviewers (可选):审阅者用户名列表

getPullRequest

获取特定拉取请求的详细信息。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

updatePullRequest

更新拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • 各种可选的更新参数(标题、描述等)

getPullRequestActivity

获取拉取请求的活动日志。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

approvePullRequest

批准拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

unapprovePullRequest

从拉取请求中删除批准。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

declinePullRequest

拒绝拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • message (可选):拒绝的原因

mergePullRequest

合并拉取请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • message (可选):合并提交消息

  • strategy (可选):合并策略( merge-commitsquashfast-forward

requestChanges

请求对拉取请求进行更改。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

removeChangeRequest

从拉取请求中删除变更请求。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

拉取请求评论操作

getPullRequestComments

列出对拉取请求的评论。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

createPullRequestComment

对拉取请求创建评论。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • content :评论内容

  • inline (可选):内联注释信息

getPullRequestComment

获取对拉取请求的特定评论。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • comment_id :评论ID

updatePullRequestComment

更新拉取请求的评论。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • comment_id :评论ID

  • content :更新的评论内容

deletePullRequestComment

删除对拉取请求的评论。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • comment_id :评论ID

resolveComment

解决拉取请求上的评论线程。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • comment_id :评论ID

reopenComment

重新打开拉取请求中已解决的评论线程。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • comment_id :评论ID

拉取请求差异操作

getPullRequestDiff

获取拉取请求的差异。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

getPullRequestDiffStat

获取拉取请求的差异统计信息。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

getPullRequestPatch

获取拉取请求的补丁。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

拉取请求任务操作

getPullRequestTasks

列出拉取请求上的任务。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

createPullRequestTask

根据拉取请求创建任务。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • content :任务内容

  • comment (可选):与任务关联的评论ID

  • pending (可选):任务是否处于待处理状态

getPullRequestTask

获取拉取请求上的特定任务。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • task_id :任务ID

updatePullRequestTask

更新拉取请求上的任务。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • task_id :任务ID

  • content (可选):更新的任务内容

  • state (可选):更新的任务状态

deletePullRequestTask

删除拉取请求上的任务。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

  • task_id :任务ID

其他拉取请求操作

getPullRequestCommits

列出拉取请求的提交。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

getPullRequestStatuses

列出拉取请求的提交状态。

参数:

  • workspace :Bitbucket 工作区名称

  • repo_slug :存储库 slug

  • pull_request_id :拉取请求 ID

发展

先决条件

  • Node.js 18 或更高版本

  • npm 或 yarn

设置

# Clone the repository
git clone https://github.com/MatanYemini/bitbucket-mcp.git
cd bitbucket-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

链接

Available Tools

3 tools
getPullRequestsD
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of pull requests to return
repo_slugYesRepository slug
stateNoPull request state
workspaceYesBitbucket workspace name

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

getRepositoryD
ParametersJSON Schema
NameRequiredDescriptionDefault
repo_slugYesRepository slug
workspaceYesBitbucket workspace name

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

listRepositoriesD
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of repositories to return
workspaceNoBitbucket workspace name

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedgetPullRequests
    • First observedgetRepository
    • First observedlistRepositories

TDQS

D1.6/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: getPullRequests retrieves pull requests, getRepository fetches a specific repository, and listRepositories lists all repositories. There is no overlap or ambiguity between these operations.

Naming Consistency4/5

The tools follow a consistent verb_noun pattern (getPullRequests, getRepository, listRepositories), but there is a minor deviation in verb choice between 'get' and 'list'. This is still highly readable and predictable.

Tool Count2/5

With only 3 tools, the server feels thin for a Bitbucket integration, lacking essential operations like creating or updating repositories, managing pull requests (e.g., create, merge), or handling issues. The scope is incomplete for typical version control workflows.

Completeness1/5

The tool surface is severely incomplete for a Bitbucket server, missing core CRUD operations (e.g., create_repository, update_pull_request, delete_branch) and lifecycle management. Agents will face dead ends when trying to perform basic tasks like modifying repositories or pull requests.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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/MatanYemini/bitbucket-mcp'

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