Skip to main content
Glama
phpl

bitbucket-mcp-server

by phpl
README.md
# Bitbucket MCP Server (Custom, Read-Only)

A custom MCP server for Bitbucket Server that exposes only read-only operations.
Built with the official `@modelcontextprotocol/sdk` — no third-party Bitbucket MCP packages.

## Tools

| Tool | Description |
|------|-------------|
| `get_user_profile` | Get user profile by username |
| `get_all_users` | List users with optional filter |
| `list_projects` | List visible projects |
| `list_repositories` | List repos in a project |
| `get_repository` | Get repo details |
| `get_default_branch` | Get default branch of a repo |
| `list_branches` | List branches |
| `list_tags` | List tags |
| `browse_files` | Browse files/directories |
| `get_file_content` | Get raw file content |
| `list_commits` | List commits |
| `get_commit` | Get commit details |
| `get_commit_diff` | Get diff for a commit |
| `get_inbox_pull_requests` | Get PRs in your review inbox |
| `list_pull_requests` | List PRs for a repo |
| `get_pull_request` | Get full PR details |
| `get_pull_request_changes` | Get changed files in a PR |
| `get_pull_request_diff` | Get PR diff (full or per-file) |
| `get_pull_request_file_diff` | Get structured file diff |
| `get_pull_request_activities` | Get PR activity feed |
| `get_pull_request_commits` | Get PR commits |
| `get_pull_request_merge_status` | Check PR merge preconditions |
| `get_pull_request_tasks` | Get PR tasks/blockers |
| `search_code` | Search code across repos |

## Setup

```bash
npm install
npm run build
```

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `BITBUCKET_URL` | Yes | Your Bitbucket Server URL (e.g., `https://bitbucket.example.com`) |
| `BITBUCKET_TOKEN` | Yes | Personal access token with read permissions |

## MCP Configuration

Add to `~/.kiro/settings/mcp.json`:

```json
{
  "mcpServers": {
    "bitbucket": {
      "command": "node",
      "args": ["/absolute/path/to/bitbucket-mcp-server/dist/index.js"],
      "env": {
        "BITBUCKET_URL": "https://bitbucket.example.com",
        "BITBUCKET_TOKEN": "your-token-here"
      }
    }
  }
}
```

TDQS

B3.2/5.0

Scored across 24 tools

Disambiguation4/5

Most tools clearly target distinct resources or specific aspects (e.g., PR activities vs. commits). The only real ambiguity is between get_pull_request_diff and get_pull_request_file_diff, which both involve diffs but with different output structures, so an agent could be unsure which to use.

Naming Consistency4/5

The naming pattern is largely consistent, using get_ for single items and list_ for collections. However, get_inbox_pull_requests and get_all_users are list operations that use get_ instead of list_, which is a minor deviation from the dominant verb convention.

Tool Count3/5

With 24 tools, this server is on the heavy side, fitting the borderline range of 16-25. The count is driven by 10 pull-request-related tools, which feel numerous even though each has a distinct purpose. A more consolidated set would be more appropriate.

Completeness2/5

The server is entirely read-only, lacking any create, update, delete, merge, or comment capabilities for repositories or pull requests. This is a significant gap for a Bitbucket integration, preventing agents from completing common lifecycle workflows like approving or merging a PR.

Maintenance

ActivityInactive
ResponsivenessNo issues