Bitbucket ServerSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
MCP (Model Context Protocol) server for Bitbucket Server Pull Request management. This server provides tools and resources to interact with the Bitbucket Server API through the MCP protocol.
[](https://smithery.ai/server/@garc33/bitbucket-server-mcp-server)
✨ New Features
- 🔧 Custom HTTP Headers: Add custom headers to all requests via
BITBUCKET_CUSTOM_HEADERSenvironment variable (useful for Zero Trust tokens or proxies) - 📋 PR Discovery: List and filter pull requests by state, author, or direction using
list_pull_requests(fixes #14) - 🌿 Branch Management: List branches with default branch detection using
list_branches, delete merged branches withdelete_branch - 📝 Commit History: Browse commit history with branch and author filtering using
list_commits - ✅ PR Approval: Approve and unapprove pull requests with
approve_pull_requestandunapprove_pull_request - 🔍 Advanced Search: Search code and files across repositories with project/repository filtering using the
searchtool - 📄 File Operations: Read file contents and browse repository directories with
get_file_contentandbrowse_repository - 💬 Comment Management: Extract and filter PR comments with
get_commentstool - 🔍 Project Discovery: List all accessible Bitbucket projects with
list_projects - 📁 Repository Browsing: Explore repositories across projects with
list_repositories - 🔧 Flexible Project Support: Make the default project optional - specify per command or use
BITBUCKET_DEFAULT_PROJECT - 📖 Enhanced Documentation: Improved README with usage examples and better configuration guidance
Requirements
- Node.js >= 16
Installation
Installing via S
785e9fdb2f3bOBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add bitbucket-server --env BITBUCKET_PASSWORD=${BITBUCKET_PASSWORD} --env BITBUCKET_TOKEN=${BITBUCKET_TOKEN} -- npx -y [email protected]{
"mcpServers": {
"bitbucket-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"BITBUCKET_PASSWORD": "${BITBUCKET_PASSWORD}",
"BITBUCKET_TOKEN": "${BITBUCKET_TOKEN}"
}
}
}
}Exposed tools (27)
17 read · 7 write · 3 destructive. Blast radius: 3 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
add_comment | write | Add a comment to a pull request for code review, feedback, questions, or discussion. Use this to provide review feedback, ask questions about specific changes, suggest improvements, or participate in code review discussions. Supports threaded conversations. |
add_comment_inline | write | Add an inline comment (to specific lines) to the diff of a pull request for code review, feedback, questions, or discussion. Use this to provide review feedback, ask questions about specific changes, suggest improvements, or participate in code review discussions. Supports threaded conversations. |
approve_pull_request | read | Approve a pull request as the current user. Use this to signal that you have reviewed the changes and they are ready to be merged. The approval is recorded with your user identity. |
browse_repository | read | Browse and list files and directories in a Bitbucket repository. Use this to explore repository structure, find files, or navigate directories. |
create_pull_request | write | Create a new pull request to propose code changes, request reviews, or merge feature branches. Use this when you want to submit code for review, merge a feature branch, or contribute changes to a repository. Automatically sets up branch references and can assign reviewers. |
decline_pull_request | read | Decline or reject a pull request that should not be merged. Use this when changes are not acceptable, conflicts with project direction, or when the PR needs significant rework. This closes the PR without merging. |
delete_branch | destructive | Delete a branch from a Bitbucket repository. Cannot delete the default branch. Use this for cleanup after merging pull requests or removing stale feature branches. |
delete_comment | destructive | Delete a comment from a pull request. Requires the comment version for optimistic locking. |
edit_comment | write | Edit an existing comment on a pull request. Use this to fix typos, update information, or reformat comments. Requires the comment version for optimistic locking. |
get_activities | read | Retrieve all activities for a pull request including comments, reviews, commits, and other timeline events. Use this to get the complete activity history and timeline of the pull request. |
get_code_insights | read | Retrieve Code Insights reports (SonarQube, security scans, etc.) and their annotations for a pull request. Use this to check quality gates, code coverage, security findings, and other CI/CD analysis results. |
get_comments | read | Retrieve only the comments from a pull request. Use this when you specifically want to read the discussion and feedback comments without other activities like reviews or commits. |
get_dashboard_pull_requests | read | List pull requests across all repositories for the authenticated user. Use this to see PRs you need to review, PRs you authored, or PRs you are participating in. Returns PRs from all projects and repositories without needing to specify each one. |
get_diff | read | Retrieve the code differences (diff) for a pull request showing what lines were added, removed, or modified. Use this to understand the scope of changes, review specific code modifications, or analyze the impact of proposed changes before merging. |
get_file_content | read | Retrieve the content of a specific file from a Bitbucket repository with pagination support. Use this to read source code, configuration files, documentation, or any text-based files. For large files, use start parameter to paginate through content. |
get_pull_request | read | Retrieve comprehensive details about a specific pull request including status, reviewers, commits, and metadata. Use this to check PR status, review progress, understand changes, or gather information before performing actions like merging or commenting. |
get_reviews | read | Fetch the review history and approval status of a pull request. Use this to check who has reviewed the PR, see approval status, understand review feedback, or determine if the PR is ready for merging based on review requirements. |
list_branches | read | List branches in a Bitbucket repository. Shows branch names, latest commits, and identifies the default branch. Use this to explore available branches, find branch names for checkout or PR creation, or verify branch existence before operations. |
list_commits | read | List commits in a Bitbucket repository, optionally filtered by branch and/or author. Use this to review commit history, find specific changes, track contributions, or understand the evolution of a branch. |
list_projects | read | Discover and list all Bitbucket projects you have access to. Use this first to explore available projects, find project keys, or when you need to work with a specific project but don\ |
list_pull_requests | read | List pull requests in a Bitbucket repository filtered by state, author, or direction. Use this to find open PRs, see your pending reviews, discover PRs awaiting merge, or get an overview of PR activity in a repository. |
list_repositories | read | Browse and discover repositories within a specific project or across all accessible projects. Use this to find repository slugs, explore codebases, or understand the repository structure. Returns repository names, slugs, clone URLs, and project associations. |
merge_pull_request | write | Merge an approved pull request into the target branch. Use this when a PR has been reviewed, approved, and is ready to be integrated. Choose the appropriate merge strategy based on your team\ |
publish_review | write | Publish all pending (draft) review comments on a pull request at once. Optionally set your review status to APPROVED or NEEDS_WORK, and add an overview comment. This is the batch operation that transitions all PENDING comments to published. |
search | read | Search for code or files across repositories. Use this to find specific code patterns, file names, or content within projects and repositories. Searches both file contents and filenames. Supports filtering by project, repository, and query optimization. |
unapprove_pull_request | destructive | Remove your approval from a pull request. Use this to retract a previous approval if you discover issues after approving or if the PR has changed since your review. |
update_pull_request | write | Update an existing pull request title, description, or reviewers. Safely preserves all fields not explicitly changed (uses read-modify-write to avoid losing reviewers or other metadata). |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (3)
delete_branch, delete_comment, unapprove_pull_request
@modelcontextprotocol/sdk, axios, winston, @eslint/js, @types/node, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, @vitest/coverage-v8
**To enable read-only mode**: Set the environment variable `BITBUCKET_READ_ONLY=true`
Gates applied: no_behavioural_pass.
785e9fdb2f3bfull audit observations/trust-audit/mcp-server/garc33__bitbucket-server.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 785e9fdb2f3b | SAFE | B | 89 | first audit |
Questions
What tools does Bitbucket Server expose?
27 in total: 17 read-only, 7 that write, and 3 that can delete or overwrite (delete_branch, delete_comment, unapprove_pull_request). Every one is listed on this page with its risk.
Is Bitbucket Server safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 3 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Bitbucket Server need?
It reads BITBUCKET_PASSWORD and BITBUCKET_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Bitbucket Server run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as bitbucket-server at 1.0.0.
How current is this page?
The grade is for one exact copy of the source (785e9fdb2f3b), read on 2026-10-07. The repository is watched and re-audited when it changes.