create_repository
Set up a new GitHub repository with customizable options like name, description, privacy settings, and README initialization using the GitHub MCP Server Plus.
Instructions
Create a new GitHub repository in your account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autoInit | No | Initialize with README.md | |
| description | No | Repository description | |
| name | Yes | Repository name | |
| private | No | Whether the repository should be private |
Implementation Reference
- operations/repository.ts:29-35 (handler)The main handler function that creates a new GitHub repository by making a POST request to the GitHub API /user/repos endpoint.export async function createRepository(options: CreateRepositoryOptions) { const response = await githubRequest("https://api.github.com/user/repos", { method: "POST", body: options, }); return GitHubRepositorySchema.parse(response); }
- operations/repository.ts:6-11 (schema)Zod schema defining the input options for creating a repository (name, description, private, autoInit).export const CreateRepositoryOptionsSchema = z.object({ name: z.string().describe("Repository name"), description: z.string().optional().describe("Repository description"), private: z.boolean().optional().describe("Whether the repository should be private"), autoInit: z.boolean().optional().describe("Initialize with README.md"), });
- index.ts:78-82 (registration)Registers the 'create_repository' tool in the MCP server's list of available tools, including name, description, and input schema.{ name: "create_repository", description: "Create a new GitHub repository in your account", inputSchema: zodToJsonSchema(repository.CreateRepositoryOptionsSchema), },
- index.ts:202-208 (handler)Dispatcher in the MCP CallToolRequestHandler that parses input arguments and calls the actual createRepository function.case "create_repository": { const args = repository.CreateRepositoryOptionsSchema.parse(request.params.arguments); const result = await repository.createRepository(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }