Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

list_branches

Retrieve all branches in a Bitbucket repository by specifying workspace and repository slugs to view available branches for development or review.

Instructions

List all branches in a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug

Implementation Reference

  • Actual implementation of listing branches via Bitbucket API.
    async listBranches(workspace: string, repoSlug: string): Promise<Branch[]> {
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/refs/branches`);
      return response.data.values;
    }
  • src/index.ts:84-96 (registration)
    Tool registration definition for 'list_branches'.
    {
      name: 'list_branches',
      description: 'List all branches in a repository',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
  • Tool handler logic in index.ts that calls the BitbucketClient.
    case 'list_branches': {
      const { workspace, repo_slug } = args as { workspace: string; repo_slug: string };
      const branches = await client.listBranches(workspace, repo_slug);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(branches, null, 2),
          },
        ],

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jlromano/bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server