{"modulePath":"github.com/albertywu/github-mcp-server","version":"v0.0.0-20250525234356-0d759da0fd12","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Constants\n\n```go\nconst (\n\tFilterDefault           = \"default\"\n\tFilterIncludeRead       = \"include_read_notifications\"\n\tFilterOnlyParticipating = \"only_participating\"\n)\n```\n\n```go\nconst (\n\tNotificationActionIgnore = \"ignore\"\n\tNotificationActionWatch  = \"watch\"\n\tNotificationActionDelete = \"delete\"\n)\n```\nEnum values for ManageNotificationSubscription action\n\n```go\nconst (\n\tRepositorySubscriptionActionWatch  = \"watch\"\n\tRepositorySubscriptionActionIgnore = \"ignore\"\n\tRepositorySubscriptionActionDelete = \"delete\"\n)\n```\n\n## Variables\n\n```go\nvar DefaultTools = []string{\"all\"}\n```\n\n## Functions\n\n```go\nfunc AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nAddIssueComment creates a tool to add a comment to an issue.\n\n```go\nfunc AddPullRequestReviewCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nAddPullRequestReviewCommentToPendingReview creates a tool to add a comment to a pull request review.\n\n```go\nfunc AssignCopilotToIssue(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\n\n```go\nfunc CreateAndSubmitPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\n\n```go\nfunc CreateBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nCreateBranch creates a tool to create a new branch.\n\n```go\nfunc CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nCreateIssue creates a tool to create a new issue in a GitHub repository.\n\n```go\nfunc CreateOrUpdateFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nCreateOrUpdateFile creates a tool to create or update a file in a GitHub repository.\n\n```go\nfunc CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nCreatePendingPullRequestReview creates a tool to create a pending review on a pull request.\n\n```go\nfunc CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nCreatePullRequest creates a tool to create a new pull request.\n\n```go\nfunc CreateRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nCreateRepository creates a tool to create a new GitHub repository.\n\n```go\nfunc DeleteFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nDeleteFile creates a tool to delete a file in a GitHub repository. This tool uses a more roundabout way of deleting a file than just using the client.Repositories.DeleteFile. This is because REST file deletion endpoint (and client.Repositories.DeleteFile) don't add commit signing to the deletion commit, unlike how the endpoint backing the create\\_or\\_update\\_files tool does. This appears to be a quirk of the API. The approach implemented here gets automatic commit signing when used with either the github-actions user or as an app, both of which suit an LLM well.\n\n```go\nfunc DeletePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\n\n```go\nfunc DismissNotification(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nDismissNotification creates a tool to mark a notification as read/done.\n\n```go\nfunc EnableToolset(s *server.MCPServer, toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nForkRepository creates a tool to fork a repository.\n\n```go\nfunc GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc GetFileContents(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetFileContents creates a tool to get the contents of a file or directory from a GitHub repository.\n\n```go\nfunc GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetIssue creates a tool to get details of a specific issue in a GitHub repository.\n\n```go\nfunc GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetIssueComments creates a tool to get comments for a GitHub issue.\n\n```go\nfunc GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetMe creates a tool to get details of the authenticated user.\n\n```go\nfunc GetNotificationDetails(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetNotificationDetails creates a tool to get details for a specific notification.\n\n```go\nfunc GetPullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nGetPullRequest creates a tool to get details of a specific pull request.\n\n```go\nfunc GetPullRequestComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nGetPullRequestComments creates a tool to get the review comments on a pull request.\n\n```go\nfunc GetPullRequestDiff(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\n\n```go\nfunc GetPullRequestFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nGetPullRequestFiles creates a tool to get the list of files changed in a pull request.\n\n```go\nfunc GetPullRequestReviews(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nGetPullRequestReviews creates a tool to get the reviews on a pull request.\n\n```go\nfunc GetPullRequestStatus(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nGetPullRequestStatus creates a tool to get the combined status of all status checks for a pull request.\n\n```go\nfunc GetRepositoryResourceBranchContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)\n```\nGetRepositoryResourceBranchContent defines the resource template and handler for getting repository content for a branch.\n\n```go\nfunc GetRepositoryResourceCommitContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)\n```\nGetRepositoryResourceCommitContent defines the resource template and handler for getting repository content for a commit.\n\n```go\nfunc GetRepositoryResourceContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)\n```\nGetRepositoryResourceContent defines the resource template and handler for getting repository content.\n\n```go\nfunc GetRepositoryResourcePrContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)\n```\nGetRepositoryResourcePrContent defines the resource template and handler for getting repository content for a pull request.\n\n```go\nfunc GetRepositoryResourceTagContent(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)\n```\nGetRepositoryResourceTagContent defines the resource template and handler for getting repository content for a tag.\n\n```go\nfunc GetSecretScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc GetTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nGetTag creates a tool to get details about a specific tag in a GitHub repository.\n\n```go\nfunc GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc InitContextToolset(getClient GetClientFn, t translations.TranslationHelperFunc) *toolsets.Toolset\n```\n\n```go\nfunc InitDynamicToolset(s *server.MCPServer, tsg *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) *toolsets.Toolset\n```\nInitDynamicToolset creates a dynamic toolset that can be used to enable other toolsets, and so requires the server and toolset group as arguments\n\n```go\nfunc InitToolsets(passedToolsets []string, readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (*toolsets.ToolsetGroup, error)\n```\n\n```go\nfunc ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc ListBranches(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nListBranches creates a tool to list branches in a GitHub repository.\n\n```go\nfunc ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nListCommits creates a tool to get commits of a branch in a repository.\n\n```go\nfunc ListIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nListIssues creates a tool to list and filter repository issues\n\n```go\nfunc ListNotifications(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nListNotifications creates a tool to list notifications for the current user.\n\n```go\nfunc ListPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nListPullRequests creates a tool to list and filter repository pull requests.\n\n```go\nfunc ListSecretScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\n\n```go\nfunc ListTags(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nListTags creates a tool to list tags in a GitHub repository.\n\n```go\nfunc ManageNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nManageNotificationSubscription creates a tool to manage a notification subscription (ignore, watch, delete)\n\n```go\nfunc ManageRepositoryNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nManageRepositoryNotificationSubscription creates a tool to manage a repository notification subscription (ignore, watch, delete)\n\n```go\nfunc MarkAllNotificationsRead(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nMarkAllNotificationsRead creates a tool to mark all notifications as read.\n\n```go\nfunc MergePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nMergePullRequest creates a tool to merge a pull request.\n\n```go\nfunc NewServer(version string, opts ...server.ServerOption) *server.MCPServer\n```\n\n```go\nfunc OptionalIntParam(r mcp.CallToolRequest, p string) (int, error)\n```\nOptionalIntParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, it checks if the parameter is of the expected type and returns it\n\n```go\nfunc OptionalIntParamWithDefault(r mcp.CallToolRequest, p string, d int) (int, error)\n```\nOptionalIntParamWithDefault is a helper function that can be used to fetch a requested parameter from the request similar to optionalIntParam, but it also takes a default value.\n\n```go\nfunc OptionalParam[T any](r mcp.CallToolRequest, p string) (T, error)\n```\nOptionalParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, it checks if the parameter is of the expected type and returns it\n\n```go\nfunc OptionalParamOK[T any](r mcp.CallToolRequest, p string) (value T, ok bool, err error)\n```\nOptionalParamOK is a helper function that can be used to fetch a requested parameter from the request. It returns the value, a boolean indicating if the parameter was present, and an error if the type is wrong.\n\n```go\nfunc OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)\n```\nOptionalStringArrayParam is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request, if not, it returns its zero-value 2. If it is present, iterates the elements and checks each is a string\n\n```go\nfunc PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nPushFiles creates a tool to push multiple files in a single commit to a GitHub repository.\n\n```go\nfunc RegisterResources(s *server.MCPServer, getClient GetClientFn, t translations.TranslationHelperFunc)\n```\n\n```go\nfunc RepositoryResourceContentsHandler(getClient GetClientFn) func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)\n```\nRepositoryResourceContentsHandler returns a handler function for repository content requests.\n\n```go\nfunc RequestCopilotReview(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nRequestCopilotReview creates a tool to request a Copilot review for a pull request. Note that this tool will not work on GHES where this feature is unsupported. In future, we should not expose this tool if the configured host does not support it.\n\n```go\nfunc RequiredInt(r mcp.CallToolRequest, p string) (int, error)\n```\nRequiredInt is a helper function that can be used to fetch a requested parameter from the request. It does the following checks: 1. Checks if the parameter is present in the request. 2. Checks if the parameter is of the expected type. 3. Checks if the parameter is not empty, i.e: non-zero value\n\n```go\nfunc SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nSearchCode creates a tool to search for code across GitHub repositories.\n\n```go\nfunc SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nSearchIssues creates a tool to search for issues and pull requests.\n\n```go\nfunc SearchRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nSearchRepositories creates a tool to search for GitHub repositories.\n\n```go\nfunc SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nSearchUsers creates a tool to search for GitHub users.\n\n```go\nfunc SubmitPendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nSubmitPendingPullRequestReview creates a tool to submit a pull request review.\n\n```go\nfunc ToolsetEnum(toolsetGroup *toolsets.ToolsetGroup) mcp.PropertyOption\n```\n\n```go\nfunc UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)\n```\nUpdateIssue creates a tool to update an existing issue in a GitHub repository.\n\n```go\nfunc UpdatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nUpdatePullRequest creates a tool to update an existing pull request.\n\n```go\nfunc UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)\n```\nUpdatePullRequestBranch creates a tool to update a pull request branch with the latest changes from the base branch.\n\n```go\nfunc WithPagination() mcp.ToolOption\n```\nWithPagination returns a ToolOption that adds \"page\" and \"perPage\" parameters to the tool. The \"page\" parameter is optional, min 1. The \"perPage\" parameter is optional, min 1, max 100.\n\n## Types\n\n```go\ntype GetClientFn func(context.Context) (*github.Client, error)\n```\n\n```go\ntype GetGQLClientFn func(context.Context) (*githubv4.Client, error)\n```\n\n```go\ntype PaginationParams struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc OptionalPaginationParams(r mcp.CallToolRequest) (PaginationParams, error)\n```\nOptionalPaginationParams returns the \"page\" and \"perPage\" parameters from the request, or their default values if not present, \"page\" default is 1, \"perPage\" default is 30. In future, we may want to make the default values configurable, or even have this function returned from \\`withPagination\\`, where the defaults are provided alongside the min/max values.\n\n```go\ntype ReplaceActorsForAssignableInput struct {\n\tAssignableID githubv4.ID   `json:\"assignableId\"`\n\tActorIDs     []githubv4.ID `json:\"actorIds\"`\n}\n```\n\n","path":"github.com/albertywu/github-mcp-server/pkg/github","name":"github","synopsis":"","isRedistributable":true}
