Skip to main content
Glama

create_repository

Create a new GitHub repository with specified name, description, visibility, and README initialization directly through the GitHub MCP Server interface.

Instructions

Create a new GitHub repository in your account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoInitNoInitialize with README.md
descriptionNoRepository description
nameYesRepository name
privateNoWhether the repository should be private

Implementation Reference

  • The main handler function that executes the tool logic by making a POST request to GitHub's /user/repos endpoint with the provided options and parsing the response.
    export async function createRepository(options: CreateRepositoryOptions) { const response = await githubRequest("https://api.github.com/user/repos", { method: "POST", body: options, }); return GitHubRepositorySchema.parse(response); }
  • Zod schema defining the input parameters for the create_repository tool.
    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:80-84 (registration)
    Registration of the tool in the MCP server's listTools handler, including name, description, and input schema.
    { name: "create_repository", description: "Create a new GitHub repository in your account", inputSchema: zodToJsonSchema(repository.CreateRepositoryOptionsSchema), },
  • Dispatch handler in the CallToolRequestSchema that validates arguments and calls the 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) }], }; }

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/tuanle96/mcp-github'

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