create_repository
Create a new repository in a Bitbucket Cloud workspace to organize and manage code projects with customizable settings for privacy, language, and features.
Instructions
Create a new repository in the specified workspace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| name | No | Repository name | |
| description | No | Repository description | |
| is_private | No | Whether the repository is private | |
| language | No | Primary language | |
| has_issues | No | Enable issue tracker | |
| has_wiki | No | Enable wiki | |
| project_key | No | Project key to add repo to |
Implementation Reference
- src/tools/index.ts:910-913 (handler)MCP tool handler case for 'create_repository': parses arguments with Zod schema and calls RepositoriesAPI.create to execute the tool.case 'create_repository': { const params = toolSchemas.create_repository.parse(args); return this.repos.create(params); }
- src/api/repositories.ts:35-38 (handler)Executes the repository creation by sending a POST request to Bitbucket API endpoint `/repositories/{workspace}/{repo_slug}` with the provided parameters.async create(params: CreateRepositoryParams): Promise<BitbucketRepository> { const { workspace, repo_slug, ...body } = params; return this.client.post<BitbucketRepository>(`/repositories/${workspace}/${repo_slug}`, body); }
- src/tools/index.ts:28-38 (schema)Zod schema definition for validating input parameters of the create_repository tool.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'), }),
- src/tools/index.ts:342-360 (registration)Registers the create_repository tool in the toolDefinitions array for MCP, including name, description, and JSON schema for inputs.{ 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'], }, },
- src/types/index.ts:271-281 (schema)TypeScript interface defining the parameters for creating a repository, used in RepositoriesAPI.create.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; }