Skip to main content
Glama
ddukbg

GitHub Enterprise MCP Server

unsuspend-user

Reactivate a suspended GitHub Enterprise user by providing their username, enabling full access to repositories, issues, and workflows through the MCP server integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername of the user to unsuspend

Implementation Reference

  • Registration of the MCP tool 'unsuspend-user' including Zod input schema (username: string) and handler function that checks for GitHub Enterprise and calls UserManagement.unsuspendUser
    server.tool( "unsuspend-user", { username: z.string().describe("Username of the user to unsuspend") }, async ({ username }) => { try { if (!context.isGitHubEnterprise) { return { content: [ { type: "text", text: "User unsuspension is only available in GitHub Enterprise. This operation cannot be performed on GitHub.com." } ], isError: true }; } await context.users.unsuspendUser(context.client, { username }); return { content: [ { type: "text", text: `User '${username}' has been unsuspended.` } ] }; } catch (error: any) { console.error('Error unsuspending user:', error); return { content: [ { type: "text", text: `An error occurred while unsuspending user: ${error.message}` } ], isError: true }; } } );
  • Core handler implementation: unsuspendUser method in UserManagement class that performs the axios DELETE request to the GitHub Enterprise admin API endpoint /admin/users/{username}/suspended to unsuspend the user.
    /** * Unsuspend a user in GitHub Enterprise * * @param client - GitHub API client * @param params - Parameters with username to unsuspend * @returns Promise that resolves to true if successful */ async unsuspendUser(client: any, params: UnsuspendUserParams): Promise<boolean> { try { const { baseUrl, token } = client; const { username } = params; if (!username) { throw new Error('Username is required'); } const url = `${baseUrl}/admin/users/${username}/suspended`; await axios.delete(url, { headers: { Authorization: `token ${token}`, Accept: 'application/vnd.github.v3+json' } }); return true; } catch (error: any) { if (error.response?.status === 404) { throw new Error(`User '${params.username}' not found or admin endpoint not available`); } throw new Error(`Failed to unsuspend user: ${error.message}`); } }
  • TypeScript type definition for UnsuspendUserParams interface used as input type for the unsuspendUser function.
    * Parameters to unsuspend a user */ export interface UnsuspendUserParams { /** * Username of the user to unsuspend */ 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