šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

bitbucket-mcp

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucket-mcp

Model Context Protocol (MCP) server for Bitbucket Cloud and Server API integration

4.0.0
latest
Source
npm
Version published
Weekly downloads
96
50%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Bitbucket MCP

A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs. This MCP server allows AI assistants to interact with Bitbucket repositories, pull requests, and other resources.

Overview

This server implements the Model Context Protocol standard to provide AI assistants with access to Bitbucket data and operations. It includes tools for:

  • Listing and retrieving repositories
  • Managing pull requests
  • Working with repository content

Getting Started

Prerequisites

  • Node.js 18 or higher
  • A Bitbucket Cloud account or Bitbucket Server instance
  • Optional: Bitbucket API token for authenticated requests

Installation

# Clone the repository
git clone https://github.com/yourusername/bitbucket-mcp.git
cd bitbucket-mcp

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Configure the server using environment variables:

# Bitbucket API token (optional, but recommended)
export BITBUCKET_TOKEN=your_token_here

# For custom Bitbucket Server installations
export BITBUCKET_API_URL=https://your-bitbucket-server.com/api

Running the Server

# Start the server
npm start

# Or run in development mode
npm run dev

# Use standalone mode for direct stdio communication
npm run standalone

Available Tools

This MCP server provides tools for interacting with Bitbucket repositories and pull requests. For a comprehensive list of all available tools with detailed documentation, please see TOOLS.md.

Some of the available tools include:

  • listRepositories: List repositories in a workspace
  • getRepository: Get details for a specific repository
  • getPullRequests: Get pull requests for a repository

Integration with MCP Clients

This server can be integrated with any MCP client by connecting to the server endpoint:

  • HTTP endpoint: http://localhost:3000/mcp
  • When running in standalone mode, communication happens over stdio

Development

Project Structure

bitbucket-mcp/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ api/       # API-related code
│   ā”œā”€ā”€ services/  # Service implementations
│   ā”œā”€ā”€ types/     # TypeScript type definitions
│   ā”œā”€ā”€ utils/     # Utility functions
│   └── index.ts   # Entry point
ā”œā”€ā”€ package.json
└── tsconfig.json

Adding New Tools

To add a new tool, modify the src/index.ts file and add your tool definition:

const newTool = server.tool(
  "newToolName",
  {
    param1: z.string(),
    param2: z.number().optional(),
  },
  async ({ param1, param2 }) => {
    // Implementation goes here
    return {
      content: [{ type: "text", text: "Result" }],
    };
  }
);

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

bitbucket

FAQs

Package last updated on 25 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts