Bitbucket Cloud MCP Server

Bitbucket Cloud MCP Server

MCP server for the Bitbucket Cloud REST API v2.0, providing 32 tools across 5 toolsets for repository management, pull requests, issues, pipelines, and more with safety controls and LLM-optimized output.

Category
访问服务器

README

Bitbucket Cloud MCP Server

CI npm License: MIT

A Model Context Protocol (MCP) server for the Bitbucket Cloud REST API v2.0. Works with any MCP client — Claude Code, GitHub Copilot, OpenAI Codex, and more. Provides 32 tools across 5 toolsets with safety controls and compact LLM-optimized output.

Setup

Prerequisites

  • Node.js v24+
  • Atlassian API token (see below)

Create an API Token

  1. Go to Atlassian API Tokens
  2. Click "Create API token with scopes"
  3. Name the token (e.g., "Bitbucket MCP") and set expiration
  4. Select app: Bitbucket
  5. Enable the scopes listed below
  6. Click Create and copy the token

Read-only scopes (6 scopes — sufficient when using BITBUCKET_READONLY=true):

Scope Enables
read:user:bitbucket bb_whoami
read:workspace:bitbucket bb_list_workspaces
read:repository:bitbucket bb_list_repositories, bb_get_repository, bb_list_branches, bb_list_commits, bb_get_file, bb_list_directory, bb_search_code
read:pullrequest:bitbucket bb_list_pull_requests, bb_get_pull_request, bb_get_pull_request_diff, bb_get_pull_request_diffstat, bb_list_pull_request_activity
read:issue:bitbucket bb_list_issues, bb_get_issue
read:pipeline:bitbucket bb_list_pipelines, bb_get_pipeline

Write scopes (add these 4 for full access):

Scope Enables
write:repository:bitbucket bb_create_commit_files, bb_create_branch, bb_delete_branch
write:pullrequest:bitbucket bb_create_pull_request, bb_update_pull_request, bb_add_pull_request_comment, bb_approve_pull_request, bb_request_changes_pull_request, bb_merge_pull_request, bb_decline_pull_request
write:issue:bitbucket bb_create_issue, bb_comment_issue
write:pipeline:bitbucket bb_trigger_pipeline

Add to Your MCP Client

<details open> <summary><strong>Claude Code</strong></summary>

One command — no clone or build needed:

claude mcp add bitbucket \
  -e ATLASSIAN_USER_EMAIL=your-email@example.com \
  -e ATLASSIAN_API_TOKEN=your-api-token \
  -e BITBUCKET_READONLY=false \
  -- npx -y @or2ooo/bitbucket-mcp@latest

Verify with:

claude mcp list

</details>

<details> <summary><strong>GitHub Copilot (VS Code)</strong></summary>

Add to .vscode/mcp.json in your project root:

{
  "servers": {
    "bitbucket": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@or2ooo/bitbucket-mcp@latest"],
      "env": {
        "ATLASSIAN_USER_EMAIL": "your-email@example.com",
        "ATLASSIAN_API_TOKEN": "your-api-token",
        "BITBUCKET_READONLY": "false"
      }
    }
  }
}

</details>

<details> <summary><strong>OpenAI Codex CLI</strong></summary>

Add to ~/.codex/config.toml:

[mcp_servers.bitbucket]
command = "npx"
args = ["-y", "@or2ooo/bitbucket-mcp@latest"]
env = { ATLASSIAN_USER_EMAIL = "your-email@example.com", ATLASSIAN_API_TOKEN = "your-api-token", BITBUCKET_READONLY = "false" }

</details>

<details> <summary><strong>From source (for development)</strong></summary>

git clone https://github.com/or2ooo/bitbucket-mcp.git
cd bitbucket-mcp
npm install && npm run build

claude mcp add bitbucket \
  -e ATLASSIAN_USER_EMAIL=your-email@example.com \
  -e ATLASSIAN_API_TOKEN=your-api-token \
  -e BITBUCKET_READONLY=true \
  -- node $(pwd)/dist/index.js

</details>

Environment Variables

Variable Required Description
ATLASSIAN_USER_EMAIL Yes Atlassian account email
ATLASSIAN_API_TOKEN Yes Atlassian API token (see Create an API Token)
BITBUCKET_DEFAULT_WORKSPACE No Default workspace slug
BITBUCKET_ALLOWED_WORKSPACES No Comma-separated allowlist of workspace slugs
BITBUCKET_ALLOWED_REPOS No Comma-separated allowlist (slug or workspace/slug)
BITBUCKET_READONLY No true to block all write operations
BITBUCKET_BASE_URL No Override API base URL

Safety Controls

  • Readonly mode: Set BITBUCKET_READONLY=true to prevent any write operations.
  • Workspace allowlist: Restrict access to specific workspaces.
  • Repository allowlist: Restrict access to specific repositories.
  • Destructive action confirmation: Merge PR, decline PR, and delete branch tools require explicit confirm: true.

Tool Reference

Context (2 tools)

Tool Description
bb_whoami Get current authenticated user
bb_list_workspaces List accessible workspaces

Repositories (10 tools)

Tool Description
bb_list_repositories List repositories in a workspace
bb_get_repository Get repository details
bb_list_branches List branches
bb_list_commits List commits (optionally for a branch/tag)
bb_get_file Get file content at a specific revision
bb_create_commit_files Create a commit with file changes (write)
bb_create_branch Create a new branch (write)
bb_delete_branch Delete a branch (destructive, requires confirm)
bb_list_directory List directory contents at a specific revision
bb_search_code Search for code in a workspace or repository

Pull Requests (12 tools)

Tool Description
bb_list_pull_requests List PRs with optional state filter
bb_get_pull_request Get PR details
bb_create_pull_request Create a new PR (write)
bb_update_pull_request Update PR title, description, or reviewers (write)
bb_get_pull_request_diff Get PR diff (raw text)
bb_get_pull_request_diffstat Get PR diffstat summary
bb_list_pull_request_activity List PR activity (comments, approvals, updates)
bb_add_pull_request_comment Add a comment to a PR (write)
bb_approve_pull_request Approve a PR (write)
bb_request_changes_pull_request Request changes on a PR (write)
bb_merge_pull_request Merge a PR (destructive, requires confirm)
bb_decline_pull_request Decline a PR (destructive, requires confirm)

Issues (4 tools)

Tool Description
bb_list_issues List issues with optional query
bb_get_issue Get issue details
bb_create_issue Create a new issue (write)
bb_comment_issue Add a comment to an issue (write)

Pipelines (3 tools)

Tool Description
bb_list_pipelines List recent pipelines
bb_get_pipeline Get pipeline details
bb_trigger_pipeline Trigger a pipeline run (write)

Development

npm test         # Run tests
npm run lint     # Lint
npm run build    # Compile

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Security

See SECURITY.md for reporting vulnerabilities.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选