This project contains an MCP (Model Context Protocol) server that can interact with Bitbucket.
The BitbucketMcpServer
console application requires configuration to connect to your Bitbucket account and target repository. This configuration can be provided via command-line arguments or environment variables. Command-line arguments take precedence over environment variables.
To build the solution:
dotnet build
dotnet publish .\src\BitbucketMcpServer\BitbucketMcpServer.csproj -o publish
-
Build the standalone executable for local MCP
-
Copy the standalone executable to a directory in your PATH
-
Open the Cline MCP Configuation file (
cline_mcp_settings.json
) in Visual Studio Code. -
Add the following configuration:
{ "Bitbucket": { "autoApprove": [], "disabled": false, "timeout": 60, "command": "BitbucketMcpServer", "args": [ "-u", "{{ bitbucket_username }}", "-p", "{{ bitbucket_app_password }}", "-a", "{{ bitbucket_account_name }}", "-r", "{{ bitbucket_repo_name }}" ], "transportType": "stdio" } }
- SharpBucket: A .NET wrapper for the Bitbucket Cloud's REST APIs.
- Serilog: For logging.
- ModelContextProtocol: For MCP server integration (though this example primarily focuses on
SharpBucket
usage).