bbkt

bbkt

A Bitbucket CLI and MCP server written in Go for managing workspaces, repositories, pull requests, pipelines, issues, and source code. Supports stdio and HTTP transport.

Category
访问服务器

README

bbkt (Bitbucket CLI & MCP Server)

Documentation Go Report Card License

A complete command-line interface and Model Context Protocol (MCP) server written in Go that provides programmatic integration with Bitbucket workspaces and repositories.

<p align="center"> <img src="demo.gif" alt="bbkt CLI demo" width="700" /> </p>

Features

  • Dual Mode: Run as a rich, interactive CLI tool for daily developer tasks, or as an MCP server for AI agents.
  • Git Awareness: Automatically detects your current Bitbucket repository from .git/config when run from the terminal.
  • Interactive UI: Sleek terminal UI wizards trigger automatically when required arguments are omitted.
  • Read/Write Operations: Seamlessly manage repositories, workspaces, pipelines, issues, and pull requests. Modify or delete repository source code directly from the API.
  • Authentication: Supports standard App Passwords or an interactive OAuth 2.0 web flow for desktop users.

Installation

From Source

# Clone the repository
git clone https://github.com/zach-snell/bbkt.git
cd bbkt

# Run the install script (builds and moves to ~/.local/bin)
./install.sh

Ensure ~/.local/bin is added to your system $PATH for the executable to be universally available.

From GitHub Releases

Download the appropriate binary for your system (Linux, macOS, Windows) from the Releases page.

CLI Usage

bbkt provides a robust command-line interface with the following core modules:

# Manage workspaces
bbkt workspaces [list, get]

# Manage repositories
bbkt repos [list, get, create, delete]

# Manage pull requests and comments
bbkt prs [list, get, create, merge, approve, decline]
bbkt prs comments [list, add, resolve]

# Trigger and view pipelines
bbkt pipelines [list, get, trigger, stop, logs]

# Issue tracking
bbkt issues [list, get, create, update]

# Read, search, and edit source code
bbkt source [read, tree, search, history, write, delete]

MCP Usage

The tool also serves as an MCP server. It supports two protocols: Stdio (default via bbkt mcp) and the official Streamable Transport API over HTTP.

Stdio Transport (Default)

If you intend to use this with an MCP client (such as Claude Desktop or Cursor), add it to your client's configuration file as a local command:

{
  "mcpServers": {
    "bitbucket": {
      "command": "/absolute/path/to/bbkt",
      "args": ["mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-username",
        "BITBUCKET_API_TOKEN": "your-api-token"
      }
    }
  }
}

Streamable Transport (HTTP)

You can run the server as a long-lived HTTP process serving the Streamable Transport API (which uses Server-Sent Events underneath). This is useful for remote network clients.

bbkt mcp --port 8080

Environment Variables

Variable Description Required
BITBUCKET_USERNAME Your Bitbucket username No (but recommended for API Tokens)
BITBUCKET_API_TOKEN An Atlassian API Token No (If omitted, triggers OAuth 2.0 browser flow)
BITBUCKET_CLIENT_ID OAuth 2.0 Client ID Only if using OAuth
BITBUCKET_CLIENT_SECRET OAuth 2.0 Client Secret Only if using OAuth

API Token Scopes & Security

read:workspace, read:account, read:user, read:repository:bitbucket, write:repository:bitbucket, read:pullrequest:bitbucket, write:pullrequest:bitbucket, read:pipeline:bitbucket, write:pipeline:bitbucket

Token Introspection: The bbkt mcp server dynamically evaluates your API token's granted scopes at startup. If you omit specific permissions (like write:pipeline:bitbucket), the server will completely hide the associated MCP tools (trigger_pipeline, stop_pipeline) from the AI agent to prevent hallucinated successes.

Explicit Tool Denial: Even if your token has full admin privileges, you can explicitly deny the AI agent access to any tool using the BITBUCKET_DISABLED_TOOLS environment variable.

export BITBUCKET_DISABLED_TOOLS="delete_repository,delete_branch,delete_file"

Tools Provided

  • manage_workspaces: Getting and listing Bitbucket workspaces
  • manage_repositories: Listing, getting, creating, and deleting repositories
  • manage_refs: Listing, creating, and deleting branches and tags
  • manage_commits: Listing and getting commits, diffs, and diffstats
  • manage_source: Source code operations (read, list_directory, get_history, search, write, delete)
  • manage_pull_requests: All pull request operations (list, get, create, update, merge, approve, unapprove, decline, diff, diffstat, commits)
  • manage_pr_comments: Managing pull request comments (list, create, update, delete, resolve, unresolve)
  • manage_pipelines: Managing Bitbucket Pipelines (list, get, trigger, stop, list-steps, get-step-log)
  • manage_issues: Managing repository issues (list, get, create, update)

Development

Requirements:

  • Go 1.25+
# Run tests
go test ./...

# Run the linter
golangci-lint run ./...

License

This project is licensed under the Apache 2.0 License.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选