Skip to main content
Glama
MatanYemini

Bitbucket MCP

by MatanYemini

Bitbucket MCP

Сервер Model Context Protocol (MCP) для интеграции с Bitbucket Cloud и API сервера. Этот сервер MCP позволяет помощникам ИИ, таким как Cursor, взаимодействовать с вашими репозиториями Bitbucket, запросами на извлечение и другими ресурсами.

Безопасность прежде всего

Это безопасный и ответственный пакет — операции DELETE не используются, поэтому нет риска потери данных. Каждый запрос на извлечение анализируется с помощью CodeQL, чтобы гарантировать безопасность кода.

КодQL Репозиторий GitHub Лицензия: Массачусетский технологический институт npm-версия

Related MCP server: Bitbucket MCP Server

Обзор

Ознакомьтесь с официальным пакетом npm Этот сервер реализует стандарт Model Context Protocol для предоставления помощникам ИИ доступа к данным и операциям 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

Базовый URL Bitbucket (например, « https://bitbucket.org/your-workspace »)

Да

BITBUCKET_USERNAME

Ваше имя пользователя Bitbucket

Да*

BITBUCKET_PASSWORD

Ваш пароль к приложению Bitbucket

Да*

BITBUCKET_TOKEN

Ваш токен доступа Bitbucket (альтернатива имени пользователя/паролю)

Нет

BITBUCKET_WORKSPACE

Рабочее пространство по умолчанию, используемое, если не указано иное

Нет

* Необходимо указать либо BITBUCKET_TOKEN , либо BITBUCKET_USERNAME и BITBUCKET_PASSWORD .

Создание пароля приложения Bitbucket

  1. Войдите в свою учетную запись Bitbucket

  2. Перейдите в раздел «Персональные настройки» > «Пароли приложений».

  3. Создайте новый пароль приложения со следующими разрешениями:

    • Репозитории: Читать

    • Запросы на извлечение: чтение, запись

  4. Скопируйте сгенерированный пароль и используйте его как переменную среды BITBUCKET_PASSWORD

Интеграция с курсором

Чтобы интегрировать этот 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. Используйте команду «/bitbucket» в Cursor для доступа к репозиториям 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 и pull-запросами. Ниже приведен полный список доступных операций:

Операции репозитория

listRepositories

Перечисляет репозитории в рабочей области.

Параметры:

  • workspace (необязательно): имя рабочего пространства Bitbucket

  • limit (необязательно): максимальное количество возвращаемых репозиториев

getRepository

Получает сведения о конкретном репозитории.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

Операции по запросу на извлечение

getPullRequests

Получает запросы на извлечение изменений для репозитория.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • state (необязательно): состояние запроса на извлечение ( OPEN , MERGED , DECLINED , SUPERSEDED )

  • limit (необязательно): максимальное количество возвращаемых запросов на извлечение

createPullRequest

Создает новый запрос на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • title : заголовок запроса на извлечение

  • description : Описание запроса на извлечение

  • sourceBranch : Имя исходной ветки

  • targetBranch : Имя целевой ветки

  • reviewers (необязательно): список имен пользователей рецензентов

getPullRequest

Получает сведения о конкретном запросе на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

updatePullRequest

Обновляет запрос на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • Различные необязательные параметры обновления (название, описание и т. д.)

getPullRequestActivity

Получает журнал активности для запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

approvePullRequest

Одобряет запрос на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

unapprovePullRequest

Удаляет одобрение из запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

declinePullRequest

Отклоняет запрос на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • message (необязательно): Причина отклонения

mergePullRequest

Объединяет запрос на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • message (необязательно): сообщение о слиянии

  • strategy (необязательно): стратегия слияния ( merge-commit , squash , fast-forward )

requestChanges

Запрашивает изменения по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

removeChangeRequest

Удаляет запрос на изменение из запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

Операции по комментированию запросов на извлечение

getPullRequestComments

Список комментариев к запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

createPullRequestComment

Создает комментарий к запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • content : Содержание комментария

  • inline (необязательно): Встроенная информация о комментарии

getPullRequestComment

Получает конкретный комментарий к запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • comment_id : идентификатор комментария

updatePullRequestComment

Обновляет комментарий к запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • comment_id : идентификатор комментария

  • content : Обновленное содержание комментария

deletePullRequestComment

Удаляет комментарий к запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • comment_id : идентификатор комментария

resolveComment

Закрывает ветку комментариев по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • comment_id : идентификатор комментария

reopenComment

Повторно открывает решенную ветку комментариев по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • comment_id : идентификатор комментария

Операции по изменению запроса на извлечение

getPullRequestDiff

Получает разницу для запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

getPullRequestDiffStat

Получает статистику различий для запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

getPullRequestPatch

Получает патч для запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

Операции по выполнению задач запроса на извлечение

getPullRequestTasks

Перечисляет задачи по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

createPullRequestTask

Создает задачу по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • content : Содержание задачи

  • comment (необязательно): идентификатор комментария для связи с задачей

  • pending (необязательно): находится ли задача в ожидании

getPullRequestTask

Получает конкретную задачу по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • task_id : идентификатор задачи

updatePullRequestTask

Обновляет задачу по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • task_id : идентификатор задачи

  • content (необязательно): обновленное содержимое задачи

  • state (необязательно): обновленное состояние задачи

deletePullRequestTask

Удаляет задачу по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

  • task_id : идентификатор задачи

Другие операции по запросу на извлечение

getPullRequestCommits

Список коммитов по запросу на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

getPullRequestStatuses

Список статусов коммитов для запроса на извлечение.

Параметры:

  • workspace : Имя рабочего пространства Bitbucket

  • repo_slug : Слаг репозитория

  • pull_request_id : идентификатор запроса на извлечение

Разработка

Предпосылки

  • Node.js 18 или выше

  • нпм или пряжа

Настраивать

# 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.

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

TDQS

D1.6/5.0

Scored across 3 tools

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

Related MCP Connectors

Related MCP Servers