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.
To install Bitbucket Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude
npm install
npm run build
The server provides the following tools for Bitbucket Server integration:
create_pull_request
Creates a new pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugtitle
(required): PR titledescription
: PR descriptionsourceBranch
(required): Source branch nametargetBranch
(required): Target branch namereviewers
: Array of reviewer usernamesget_pull_request
Retrieves detailed information about a specific pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request IDmerge_pull_request
Merges a pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request IDmessage
: Merge commit messagestrategy
: One of:
merge-commit
(default)squash
fast-forward
decline_pull_request
Declines a pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request IDmessage
: Reason for decliningadd_comment
Adds a comment to a pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request IDtext
(required): Comment textparentId
: Parent comment ID for repliesget_diff
Retrieves the diff for a pull request.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request IDcontextLines
: Number of context lines (default: 10)get_reviews
Fetches the review history of a pull request, including approvals and reviews.
Parameters:
project
: Bitbucket project key (defaults to BITBUCKET_DEFAULT_PROJECT if set)repository
(required): Repository slugprId
(required): Pull request ID@modelcontextprotocol/sdk
- SDK for MCP protocol implementationaxios
- HTTP client for API requestswinston
- Logging frameworkThe server requires configuration in the VSCode MCP settings file. Here's a sample configuration:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-server/build/index.js"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
// Authentication (choose one):
// Option 1: Personal Access Token
"BITBUCKET_TOKEN": "your-access-token",
// Option 2: Username/Password
"BITBUCKET_USERNAME": "your-username",
"BITBUCKET_PASSWORD": "your-password",
// Optional: Default project
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}
BITBUCKET_URL
(required): Base URL of your Bitbucket Server instanceBITBUCKET_TOKEN
: Personal access tokenBITBUCKET_USERNAME
and BITBUCKET_PASSWORD
: Basic authentication credentialsBITBUCKET_DEFAULT_PROJECT
: Default project key to use when not specified in tool callsThe server logs all operations to bitbucket.log
using Winston for debugging and monitoring purposes.
Seamless access to top MCP servers powering the future of AI integration.