bitbucket-python-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BITBUCKET_USERNAME | Yes | Your BitBucket username (not email) | |
| BITBUCKET_API_TOKEN | Yes | App password/API token from BitBucket settings | |
| BITBUCKET_MCP_DEBUG | No | Enable debug logging (1/true/yes) | |
| BITBUCKET_WORKSPACE | Yes | Default workspace slug |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_repositoriesA | List repositories in a BitBucket workspace. This is the primary tool for discovering repositories. Use this when the user wants to see what repositories are available or when searching for a specific repository by browsing. Args: workspace: Workspace slug. If not provided, uses the default workspace from BITBUCKET_WORKSPACE environment variable. limit: Maximum number of repositories to return. Default 50. Returns: JSON list of repositories with their names, descriptions, and URLs. |
| get_repositoryA | Get detailed information about a specific BitBucket repository. Use this tool when you need full details about a repository, including its settings, clone URLs, and metadata. Args: repository: Repository slug (the URL-friendly name of the repository). workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with complete repository details. |
| create_repositoryA | Create a new repository in BitBucket. Use this tool when the user wants to create a new repository. The repository will be created in the specified workspace with the given settings. Args: name: Name of the new repository. Will also be used as the slug. description: Optional description of the repository. is_private: Whether the repository should be private (default: True). project_key: Optional project key to associate the repository with a project. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with the created repository details. |
| delete_repositoryA | Delete a repository from BitBucket. WARNING: This is a destructive operation that cannot be undone. The confirm parameter MUST be set to true to proceed with deletion. Use this tool only when the user explicitly requests to delete a repository and has confirmed the deletion. Args: repository: Repository slug to delete. confirm: Must be True to proceed with deletion. This is a safety measure. workspace: Workspace slug. If not provided, uses the default workspace. Returns: Confirmation message or error if confirm is not True. |
| update_repositoryA | Update repository settings in BitBucket. Use this tool to modify repository metadata such as description or visibility. Only provide the parameters you want to change. Args: repository: Repository slug to update. description: New description for the repository. is_private: Whether the repository should be private. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with the updated repository details. |
| list_branchesA | List branches in a BitBucket repository. Use this tool to see available branches in a repository, including their names and latest commit information. Args: repository: Repository slug. If not provided and working in a git repo with a BitBucket remote, will use the current repository. workspace: Workspace slug. If not provided, uses the default workspace. limit: Maximum number of branches to return. Default 50. Returns: JSON list of branches with their names and target commit info. |
| get_branchA | Get detailed information about a specific branch. Use this tool when you need complete details about a branch, including its latest commit information. Args: branch_name: Name of the branch to get details for. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with branch details including commit information. |
| create_branchA | Create a new branch in a BitBucket repository. Use this tool when the user wants to create a new branch. By default, branches are created from the 'development' branch. Args: branch_name: Name for the new branch. source_branch: Source branch to create from (default: 'development'). repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with the created branch details. |
| delete_branchA | Delete a branch from a BitBucket repository. WARNING: This is a destructive operation. The confirm parameter MUST be set to true to proceed with deletion. Use this tool only when the user explicitly requests to delete a branch and has confirmed the deletion. Args: branch_name: Name of the branch to delete. confirm: Must be True to proceed with deletion. This is a safety measure. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: Confirmation message or error if confirm is not True. |
| list_pull_requestsA | List pull requests in a BitBucket repository. Use this tool to see pull requests in a repository. By default, shows only open pull requests. Args: repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. state: Filter by state - 'OPEN', 'MERGED', 'DECLINED', or 'SUPERSEDED'. Default is 'OPEN'. limit: Maximum number of pull requests to return. Default 10. Returns: JSON list of pull requests with their titles, authors, and status. |
| get_pull_requestA | Get detailed information about a specific pull request. Use this tool to get complete details about a pull request, including its description, reviewers, and approval status. Args: pr_id: Pull request ID. If not provided, returns the newest open PR. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object with complete pull request details. |
| get_pull_request_diffA | Get the diff/changes for a pull request. Use this tool to see what code changes are included in a pull request. Returns the raw diff output. Args: pr_id: Pull request ID. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: The diff text showing all changes in the pull request. |
| get_pull_request_commentsA | Get all comments on a pull request. Use this tool to review comments, feedback, and discussions on a pull request. Includes both general comments and inline code review comments. Args: pr_id: Pull request ID. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON list of comments with their content, authors, and locations. |
| add_pull_request_commentA | Add a comment to a pull request. Use this tool to add feedback or discussion to a pull request. Can add general comments or inline comments on specific lines of code. Args: pr_id: Pull request ID. comment: The comment text to add. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. file_path: Path to file for inline comment (optional). line_number: Line number for inline comment (optional, requires file_path). Returns: JSON object confirming the comment was added. |
| approve_pull_requestB | Approve a pull request. Use this tool to approve a pull request, indicating the changes are acceptable and ready to merge. Args: pr_id: Pull request ID to approve. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object confirming the approval. |
| request_changesA | Request changes on a pull request. Use this tool to indicate that changes are needed before the pull request can be approved. Always include a comment explaining what needs to change. Args: pr_id: Pull request ID. comment: Explanation of what changes are needed. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON object confirming the change request. |
| create_pull_requestA | Create a new pull request. Use this tool to create a pull request for merging changes from one branch to another. Supports auto-detection of source branch and smart destination selection. Workflow for adding reviewers:
Args: title: Title of the pull request. source_branch: Branch containing the changes. If not provided, uses the current git branch. Cannot be main/master/development. destination_branch: Branch to merge into. If not provided, defaults to 'development' for feature/bugfix branches. description: Optional description of the changes. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. reviewer_account_ids: Comma-separated list of reviewer account_ids to add as additional reviewers (use search_workspace_users to find these). include_default_reviewers: If True (default), includes repository's default reviewers in addition to any specified reviewers. close_source_branch: Whether to close the source branch after merge. Returns: JSON object with the created pull request details. |
| search_repositoriesA | Search for repositories in a BitBucket workspace. Use this tool to find repositories by name or other criteria. Searches within the specified workspace and returns matching repositories. Args: query: Search query to filter repositories by name. If not provided, lists all repositories. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON list of matching repositories. |
| get_repository_contentsA | Get file or directory contents from a BitBucket repository. Use this tool to browse repository contents, view file structure, or read file contents. Can navigate to specific paths and refs (branches/tags). Args: path: Path to file or directory (empty string for root). repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. ref: Branch, tag, or commit hash (default: HEAD). Returns: JSON object with directory listing or file contents. |
| search_codeA | Search for code patterns in a BitBucket repository. Use this tool to find specific code patterns, function names, or text within a repository's codebase. Args: query: Search query for code content. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. limit: Maximum number of results to return. Default 20. Returns: JSON list of matching code locations with snippets. |
| get_file_contentA | Get the raw content of a specific file from a BitBucket repository. Use this tool when you need to read the full content of a specific file. This is useful for reviewing code, configuration files, or documentation. Args: file_path: Path to the file in the repository. repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. ref: Branch, tag, or commit hash (default: HEAD). Returns: The raw file content as a string. |
| add_memoryA | Store a new memory/learning for future reference. Use this tool to remember important standards, patterns, or learnings discovered from PR comments, code reviews, or user instructions. These memories will be available when reviewing other PRs or repositories. Common use cases:
Args: content: The learning/standard to remember (be specific and actionable) category: Category - one of: pipeline, testing, coding_style, tools, workflow, general tags: Comma-separated tags for easier searching (e.g., "sonarqube,pipeline,ci") workspace: Workspace this applies to (omit for global/all workspaces) repository: Repository this applies to (omit for all repos in workspace) source_type: Source of this memory - user, pr_comment, or api_response pr_id: If from a PR comment, the PR ID Returns: Confirmation with the created memory details |
| list_memoriesA | List stored memories/learnings. Retrieves all stored memories, optionally filtered by scope or category. Global memories (workspace=None) are always included when filtering by workspace. Args: workspace: Filter by workspace (includes global memories too) repository: Filter by repository category: Filter by category (pipeline, testing, coding_style, tools, workflow, general) Returns: JSON list of memories matching the filters |
| search_memoriesA | Search memories by keyword. Searches memory content and tags for the given query. Use this before reviewing PRs or making suggestions to check for existing standards or learnings. Args: query: Search keyword (searches content and tags) workspace: Filter by workspace repository: Filter by repository Returns: JSON list of matching memories |
| get_relevant_memoriesA | Get all memories relevant to the current context. Call this tool at the start of a PR review or when working with a repository to retrieve all applicable standards and learnings. Args: workspace: Current workspace (uses default if not specified) repository: Current repository categories: Comma-separated categories to filter (e.g., "pipeline,testing") Returns: JSON list of relevant memories for the context |
| delete_memoryB | Delete a stored memory by ID. Args: memory_id: The ID of the memory to delete Returns: Confirmation of deletion |
| remember_from_pr_commentA | Extract and store a learning from a PR comment. Use this when you identify a standard or pattern in a PR comment that should be remembered for future reference. Args: repository: Repository where the PR comment was found pr_id: PR ID where the comment was found comment_content: The original comment content (for reference) learning: The extracted learning/standard to remember category: Category - pipeline, testing, coding_style, tools, workflow, general tags: Comma-separated tags workspace: Workspace (uses default if not specified) apply_to_all_repos: If True, applies to all repos in workspace; if False, only this repo Returns: Confirmation with the created memory |
| get_current_userA | Get the authenticated user's account information including email addresses. Use this tool to get information about the currently authenticated BitBucket user, including their email addresses. This is useful for:
Returns: JSON object with the authenticated user's details and email addresses. |
| get_current_git_branchA | Get the current git branch name. Use this tool to detect what branch you're currently on before creating a pull request. This is useful for auto-detecting the source branch. Returns: JSON object with the current branch name, or error if not in a git repository. |
| search_workspace_usersA | Search for users in a BitBucket workspace by name. Use this tool to find users by their name or nickname. It first checks the memory cache for previously found users, then searches BitBucket if needed. Found users are automatically cached for future lookups. This is useful when:
Args: query: User name or nickname to search for (partial match supported). workspace: Workspace slug. If not provided, uses the default workspace. check_memory_first: If True, checks memory cache before searching BitBucket. Returns: JSON object with matching users. If multiple matches found, returns all so the caller can ask the user to choose. |
| list_workspace_membersA | List all members in a BitBucket workspace. Use this tool to see all users who have access to a workspace. Useful for finding reviewers or understanding team membership. Args: workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON list of all workspace members with their details. |
| get_default_reviewersA | Get default reviewers configured for a repository. Use this tool to see which users are automatically added as reviewers when creating pull requests. These reviewers will be included unless explicitly excluded. Args: repository: Repository slug. If not provided, uses current repository context. workspace: Workspace slug. If not provided, uses the default workspace. Returns: JSON list of default reviewers with their details. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/clikader/bitbucket-python-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server