Get the FREE Ultimate OpenClaw Setup Guide →

bitbucket

MCP server from garc33/bitbucket-server-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio garc33-bitbucket-server-mcp-server npx -y @garc33/bitbucket-server-mcp-server \
  --env BITBUCKET_CUSTOM_HEADERS="Comma-separated list or JSON for custom HTTP headers to include in all requests" \
  --env BITBUCKET_DEFAULT_PROJECT="Optional default Bitbucket project key (used if per-command project is not provided)"

How to use

This Bitbucket Server MCP provides a suite of MCP tools to manage Bitbucket Server pull requests, repositories, and related metadata via the MCP protocol. It exposes capabilities such as listing projects, repositories, and pull requests, creating and managing PRs, merging or declining PRs, commenting, and retrieving diffs and file contents. The tools support optional default project handling and can filter results by state, author, and direction, making it easier to automate workflows across Bitbucket Server instances. Use the available commands to discover projects, inspect repository structures, prepare PRs, and perform code reviews programmatically through the MCP interface.

How to install

Prerequisites:

  • Node.js v16 or newer installed on the host
  • Internet access to fetch the MCP server package
  1. Prerequisite check:

    • Ensure Node.js is installed: node -v
    • Ensure npm/npx is available: npm -v or npx -v
  2. Install the MCP server via Smithery (recommended):

    • Run: npx -y @garc33/bitbucket-server-mcp-server --client claude
  3. Manual installation (alternative):

    • Install dependencies: npm install
    • Build (if a build step is defined): npm run build
  4. Run the MCP server:

    • If using npx approach, launching the server will be handled by the package after install. Ensure any required environment variables are set (see mcp_config env section).

Notes:

  • The server relies on Node.js >= 16. If you use a container or VM, ensure the runtime matches this requirement.
  • You may need to configure authentication or proxy settings via environment variables described in additional_notes.

Additional notes

Environment variables and configuration tips:

  • BITBUCKET_DEFAULT_PROJECT: If set, this defaults the project key when a specific project is not provided for per-command operations.
  • BITBUCKET_CUSTOM_HEADERS: Provide additional HTTP headers as a string (e.g., 'Header1=Value1,Header2=Value2') to be included in all Bitbucket Server API requests (useful for proxies or Zero Trust tokens).
  • BITBUCKET_DIFF_MAX_LINES_PER_FILE: Controls the maximum lines shown per file when using get_diff. If unset, a default is used by the server. Set to 0 for no limit.

Common issues and tips:

  • If you encounter authentication issues, verify that the server has access to the Bitbucket Server API and that any required tokens or credentials are supplied via environment variables.
  • When using per-command project keys, ensure they exist in Bitbucket Server; if not, rely on BITBUCKET_DEFAULT_PROJECT.
  • For large diffs, consider adjusting max lines per file to avoid excessive output or truncation behavior.

Related MCP Servers

Sponsor this space

Reach thousands of developers