Skip to main content
Glama
ddukbg

GitHub Enterprise MCP Server

create-user

Facilitates the creation of GitHub Enterprise user accounts by defining essential attributes like username, email, and bio through an integrated MCP server interface.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bioNoBiography for the user
blogNoURL of the user's blog or website
companyNoCompany for the user
emailYesThe email address for the user
locationNoLocation for the user
loginYesThe username for the user
nameNoFull name for the user
twitter_usernameNoTwitter username for the user

Implementation Reference

  • Registration of the MCP 'create-user' tool, including Zod input schema validation and execution handler that checks for GitHub Enterprise and delegates to UserManagement.createUser
    "create-user", { login: z.string().describe("The username for the user"), email: z.string().describe("The email address for the user"), name: z.string().optional().describe("Full name for the user"), company: z.string().optional().describe("Company for the user"), location: z.string().optional().describe("Location for the user"), bio: z.string().optional().describe("Biography for the user"), blog: z.string().optional().describe("URL of the user's blog or website"), twitter_username: z.string().optional().describe("Twitter username for the user") }, async ({ login, email, name, company, location, bio, blog, twitter_username }) => { try { if (!context.isGitHubEnterprise) { return { content: [ { type: "text", text: "User creation is only available in GitHub Enterprise. This operation cannot be performed on GitHub.com." } ], isError: true }; } const user = await context.users.createUser(context.client, { login, email, name, company, location, bio, blog, twitter_username }); return { content: [ { type: "text", text: `User '${login}' successfully created:\n\n${JSON.stringify(user, null, 2)}` } ] }; } catch (error: any) { console.error('Error creating user:', error); return { content: [ { type: "text", text: `An error occurred while creating user: ${error.message}` } ], isError: true }; } } );
  • Core implementation of user creation via GitHub Enterprise Admin API POST to /admin/users, called by the MCP tool handler
    async createUser(client: any, params: CreateUserParams): Promise<User> { try { const { baseUrl, token } = client; if (!params.login || !params.email) { throw new Error('Username (login) and email are required'); } const url = `${baseUrl}/admin/users`; const response = await axios.post(url, params, { headers: { Authorization: `token ${token}`, Accept: 'application/vnd.github.v3+json', 'Content-Type': 'application/json' } }); return response.data; } catch (error: any) { if (error.response?.status === 404) { throw new Error('User creation endpoint not found. Make sure you have admin permissions and are using GitHub Enterprise.'); } else if (error.response?.status === 422) { throw new Error(`Validation failed: ${error.response.data.message || 'Check the username and email format'}`); } throw new Error(`Failed to create user: ${error.message}`); } }
  • TypeScript interface defining parameters for creating a user, matching the MCP tool inputs and used in the createUser helper
    export interface CreateUserParams { /** * The username for the user */ login: string; /** * The email address for the user */ email: string; /** * Optional full name for the user */ name?: string; /** * Optional company for the user */ company?: string; /** * Optional location for the user */ location?: string; /** * Optional biography for the user */ bio?: string; /** * Optional URL of the user's blog or website */ blog?: string; /** * Optional Twitter username for the user */ twitter_username?: 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/ddukbg/github-enterprise-mcp'

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