Secure local Python MCP server for Bitbucket integration with repository and issue management
MCP Bitbucket Python is a specialized Python implementation of an MCP (Model Context Protocol) server designed to integrate AI applications with Bitbucket repositories and related tools. This server runs locally on the same machine as your AI application, providing secure access to essential Bitbucket functionalities for seamless development processes.
The core functionality of the MCP Bitbucket Python server revolves around providing a standardized way for AI applications to interact with Bitbucket's rich set of repository management capabilities. Key features include:
bb_create_repository: Create new repositories within your Bitbucket workspace.
namedescription, workspace (defaults to kallows), project_key, is_private, has_issues.bb_create_branch: Easily create branches in existing repositories.
repo_slug, branchworkspace (defaults to kallows), start_point (defaults to main).bb_delete_repository: Remove a repository from Bitbucket when no longer needed.
repo_slug.workspace (defaults to kallows).bb_read_file: Retrieve file contents directly from your repository.
repo_slug, pathworkspace (defaults to kallows), branch (defaults to main/master).bb_write_file: Edit or create files within repositories.
repo_slug, path, content.workspace (defaults to kallows), branch (defaults to main), message (commit message).bb_create_issue: Create issues in tracked repositories for better issue management.
repo_slug, title, content.workspace (defaults to kallows), kind, priority.bb_delete_issue: Clean up old or unnecessary issues by deleting them.
repo_slug, issue_id.workspace (defaults to kallows).bb_search_repositories: Perform searches acrossBitbucket repositories using a flexible query syntax.
query.workspace (defaults to kallows), page (default: 1), pagelen (default: 10, max: 100).bb_delete_file: Remove files from repositories as required.
repo_slug, path.workspace (defaults to kallows), branch (defaults to main), message (commit message).bb_create_pull_request: Automatically create pull requests for easier code review and merging.
repo_slug, title, source_branch.workspace (defaults to kallows), destination_branch (defaults to main), description, close_source_branch (default: true).The MCP Bitbucket Python server operates by adhering strictly to the Model Context Protocol, ensuring compatibility and seamless communication between various AI applications and backend services. The core architecture involves:
bitbucket_api module.The protocol flow is designed to maintain security and efficiency, ensuring that only authorized actions are performed on Bitbucket repositories. The following Mermaid diagram illustrates this interaction:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Bitbucket API]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
To set up the MCP Bitbucket Python server on your system, follow these steps:
# Clone the repository
git clone https://github.com/kallows/mcp-bitbucket.git
Once cloned, install the necessary dependencies by ensuring you have npx and any required libraries installed. The project also includes a pyproject.toml file for package management.
Imagine an AI application where developers can create repositories on the fly as projects are initiated. They then push code changes and collaborate through Git branches managed by the MCP Bitbucket Python server, ensuring that every bit of source code is neatly tracked and accessible.
Another scenario involves automated issue tracking in Bitbucket using pull requests for feature proposals or bug fixes. When an issue is identified, the MCP client can immediately notify相关部门或团队,并自动创建一个相关的问题,简化了问题报告和解决的流程。
MCP Bitbucket Python server ensures compatibility and seamless integration with popular AI applications like Claude Desktop, Continue, Cursor, etc., as demonstrated in our compatibility matrix below:
| MCP Client | Resources | Tools | Prompts | Status |
|---|---|---|---|---|
| Claude Desktop | ✅ | ✅ | ✅ | Full Support |
| Continue | ✅ | ✅ | ✅ | Full Support |
| Cursor | ❌ | ✅ | ❌ | Tools Only |
The performance of the MCP Bitbucket Python server has been meticulously validated to ensure seamless and efficient operation. The compatibility matrix clearly illustrates the level of support for various tools, resources, and prompts across different MCP clients:
| Tool | Status |
|---|---|
| Repository Creation | ✅ |
| Branch Management | ✅ |
| Issue Tracking | ✅ |
| Pull Request Handling | ✅ |
To configure the server, you need to set up Bitbucket credentials as environment variables:
export BITBUCKET_USERNAME="your-username"
export BITBUCKET_APP_PASSWORD="your-app-password"
Additionally, for advanced configurations or customizations, refer to the src/bitbucket_api/server.py file. A sample configuration snippet is provided below:
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
How do I ensure secure communication between the MCP client and the server?
Can I use this service with other Git providers besides Bitbucket?
Is it possible to automate issue creation and tracking within my projects?
How can I manage configuration settings globally?
What are the best practices for using this MCP server in a distributed team environment?
If you're interested in contributing to MCP Bitbucket Python or want to explore its inner workings, our development guide is a great place to start. It covers everything from setting up a local development environment to writing tests and submitting pull requests.
git clone https://github.com/kallows/mcp-bitbucket.gitpip install -r requirements.txt
pytest
Explore the broader MCP ecosystem by visiting the official Model Context Protocol documentation and community forums. There, you'll find additional resources, tools, and real-world examples to support your integration efforts.
By leveraging this comprehensive MCP Bitbucket Python server, you can enhance the capabilities of AI applications, making them more integrated with essential development tools like Bitbucket. This setup not only streamlines workflows but also paves the way for seamless collaboration and efficient project management in modern, tech-driven environments.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration