@tarasrushchak/bitbucket-server-mcp
v1.5.2
Published
MCP Server for Bitbucket Server/Data Center — PR management, repositories, code review
Maintainers
Readme
@tarasrushchak/bitbucket-server-mcp
MCP (Model Context Protocol) server for Bitbucket Server / Data Center (formerly Stash).
Note: This package is for Bitbucket Server/Data Center, NOT Bitbucket Cloud. The APIs are different.
Setup
Claude Code
claude mcp add bitbucket-server -e BITBUCKET_URL=https://your-bitbucket.com -e BITBUCKET_TOKEN=your-token -- npx -y @tarasrushchak/bitbucket-server-mcpManual config (~/.claude.json or ~/.claude/mcp.json)
{
"mcpServers": {
"bitbucket-server": {
"command": "npx",
"args": ["-y", "@tarasrushchak/bitbucket-server-mcp"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-personal-access-token"
}
}
}
}Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| BITBUCKET_URL | Yes | Base URL of your Bitbucket Server instance |
| BITBUCKET_TOKEN | Yes | Personal access token (HTTP access tokens) |
Generating a token
- Go to your Bitbucket Server profile: Manage account > HTTP access tokens
- Create a token with Repository read/write and Pull request read/write permissions
Available Tools
Pull Requests
| Tool | Description |
|------|-------------|
| create_pull_request | Create a new pull request |
| get_pull_request | Get details of a specific PR |
| get_pull_request_build_status | Get current build statuses for the PR source commit |
| get_pull_request_diff | Get the diff/changes of a PR |
| list_pull_requests | List PRs in a repository (filter by state) |
| approve_pull_request | Approve a PR |
| decline_pull_request | Decline a PR |
| merge_pull_request | Merge a PR |
Comments
| Tool | Description |
|------|-------------|
| add_comment | Add a general comment to a PR |
| add_inline_comment | Add an inline comment on a specific file/line |
| add_blocker_comment | Add a blocker comment/task to a PR |
| add_suggested_change | Add an inline suggested change with an Apply suggestion action |
| get_pull_request_comments | Get all comments on a PR, including threaded replies |
| get_pull_request_comment | Get a single PR comment by ID |
| get_blocker_comments | Get blocker comments/tasks on a PR |
| update_comment | Update comment text, thread state, severity, or task state |
| delete_comment | Delete a PR comment |
| delete_blocker_comment | Delete a blocker comment/task |
| resolve_comment | Resolve or reopen a PR comment thread |
| apply_suggestion | Apply a Bitbucket suggested change from a comment |
Comment mutation tools that need optimistic concurrency (delete_comment,
delete_blocker_comment, update_comment, resolve_comment, and apply_suggestion) accept
optional version inputs. If omitted, the tool first fetches the current comment and/or pull request
version, matching the Bitbucket Server/Data Center REST API contract. Comment listing and single
comment tools include version, severity, state, permittedOperations, tasks, and expanded
anchor fields when Bitbucket returns them.
get_pull_request_comments and get_blocker_comments follow Bitbucket paged APIs automatically.
Use start, limit, and maxPages to bound pagination when needed. Inline comment tools accept
extended anchor fields (fileType, diffType, fromHash, toHash, and srcPath) for moved files,
range diffs, and commit-scoped comments.
Repositories
| Tool | Description |
|------|-------------|
| list_repositories | List repositories in a project |
| get_repository | Get repository details |
| list_branches | List branches (with optional filter) |
Projects
| Tool | Description |
|------|-------------|
| list_projects | List all projects |
| get_project | Get project details |
Available Prompts
| Prompt | Description |
|--------|-------------|
| review-pull-request | Review a PR using details, build status, diff, and comments |
| summarize-pull-request-status | Summarize state, approvals, comments, blockers, and latest build status |
| check-merge-readiness | Check whether a PR appears ready to merge without merging it |
| follow-up-unresolved-comments | Find unresolved comments and draft a follow-up plan |
Usage Examples
Once configured, you can use natural language in Claude Code:
> Create a PR from feature/my-branch to main in PROJECT/my-repo
> Review PR #42 in PROJECT/repo-name
> Approve PR #100
> Add a comment to PR #55 with my review notesLicense
MIT
