Skip to main content
Glama
ddukbg

GitHub Enterprise MCP Server

update-repository

Modify GitHub Enterprise repository settings including description, privacy, default branch, and feature toggles for issues, projects, wiki, and archive status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
descriptionNoNew description
privateNoChange privacy setting
default_branchNoChange default branch
has_issuesNoEnable/disable issues
has_projectsNoEnable/disable projects
has_wikiNoEnable/disable wiki
archivedNoArchive/unarchive repository

Implementation Reference

  • Main MCP tool handler for 'update-repository': validates parameters owner/repo, calls underlying RepositoryAPI.updateRepository, formats and returns the updated repository info or error.
    async ({ owner, repo, ...options }) => { try { // Parameter validation if (!owner || typeof owner !== 'string' || owner.trim() === '') { return { content: [ { type: "text", text: "Repository owner is required." } ] }; } if (!repo || typeof repo !== 'string' || repo.trim() === '') { return { content: [ { type: "text", text: "Repository name is required." } ] }; } const repository = await context.repository.updateRepository(owner, repo, options); const formattedRepo = formatRepository(repository); return { content: [ { type: "text", text: `Successfully updated repository: ${formattedRepo.full_name}\n\n${JSON.stringify(formattedRepo, null, 2)}` } ] }; } catch (error: any) { return { content: [ { type: "text", text: `Error updating repository: ${error.message}` } ] }; } }
  • MCP server registration of the 'update-repository' tool with input schema and handler reference
    server.tool( "update-repository", { owner: z.string().min(1).describe("Repository owner"), repo: z.string().min(1).describe("Repository name"), description: z.string().optional().describe("New description"), private: z.boolean().optional().describe("Change privacy setting"), default_branch: z.string().optional().describe("Change default branch"), has_issues: z.boolean().optional().describe("Enable/disable issues"), has_projects: z.boolean().optional().describe("Enable/disable projects"), has_wiki: z.boolean().optional().describe("Enable/disable wiki"), archived: z.boolean().optional().describe("Archive/unarchive repository") }, async ({ owner, repo, ...options }) => { try { // Parameter validation if (!owner || typeof owner !== 'string' || owner.trim() === '') { return { content: [ { type: "text", text: "Repository owner is required." } ] }; } if (!repo || typeof repo !== 'string' || repo.trim() === '') { return { content: [ { type: "text", text: "Repository name is required." } ] }; } const repository = await context.repository.updateRepository(owner, repo, options); const formattedRepo = formatRepository(repository); return { content: [ { type: "text", text: `Successfully updated repository: ${formattedRepo.full_name}\n\n${JSON.stringify(formattedRepo, null, 2)}` } ] }; } catch (error: any) { return { content: [ { type: "text", text: `Error updating repository: ${error.message}` } ] }; } } );
  • Input schema (zod) for the update-repository MCP tool defining parameters like owner, repo, description, private, etc.
    { owner: z.string().min(1).describe("Repository owner"), repo: z.string().min(1).describe("Repository name"), description: z.string().optional().describe("New description"), private: z.boolean().optional().describe("Change privacy setting"), default_branch: z.string().optional().describe("Change default branch"), has_issues: z.boolean().optional().describe("Enable/disable issues"), has_projects: z.boolean().optional().describe("Enable/disable projects"), has_wiki: z.boolean().optional().describe("Enable/disable wiki"), archived: z.boolean().optional().describe("Archive/unarchive repository") },
  • Underlying GitHub API handler in RepositoryAPI class: performs PATCH request to update repository settings.
    /** * Update repository */ async updateRepository(owner: string, repo: string, options: UpdateRepoOptions): Promise<GitHubRepository> { return this.client.patch<GitHubRepository>(`repos/${owner}/${repo}`, options); }
  • TypeScript interface defining options for repository update (UpdateRepoOptions) used by the API handler.
    export interface UpdateRepoOptions { name?: string; description?: string; homepage?: string; private?: boolean; visibility?: 'public' | 'private' | 'internal'; has_issues?: boolean; has_projects?: boolean; has_wiki?: boolean; has_downloads?: boolean; has_discussions?: boolean; default_branch?: string; allow_squash_merge?: boolean; allow_merge_commit?: boolean; allow_rebase_merge?: boolean; allow_auto_merge?: boolean; delete_branch_on_merge?: boolean; archived?: boolean; }

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

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