Install
$ agentstack add mcp-garc33-bitbucket-server-mcp-server ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Bitbucket Server MCP
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 Smithery
To install Bitbucket Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude
Manual Installation
npm install
Build
npm run build
Features
The server provides the following tools for comprehensive Bitbucket Server integration:
list_projects
Discover and explore Bitbucket projects: Lists all accessible projects with their details. Essential for project discovery and finding the correct project keys to use in other operations.
Use cases:
- Find available projects when you don't know the exact project key
- Explore project structure and permissions
- Discover new projects you have access to
Parameters:
limit: Number of projects to return (default: 25, max: 1000)start: Start index for pagination (default: 0)
list_repositories
Browse and discover repositories: Explore repositories within specific projects or across all accessible projects. Returns comprehensive repository information including clone URLs and metadata.
Use cases:
- Find repository slugs for other operations
- Explore codebase structure across projects
- Discover repositories you have access to
- Browse a specific project's repositories
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)limit: Number of repositories to return (default: 25, max: 1000)start: Start index for pagination (default: 0)
create_pull_request
Propose code changes for review: Creates a new pull request to submit code changes, request reviews, or merge feature branches. Automatically handles branch references and reviewer assignments.
Use cases:
- Submit feature development for review
- Propose bug fixes
- Request code integration from feature branches
- Collaborate on code changes
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugtitle(required): Clear, descriptive PR titledescription: Detailed description with context (supports Markdown)sourceBranch(required): Source branch containing changestargetBranch(required): Target branch for mergingreviewers: Array of reviewer usernamessourceProject: Project key of the source repository (for cross-repo PRs from forks)sourceRepository: Slug of the source repository (for cross-repo PRs from forks)includeDefaultReviewers: Automatically fetch and include default reviewers configured for the target branch (default: true)
update_pull_request
Safely update a pull request: Modify the title, description, or reviewers of an existing pull request without losing any metadata. Uses a read-modify-write pattern to preserve all fields not explicitly changed.
Use cases:
- Fix PR title or description after creation
- Add or replace reviewers without losing existing ones
- Update PR metadata without affecting approval status
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request ID to updatetitle: New title (if omitted, current title is preserved)description: New description (if omitted, current description is preserved)reviewers: New reviewer list as array of usernames (if omitted, current reviewers are preserved)
get_pull_request
Comprehensive PR information: Retrieves detailed pull request information including status, reviewers, commits, and all metadata. Essential for understanding PR state before taking actions.
Use cases:
- Check PR approval status
- Review PR details and progress
- Understand changes before merging
- Monitor PR status
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request ID
merge_pull_request
Integrate approved changes: Merges an approved pull request into the target branch. Supports different merge strategies based on your workflow preferences.
Use cases:
- Complete the code review process
- Integrate approved features
- Apply bug fixes to main branches
- Release code changes
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request IDmessage: Custom merge commit messagestrategy: Merge strategy:merge-commit(default): Creates merge commit preserving historysquash: Combines all commits into onefast-forward: Moves branch pointer without merge commit
decline_pull_request
Reject unsuitable changes: Declines a pull request that should not be merged, providing feedback to the author.
Use cases:
- Reject changes that don't meet standards
- Close PRs that conflict with project direction
- Request significant rework
- Prevent unwanted code integration
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request IDmessage: Reason for declining (helpful for author feedback)
add_comment
Participate in code review: Adds comments to pull requests for review feedback, discussions, and collaboration. Supports threaded conversations.
Use cases:
- Provide code review feedback
- Ask questions about specific changes
- Suggest improvements
- Participate in technical discussions
- Document review decisions
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request IDtext(required): Comment content (supports Markdown)parentId: Parent comment ID for threaded repliesstate: Comment state:OPEN(default, published immediately) orPENDING(draft, visible only to you until review is published)
get_diff
Analyze code changes: Retrieves the code differences showing exactly what was added, removed, or modified in the pull request. Supports per-file truncation to manage large diffs effectively.
Use cases:
- Review specific code changes
- Understand scope of modifications
- Analyze impact before merging
- Inspect implementation details
- Code quality assessment
- Handle large files without overwhelming output
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request IDcontextLines: Context lines around changes (default: 10)maxLinesPerFile: Maximum lines to show per file (optional, uses BITBUCKETDIFFMAXLINESPER_FILE env var if not specified, set to 0 for no limit)
Large File Handling: When a file exceeds the maxLinesPerFile limit, it shows:
- File headers and metadata (always preserved)
- First 60% of allowed lines from the beginning
- Truncation message with file statistics
- Last 40% of allowed lines from the end
- Clear indication of how to see the complete diff
get_reviews
Track review progress: Fetches review history, approval status, and reviewer feedback to understand the review state.
Use cases:
- Check if PR is ready for merging
- See who has reviewed the changes
- Understand review feedback
- Monitor approval requirements
- Track review progress
get_activities
Retrieve pull request activities: Gets the complete activity timeline for a pull request including comments, reviews, commits, and other events.
Use cases:
- Read comment discussions and feedback
- Review the complete PR timeline
- Track commits added/removed from PR
- See approval and review history
- Understand the full PR lifecycle
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request ID
get_comments
Extract PR comments only: Filters pull request activities to return only the comments, making it easier to focus on discussion content without reviews or other activities.
Use cases:
- Read PR discussion threads
- Extract feedback and questions
- Focus on comment content without noise
- Analyze conversation flow
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugprId(required): Pull request ID
search
Advanced code and file search: Search across repositories using the Bitbucket search API with support for project/repository filtering and query optimization. Searches both file contents and filenames. Note: Search only works on the default branch of repositories.
Use cases:
- Find specific code patterns across projects
- Locate files by name or content
- Search within specific projects or repositories
- Filter by file extensions
Parameters:
query(required): Search query stringproject: Bitbucket project key to limit search scoperepository: Repository slug for repository-specific searchtype: Query optimization - "file" (wraps query in quotes for exact filename matching) or "code" (default search behavior)limit: Number of results to return (default: 25, max: 100)start: Start index for pagination (default: 0)
Query syntax examples:
"README.md"- Find exact filenameconfig ext:yml- Find config in YAML filesfunction project:MYPROJECT- Search for "function" in specific projectbug fix repo:PROJ/my-repo- Search in specific repository
get_file_content
Read file contents with pagination: Retrieve the content of specific files from repositories with support for large files through pagination.
Use cases:
- Read source code files
- View configuration files
- Extract documentation content
- Inspect specific file versions
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugfilePath(required): Path to the file in the repositorybranch: Branch or commit hash (optional, defaults to main/master)limit: Maximum lines per request (default: 100, max: 1000)start: Starting line number for pagination (default: 0)
browse_repository
Explore repository structure: Browse files and directories in repositories to understand project organization and locate specific files.
Use cases:
- Explore repository structure
- Navigate directory trees
- Find files and folders
- Understand project organization
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugpath: Directory path to browse (optional, defaults to root)branch: Branch or commit hash (optional, defaults to main/master)limit: Maximum items to return (default: 50)
list_pull_requests
Discover and filter pull requests: List pull requests in a repository with filtering by state, author, and direction. Returns PR metadata including title, author, branches, reviewers, and status.
Use cases:
- Find open PRs in a repository
- List your own pull requests
- See PRs awaiting review
- Get an overview of merged or declined PRs
- Monitor PR activity in a project
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugstate: Filter by PR state —OPEN(default),MERGED,DECLINED, orALLauthor: Filter by author username (exact match)direction:INCOMING(PRs targeting this repo, default) orOUTGOING(PRs from this repo)limit: Number of PRs to return (default: 25, max: 1000)start: Start index for pagination (default: 0)
list_branches
Explore repository branches: List branches in a repository with optional filtering. Identifies the default branch and shows latest commit information for each branch.
Use cases:
- Find branch names for PR creation or checkout
- Verify branch existence before operations
- Identify the default branch
- Search for branches by name
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugfilterText: Filter branches by name (case-insensitive partial match)limit: Number of branches to return (default: 25, max: 1000)start: Start index for pagination (default: 0)
list_commits
Browse commit history: List commits in a repository with optional branch and author filtering. Use this to review changes, track contributions, or understand the evolution of a branch.
Use cases:
- Review recent changes on a branch
- Find commits by a specific author
- Track commit history before merging
- Understand branch evolution
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugbranch: Branch name to list commits from (defaults to the repository's default branch)author: Filter by author name or email (case-insensitive partial match, applied client-side)limit: Number of commits to return (default: 25, max: 1000)start: Start index for pagination (default: 0)
delete_branch
Clean up merged branches: Delete a branch from a repository. Includes a safety check to prevent deletion of the default branch.
Use cases:
- Clean up feature branches after PR merge
- Remove stale or abandoned branches
- Repository maintenance and hygiene
Parameters:
project: Bitbucket project key (optional, uses BITBUCKETDEFAULTPROJECT if not provided)repository(required): Repository slugbranch(required): Branch name to delete
approve_pull_request
Approve code changes: Approve a pull request as the c
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: garc33
- Source: garc33/bitbucket-server-mcp-server
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.