Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

create_repository

Create a new repository in a Bitbucket Cloud workspace with configurable settings for privacy, language, issue tracking, and project assignment.

Instructions

Create a new repository in the specified workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
nameNoRepository name
descriptionNoRepository description
is_privateNoWhether the repository is private
languageNoPrimary language
has_issuesNoEnable issue tracker
has_wikiNoEnable wiki
project_keyNoProject key to add repo to

Implementation Reference

  • Core handler function that executes the repository creation by making a POST request to the Bitbucket API endpoint.
    async create(params: CreateRepositoryParams): Promise<BitbucketRepository> {
      const { workspace, repo_slug, ...body } = params;
      return this.client.post<BitbucketRepository>(`/repositories/${workspace}/${repo_slug}`, body);
    }
  • Dispatch handler in ToolHandler that validates input with Zod schema and delegates to RepositoriesAPI.create method.
    case 'create_repository': {
      const params = toolSchemas.create_repository.parse(args);
      return this.repos.create(params);
  • Zod schema definition for validating create_repository tool parameters.
    create_repository: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
      name: z.string().optional().describe('Repository name'),
      description: z.string().optional().describe('Repository description'),
      is_private: z.boolean().optional().describe('Whether the repository is private'),
      language: z.string().optional().describe('Primary language'),
      has_issues: z.boolean().optional().describe('Enable issue tracker'),
      has_wiki: z.boolean().optional().describe('Enable wiki'),
      project_key: z.string().optional().describe('Project key to add repo to'),
    }),
  • MCP tool registration in toolDefinitions array, defining name, description, and input schema for the LLM.
    {
      name: 'create_repository',
      description: 'Create a new repository in the specified workspace.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
          name: { type: 'string', description: 'Repository name' },
          description: { type: 'string', description: 'Repository description' },
          is_private: { type: 'boolean', description: 'Whether the repository is private' },
          language: { type: 'string', description: 'Primary language' },
          has_issues: { type: 'boolean', description: 'Enable issue tracker' },
          has_wiki: { type: 'boolean', description: 'Enable wiki' },
          project_key: { type: 'string', description: 'Project key to add repo to' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • TypeScript interface defining the parameters for create_repository.
    export interface CreateRepositoryParams {
      workspace: string;
      repo_slug: string;
      name?: string;
      description?: string;
      is_private?: boolean;
      language?: string;
      has_issues?: boolean;
      has_wiki?: boolean;
      project_key?: string;
    }

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/Lexmata/bitbucket-mcp'

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