github

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DescriptionRepositoryOwner = "Repository owner"
	DescriptionRepositoryName  = "Repository name"
)
View Source
const (
	FilterDefault           = "default"
	FilterIncludeRead       = "include_read_notifications"
	FilterOnlyParticipating = "only_participating"
)
View Source
const (
	NotificationActionIgnore = "ignore"
	NotificationActionWatch  = "watch"
	NotificationActionDelete = "delete"
)

Enum values for ManageNotificationSubscription action

View Source
const (
	RepositorySubscriptionActionWatch  = "watch"
	RepositorySubscriptionActionIgnore = "ignore"
	RepositorySubscriptionActionDelete = "delete"
)
View Source
const DefaultGraphQLPageSize = 30

Variables

View Source
var DefaultTools = []string{"all"}

Functions

func AddCommentToPendingReview added in v0.8.0

func AddCommentToPendingReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

AddCommentToPendingReview creates a tool to add a comment to a pull request review.

func AddIssueComment added in v0.2.0

func AddIssueComment(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

AddIssueComment creates a tool to add a comment to an issue.

func AddSubIssue added in v0.9.0

func AddSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

AddSubIssue creates a tool to add a sub-issue to a parent issue.

func AssignCodingAgentPrompt added in v0.6.0

func AssignCodingAgentPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt, handler server.PromptHandlerFunc)

func AssignCopilotToIssue added in v0.4.0

func AssignCopilotToIssue(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

func CancelWorkflowRun added in v0.6.0

func CancelWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CancelWorkflowRun creates a tool to cancel a workflow run

func CreateAndSubmitPullRequestReview added in v0.4.0

func CreateAndSubmitPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

func CreateBranch added in v0.2.0

func CreateBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CreateBranch creates a tool to create a new branch.

func CreateGist added in v0.10.0

func CreateGist(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CreateGist creates a tool to create a new gist

func CreateIssue added in v0.2.0

func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CreateIssue creates a tool to create a new issue in a GitHub repository.

func CreateOrUpdateFile added in v0.2.0

func CreateOrUpdateFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CreateOrUpdateFile creates a tool to create or update a file in a GitHub repository.

func CreatePendingPullRequestReview added in v0.4.0

func CreatePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

CreatePendingPullRequestReview creates a tool to create a pending review on a pull request.

func CreatePullRequest added in v0.2.0

func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

CreatePullRequest creates a tool to create a new pull request.

func CreateRepository added in v0.2.0

func CreateRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

CreateRepository creates a tool to create a new GitHub repository.

func DefaultToolsetGroup added in v0.5.0

func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc, contentWindowSize int) *toolsets.ToolsetGroup

func DeleteFile added in v0.3.0

func DeleteFile(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

DeleteFile 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.

func DeletePendingPullRequestReview added in v0.4.0

func DeletePendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

func DeleteWorkflowRunLogs added in v0.6.0

func DeleteWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

DeleteWorkflowRunLogs creates a tool to delete logs for a workflow run

func DismissNotification added in v0.4.0

func DismissNotification(getclient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

DismissNotification creates a tool to mark a notification as read/done.

func DownloadWorkflowRunArtifact added in v0.6.0

func DownloadWorkflowRunArtifact(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

DownloadWorkflowRunArtifact creates a tool to download a workflow run artifact

func EnableToolset added in v0.2.0

func EnableToolset(s *server.MCPServer, toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ForkRepository added in v0.2.0

func ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ForkRepository creates a tool to fork a repository.

func GenerateInstructions added in v0.16.0

func GenerateInstructions(enabledToolsets []string) string

GenerateInstructions creates server instructions based on enabled toolsets

func GetCodeScanningAlert added in v0.2.0

func GetCodeScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetCommit added in v0.2.0

func GetCommit(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetDependabotAlert added in v0.7.0

func GetDependabotAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetDiscussion added in v0.7.0

func GetDiscussion(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetDiscussionComments added in v0.7.0

func GetDiscussionComments(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetFileContents added in v0.2.0

func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetFileContents creates a tool to get the contents of a file or directory from a GitHub repository.

func GetGlobalSecurityAdvisory added in v0.13.0

func GetGlobalSecurityAdvisory(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetIssue added in v0.2.0

func GetIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetIssue creates a tool to get details of a specific issue in a GitHub repository.

func GetIssueComments added in v0.2.0

func GetIssueComments(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetIssueComments creates a tool to get comments for a GitHub issue.

func GetJobLogs added in v0.6.0

func GetJobLogs(getClient GetClientFn, t translations.TranslationHelperFunc, contentWindowSize int) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetJobLogs creates a tool to download logs for a specific workflow job or efficiently get all failed job logs for a workflow run

func GetLatestRelease added in v0.12.0

func GetLatestRelease(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetLatestRelease creates a tool to get the latest release in a GitHub repository.

func GetMe added in v0.2.0

GetMe creates a tool to get details of the authenticated user.

func GetNotificationDetails added in v0.4.0

func GetNotificationDetails(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetNotificationDetails creates a tool to get details for a specific notification.

func GetProject added in v0.16.0

func GetProject(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetPullRequest added in v0.2.0

GetPullRequest creates a tool to get details of a specific pull request.

func GetPullRequestDiff added in v0.4.0

func GetPullRequestDiff(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

func GetPullRequestFiles added in v0.2.0

func GetPullRequestFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

GetPullRequestFiles creates a tool to get the list of files changed in a pull request.

func GetPullRequestReviewComments added in v0.15.0

func GetPullRequestReviewComments(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

GetPullRequestReviewComments creates a tool to get the review comments on a pull request.

func GetPullRequestReviews added in v0.2.0

func GetPullRequestReviews(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

GetPullRequestReviews creates a tool to get the reviews on a pull request.

func GetPullRequestStatus added in v0.2.0

func GetPullRequestStatus(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

GetPullRequestStatus creates a tool to get the combined status of all status checks for a pull request.

func GetReleaseByTag added in v0.13.0

func GetReleaseByTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetRepositoryResourceBranchContent added in v0.2.0

func GetRepositoryResourceBranchContent(getClient GetClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)

GetRepositoryResourceBranchContent defines the resource template and handler for getting repository content for a branch.

func GetRepositoryResourceCommitContent added in v0.2.0

func GetRepositoryResourceCommitContent(getClient GetClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)

GetRepositoryResourceCommitContent defines the resource template and handler for getting repository content for a commit.

func GetRepositoryResourceContent added in v0.2.0

GetRepositoryResourceContent defines the resource template and handler for getting repository content.

func GetRepositoryResourcePrContent added in v0.2.0

func GetRepositoryResourcePrContent(getClient GetClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)

GetRepositoryResourcePrContent defines the resource template and handler for getting repository content for a pull request.

func GetRepositoryResourceTagContent added in v0.2.0

func GetRepositoryResourceTagContent(getClient GetClientFn, getRawClient raw.GetRawClientFn, t translations.TranslationHelperFunc) (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc)

GetRepositoryResourceTagContent defines the resource template and handler for getting repository content for a tag.

func GetSecretScanningAlert added in v0.2.0

func GetSecretScanningAlert(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetTag added in v0.3.0

func GetTag(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetTag creates a tool to get details about a specific tag in a GitHub repository.

func GetTeamMembers added in v0.12.0

func GetTeams added in v0.12.0

func GetToolsetsTools added in v0.2.0

func GetToolsetsTools(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func GetWorkflowRun added in v0.6.0

func GetWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetWorkflowRun creates a tool to get details of a specific workflow run

func GetWorkflowRunLogs added in v0.6.0

func GetWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetWorkflowRunLogs creates a tool to download logs for a specific workflow run

func GetWorkflowRunUsage added in v0.6.0

func GetWorkflowRunUsage(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

GetWorkflowRunUsage creates a tool to get usage metrics for a workflow run

func InitDynamicToolset added in v0.2.0

InitDynamicToolset creates a dynamic toolset that can be used to enable other toolsets, and so requires the server and toolset group as arguments

func IssueToFixWorkflowPrompt added in v0.10.0

func IssueToFixWorkflowPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt, handler server.PromptHandlerFunc)

IssueToFixWorkflowPrompt provides a guided workflow for creating an issue and then generating a PR to fix it

func ListAvailableToolsets added in v0.2.0

func ListAvailableToolsets(toolsetGroup *toolsets.ToolsetGroup, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListBranches added in v0.2.0

func ListBranches(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListBranches creates a tool to list branches in a GitHub repository.

func ListCodeScanningAlerts added in v0.2.0

func ListCodeScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListCommits added in v0.2.0

func ListCommits(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListCommits creates a tool to get commits of a branch in a repository.

func ListDependabotAlerts added in v0.7.0

func ListDependabotAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListDiscussionCategories added in v0.7.0

func ListDiscussionCategories(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListDiscussions added in v0.7.0

func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListGists added in v0.10.0

func ListGists(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListGists creates a tool to list gists for a user

func ListGlobalSecurityAdvisories added in v0.13.0

func ListGlobalSecurityAdvisories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListIssueTypes added in v0.12.0

func ListIssueTypes(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListIssueTypes creates a tool to list defined issue types for an organization. This can be used to understand supported issue type values for creating or updating issues.

func ListIssues added in v0.2.0

func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListIssues creates a tool to list and filter repository issues

func ListNotifications added in v0.4.0

func ListNotifications(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListNotifications creates a tool to list notifications for the current user.

func ListOrgRepositorySecurityAdvisories added in v0.13.0

func ListOrgRepositorySecurityAdvisories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListProjectFields added in v0.16.0

func ListProjectFields(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListProjects added in v0.16.0

func ListProjects(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListPullRequests added in v0.2.0

ListPullRequests creates a tool to list and filter repository pull requests.

func ListReleases added in v0.12.0

func ListReleases(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListReleases creates a tool to list releases in a GitHub repository.

func ListRepositorySecurityAdvisories added in v0.13.0

func ListRepositorySecurityAdvisories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListSecretScanningAlerts added in v0.2.0

func ListSecretScanningAlerts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

func ListStarredRepositories added in v0.16.0

func ListStarredRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListStarredRepositories creates a tool to list starred repositories for the authenticated user or a specified user.

func ListSubIssues added in v0.9.0

func ListSubIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListSubIssues creates a tool to list sub-issues for a GitHub issue.

func ListTags added in v0.3.0

func ListTags(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListTags creates a tool to list tags in a GitHub repository.

func ListWorkflowJobs added in v0.6.0

func ListWorkflowJobs(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListWorkflowJobs creates a tool to list jobs for a specific workflow run

func ListWorkflowRunArtifacts added in v0.6.0

func ListWorkflowRunArtifacts(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListWorkflowRunArtifacts creates a tool to list artifacts for a workflow run

func ListWorkflowRuns added in v0.6.0

func ListWorkflowRuns(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListWorkflowRuns creates a tool to list workflow runs for a specific workflow

func ListWorkflows added in v0.6.0

func ListWorkflows(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ListWorkflows creates a tool to list workflows in a repository

func ManageNotificationSubscription added in v0.4.0

func ManageNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ManageNotificationSubscription creates a tool to manage a notification subscription (ignore, watch, delete)

func ManageRepositoryNotificationSubscription added in v0.4.0

func ManageRepositoryNotificationSubscription(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ManageRepositoryNotificationSubscription creates a tool to manage a repository notification subscription (ignore, watch, delete)

func MarkAllNotificationsRead added in v0.4.0

func MarkAllNotificationsRead(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

MarkAllNotificationsRead creates a tool to mark all notifications as read.

func MarshalledTextResult added in v0.5.0

func MarshalledTextResult(v any) *mcp.CallToolResult

func MergePullRequest added in v0.2.0

MergePullRequest creates a tool to merge a pull request.

func NewServer

func NewServer(version string, opts ...server.ServerOption) *server.MCPServer

func OptionalBoolParamWithDefault added in v0.14.0

func OptionalBoolParamWithDefault(r mcp.CallToolRequest, p string, d bool) (bool, error)

OptionalBoolParamWithDefault is a helper function that can be used to fetch a requested parameter from the request similar to optionalBoolParam, but it also takes a default value.

func OptionalIntParam added in v0.2.0

func OptionalIntParam(r mcp.CallToolRequest, p string) (int, error)

OptionalIntParam 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

func OptionalIntParamWithDefault added in v0.2.0

func OptionalIntParamWithDefault(r mcp.CallToolRequest, p string, d int) (int, error)

OptionalIntParamWithDefault 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.

func OptionalParam added in v0.2.0

func OptionalParam[T any](r mcp.CallToolRequest, p string) (T, error)

OptionalParam 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

func OptionalParamOK added in v0.2.0

func OptionalParamOK[T any](r mcp.CallToolRequest, p string) (value T, ok bool, err error)

OptionalParamOK 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.

func OptionalStringArrayParam added in v0.2.0

func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)

OptionalStringArrayParam 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

func PushFiles added in v0.2.0

func PushFiles(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

PushFiles creates a tool to push multiple files in a single commit to a GitHub repository.

func RemoveSubIssue added in v0.9.0

func RemoveSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

RemoveSubIssue creates a tool to remove a sub-issue from a parent issue. Unlike other sub-issue tools, this currently uses a direct HTTP DELETE request because of a bug in the go-github library. Once the fix is released, this can be updated to use the library method. See: https://github.com/google/go-github/pull/3613

func RepositoryResourceContentsHandler added in v0.2.0

func RepositoryResourceContentsHandler(getClient GetClientFn, getRawClient raw.GetRawClientFn) func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

RepositoryResourceContentsHandler returns a handler function for repository content requests.

func ReprioritizeSubIssue added in v0.9.0

func ReprioritizeSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

ReprioritizeSubIssue creates a tool to reprioritize a sub-issue to a different position in the parent list.

func RequestCopilotReview added in v0.3.0

func RequestCopilotReview(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

RequestCopilotReview 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.

func RequiredInt added in v0.2.0

func RequiredInt(r mcp.CallToolRequest, p string) (int, error)

RequiredInt 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

func RequiredParam added in v0.5.0

func RequiredParam[T comparable](r mcp.CallToolRequest, p string) (T, error)

RequiredParam 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

func RerunFailedJobs added in v0.6.0

func RerunFailedJobs(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

RerunFailedJobs creates a tool to re-run only the failed jobs in a workflow run

func RerunWorkflowRun added in v0.6.0

func RerunWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

RerunWorkflowRun creates a tool to re-run an entire workflow run

func RunWorkflow added in v0.6.0

func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

RunWorkflow creates a tool to run an Actions workflow

func SearchCode added in v0.2.0

func SearchCode(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchCode creates a tool to search for code across GitHub repositories.

func SearchIssues added in v0.2.0

func SearchIssues(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchIssues creates a tool to search for issues.

func SearchOrgs added in v0.6.0

func SearchOrgs(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchOrgs creates a tool to search for GitHub organizations.

func SearchPullRequests added in v0.6.0

func SearchPullRequests(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchPullRequests creates a tool to search for pull requests.

func SearchRepositories added in v0.2.0

func SearchRepositories(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchRepositories creates a tool to search for GitHub repositories.

func SearchUsers added in v0.2.0

func SearchUsers(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

SearchUsers creates a tool to search for GitHub users.

func StarRepository added in v0.16.0

func StarRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

StarRepository creates a tool to star a repository.

func SubmitPendingPullRequestReview added in v0.4.0

func SubmitPendingPullRequestReview(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

SubmitPendingPullRequestReview creates a tool to submit a pull request review.

func ToBoolPtr added in v0.5.0

func ToBoolPtr(b bool) *bool

ToBoolPtr converts a bool to a *bool pointer.

func ToStringPtr added in v0.7.0

func ToStringPtr(s string) *string

ToStringPtr converts a string to a *string pointer. Returns nil if the string is empty.

func ToolsetEnum added in v0.2.0

func ToolsetEnum(toolsetGroup *toolsets.ToolsetGroup) mcp.PropertyOption

func UnstarRepository added in v0.16.0

func UnstarRepository(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

UnstarRepository creates a tool to unstar a repository.

func UpdateGist added in v0.10.0

func UpdateGist(getClient GetClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

UpdateGist creates a tool to edit an existing gist

func UpdateIssue added in v0.2.0

func UpdateIssue(getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc)

UpdateIssue creates a tool to update an existing issue in a GitHub repository.

func UpdatePullRequest added in v0.2.0

func UpdatePullRequest(getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

UpdatePullRequest creates a tool to update an existing pull request.

func UpdatePullRequestBranch added in v0.2.0

func UpdatePullRequestBranch(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc)

UpdatePullRequestBranch creates a tool to update a pull request branch with the latest changes from the base branch.

func WithCursorPagination added in v0.9.0

func WithCursorPagination() mcp.ToolOption

WithCursorPagination adds only cursor-based pagination parameters to a tool (no page parameter).

func WithPagination added in v0.2.0

func WithPagination() mcp.ToolOption

WithPagination adds REST API pagination parameters to a tool. https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api

func WithUnifiedPagination added in v0.9.0

func WithUnifiedPagination() mcp.ToolOption

WithUnifiedPagination adds REST API pagination parameters to a tool. GraphQL tools will use this and convert page/perPage to GraphQL cursor parameters internally.

Types

type BasicNoOrder added in v0.9.0

type BasicNoOrder struct {
	Repository struct {
		Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after)"`
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

func (*BasicNoOrder) GetDiscussionFragment added in v0.9.0

func (q *BasicNoOrder) GetDiscussionFragment() DiscussionFragment

Implement the interface for all query types

type BasicWithOrder added in v0.9.0

type BasicWithOrder struct {
	Repository struct {
		Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after, orderBy: { field: $orderByField, direction: $orderByDirection })"`
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

func (*BasicWithOrder) GetDiscussionFragment added in v0.9.0

func (q *BasicWithOrder) GetDiscussionFragment() DiscussionFragment

type CloseIssueInput added in v0.15.0

type CloseIssueInput struct {
	IssueID          githubv4.ID             `json:"issueId"`
	ClientMutationID *githubv4.String        `json:"clientMutationId,omitempty"`
	StateReason      *IssueClosedStateReason `json:"stateReason,omitempty"`
	DuplicateIssueID *githubv4.ID            `json:"duplicateIssueId,omitempty"`
}

CloseIssueInput represents the input for closing an issue via the GraphQL API. Used to extend the functionality of the githubv4 library to support closing issues as duplicates.

type CursorPaginationParams added in v0.9.0

type CursorPaginationParams struct {
	PerPage int
	After   string
}

func OptionalCursorPaginationParams added in v0.9.0

func OptionalCursorPaginationParams(r mcp.CallToolRequest) (CursorPaginationParams, error)

OptionalCursorPaginationParams returns the "perPage" and "after" parameters from the request, without the "page" parameter, suitable for cursor-based pagination only.

func (CursorPaginationParams) ToGraphQLParams added in v0.9.0

func (p CursorPaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error)

ToGraphQLParams converts cursor pagination parameters to GraphQL-specific parameters.

type DiscussionFragment added in v0.9.0

type DiscussionFragment struct {
	Nodes      []NodeFragment
	PageInfo   PageInfoFragment
	TotalCount githubv4.Int
}

type DiscussionQueryResult added in v0.9.0

type DiscussionQueryResult interface {
	GetDiscussionFragment() DiscussionFragment
}

Common interface for all discussion query types

type GetClientFn added in v0.2.0

type GetClientFn func(context.Context) (*github.Client, error)

type GetGQLClientFn added in v0.4.0

type GetGQLClientFn func(context.Context) (*githubv4.Client, error)

type GraphQLPaginationParams added in v0.9.0

type GraphQLPaginationParams struct {
	First *int32
	After *string
}

type IssueClosedStateReason added in v0.15.0

type IssueClosedStateReason string

IssueClosedStateReason represents the reason an issue was closed. Used to extend the functionality of the githubv4 library to support closing issues as duplicates.

const (
	IssueClosedStateReasonCompleted  IssueClosedStateReason = "COMPLETED"
	IssueClosedStateReasonDuplicate  IssueClosedStateReason = "DUPLICATE"
	IssueClosedStateReasonNotPlanned IssueClosedStateReason = "NOT_PLANNED"
)

type IssueFragment added in v0.11.0

type IssueFragment struct {
	Number     githubv4.Int
	Title      githubv4.String
	Body       githubv4.String
	State      githubv4.String
	DatabaseID int64

	Author struct {
		Login githubv4.String
	}
	CreatedAt githubv4.DateTime
	UpdatedAt githubv4.DateTime
	Labels    struct {
		Nodes []struct {
			Name        githubv4.String
			ID          githubv4.String
			Description githubv4.String
		}
	} `graphql:"labels(first: 100)"`
	Comments struct {
		TotalCount githubv4.Int
	} `graphql:"comments"`
}

IssueFragment represents a fragment of an issue node in the GraphQL API.

type IssueQueryFragment added in v0.11.0

type IssueQueryFragment struct {
	Nodes    []IssueFragment `graphql:"nodes"`
	PageInfo struct {
		HasNextPage     githubv4.Boolean
		HasPreviousPage githubv4.Boolean
		StartCursor     githubv4.String
		EndCursor       githubv4.String
	}
	TotalCount int
}

type IssueQueryResult added in v0.11.0

type IssueQueryResult interface {
	GetIssueFragment() IssueQueryFragment
}

Common interface for all issue query types

type ListIssuesQuery added in v0.11.0

type ListIssuesQuery struct {
	Repository struct {
		Issues IssueQueryFragment `graphql:"issues(first: $first, after: $after, states: $states, orderBy: {field: $orderBy, direction: $direction})"`
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

ListIssuesQuery is the root query structure for fetching issues with optional label filtering.

func (*ListIssuesQuery) GetIssueFragment added in v0.11.0

func (q *ListIssuesQuery) GetIssueFragment() IssueQueryFragment

type ListIssuesQueryTypeWithLabels added in v0.11.0

type ListIssuesQueryTypeWithLabels struct {
	Repository struct {
		Issues IssueQueryFragment `` /* 131-byte string literal not displayed */
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

ListIssuesQueryTypeWithLabels is the query structure for fetching issues with optional label filtering.

func (*ListIssuesQueryTypeWithLabels) GetIssueFragment added in v0.11.0

func (q *ListIssuesQueryTypeWithLabels) GetIssueFragment() IssueQueryFragment

Implement the interface for all query types

type ListIssuesQueryTypeWithLabelsWithSince added in v0.11.0

type ListIssuesQueryTypeWithLabelsWithSince struct {
	Repository struct {
		Issues IssueQueryFragment `` /* 158-byte string literal not displayed */
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

ListIssuesQueryTypeWithLabelsWithSince is the query structure for fetching issues with both label and since filtering.

func (*ListIssuesQueryTypeWithLabelsWithSince) GetIssueFragment added in v0.11.0

type ListIssuesQueryWithSince added in v0.11.0

type ListIssuesQueryWithSince struct {
	Repository struct {
		Issues IssueQueryFragment `` /* 141-byte string literal not displayed */
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

ListIssuesQueryWithSince is the query structure for fetching issues without label filtering but with since filtering.

func (*ListIssuesQueryWithSince) GetIssueFragment added in v0.11.0

func (q *ListIssuesQueryWithSince) GetIssueFragment() IssueQueryFragment

type MinimalBranch added in v0.14.0

type MinimalBranch struct {
	Name      string `json:"name"`
	SHA       string `json:"sha"`
	Protected bool   `json:"protected"`
}

MinimalBranch is the trimmed output type for branch objects.

type MinimalCommit added in v0.14.0

type MinimalCommit struct {
	SHA       string              `json:"sha"`
	HTMLURL   string              `json:"html_url"`
	Commit    *MinimalCommitInfo  `json:"commit,omitempty"`
	Author    *MinimalUser        `json:"author,omitempty"`
	Committer *MinimalUser        `json:"committer,omitempty"`
	Stats     *MinimalCommitStats `json:"stats,omitempty"`
	Files     []MinimalCommitFile `json:"files,omitempty"`
}

MinimalCommit is the trimmed output type for commit objects.

type MinimalCommitAuthor added in v0.14.0

type MinimalCommitAuthor struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
	Date  string `json:"date,omitempty"`
}

MinimalCommitAuthor represents commit author information.

type MinimalCommitFile added in v0.14.0

type MinimalCommitFile struct {
	Filename  string `json:"filename"`
	Status    string `json:"status,omitempty"`
	Additions int    `json:"additions,omitempty"`
	Deletions int    `json:"deletions,omitempty"`
	Changes   int    `json:"changes,omitempty"`
}

MinimalCommitFile represents a file changed in a commit.

type MinimalCommitInfo added in v0.14.0

type MinimalCommitInfo struct {
	Message   string               `json:"message"`
	Author    *MinimalCommitAuthor `json:"author,omitempty"`
	Committer *MinimalCommitAuthor `json:"committer,omitempty"`
}

MinimalCommitInfo represents core commit information.

type MinimalCommitStats added in v0.14.0

type MinimalCommitStats struct {
	Additions int `json:"additions,omitempty"`
	Deletions int `json:"deletions,omitempty"`
	Total     int `json:"total,omitempty"`
}

MinimalCommitStats represents commit statistics.

type MinimalRelease added in v0.14.0

type MinimalRelease struct {
	ID          int64        `json:"id"`
	TagName     string       `json:"tag_name"`
	Name        string       `json:"name,omitempty"`
	Body        string       `json:"body,omitempty"`
	HTMLURL     string       `json:"html_url"`
	PublishedAt string       `json:"published_at,omitempty"`
	Prerelease  bool         `json:"prerelease"`
	Draft       bool         `json:"draft"`
	Author      *MinimalUser `json:"author,omitempty"`
}

MinimalRelease is the trimmed output type for release objects.

type MinimalRepository added in v0.14.0

type MinimalRepository struct {
	ID            int64    `json:"id"`
	Name          string   `json:"name"`
	FullName      string   `json:"full_name"`
	Description   string   `json:"description,omitempty"`
	HTMLURL       string   `json:"html_url"`
	Language      string   `json:"language,omitempty"`
	Stars         int      `json:"stargazers_count"`
	Forks         int      `json:"forks_count"`
	OpenIssues    int      `json:"open_issues_count"`
	UpdatedAt     string   `json:"updated_at,omitempty"`
	CreatedAt     string   `json:"created_at,omitempty"`
	Topics        []string `json:"topics,omitempty"`
	Private       bool     `json:"private"`
	Fork          bool     `json:"fork"`
	Archived      bool     `json:"archived"`
	DefaultBranch string   `json:"default_branch,omitempty"`
}

MinimalRepository is the trimmed output type for repository objects to reduce verbosity.

type MinimalResponse added in v0.14.0

type MinimalResponse struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

MinimalResponse represents a minimal response for all CRUD operations. Success is implicit in the HTTP response status, and all other information can be derived from the URL or fetched separately if needed.

type MinimalSearchRepositoriesResult added in v0.14.0

type MinimalSearchRepositoriesResult struct {
	TotalCount        int                 `json:"total_count"`
	IncompleteResults bool                `json:"incomplete_results"`
	Items             []MinimalRepository `json:"items"`
}

MinimalSearchRepositoriesResult is the trimmed output type for repository search results.

type MinimalSearchUsersResult added in v0.5.0

type MinimalSearchUsersResult struct {
	TotalCount        int           `json:"total_count"`
	IncompleteResults bool          `json:"incomplete_results"`
	Items             []MinimalUser `json:"items"`
}

MinimalSearchUsersResult is the trimmed output type for user search results.

type MinimalUser added in v0.5.0

type MinimalUser struct {
	Login      string       `json:"login"`
	ID         int64        `json:"id,omitempty"`
	ProfileURL string       `json:"profile_url,omitempty"`
	AvatarURL  string       `json:"avatar_url,omitempty"`
	Details    *UserDetails `json:"details,omitempty"` // Optional field for additional user details
}

MinimalUser is the output type for user and organization search results.

type NodeFragment added in v0.9.0

type NodeFragment struct {
	Number    githubv4.Int
	Title     githubv4.String
	CreatedAt githubv4.DateTime
	UpdatedAt githubv4.DateTime
	Author    struct {
		Login githubv4.String
	}
	Category struct {
		Name githubv4.String
	} `graphql:"category"`
	URL githubv4.String `graphql:"url"`
}

type OrganizationTeams added in v0.12.0

type OrganizationTeams struct {
	Org   string     `json:"org"`
	Teams []TeamInfo `json:"teams"`
}

type PageInfoFragment added in v0.9.0

type PageInfoFragment struct {
	HasNextPage     bool
	HasPreviousPage bool
	StartCursor     githubv4.String
	EndCursor       githubv4.String
}

type PaginationParams added in v0.2.0

type PaginationParams struct {
	Page    int
	PerPage int
	After   string
}

func OptionalPaginationParams added in v0.2.0

func OptionalPaginationParams(r mcp.CallToolRequest) (PaginationParams, error)

OptionalPaginationParams returns the "page", "perPage", and "after" 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.

func (PaginationParams) ToGraphQLParams added in v0.9.0

func (p PaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error)

ToGraphQLParams converts REST API pagination parameters to GraphQL-specific parameters. This converts page/perPage to first parameter for GraphQL queries. If After is provided, it takes precedence over page-based pagination.

type ReplaceActorsForAssignableInput added in v0.4.0

type ReplaceActorsForAssignableInput struct {
	AssignableID githubv4.ID   `json:"assignableId"`
	ActorIDs     []githubv4.ID `json:"actorIds"`
}

type TeamInfo added in v0.12.0

type TeamInfo struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
}

type UserDetails added in v0.7.0

type UserDetails struct {
	Name              string    `json:"name,omitempty"`
	Company           string    `json:"company,omitempty"`
	Blog              string    `json:"blog,omitempty"`
	Location          string    `json:"location,omitempty"`
	Email             string    `json:"email,omitempty"`
	Hireable          bool      `json:"hireable,omitempty"`
	Bio               string    `json:"bio,omitempty"`
	TwitterUsername   string    `json:"twitter_username,omitempty"`
	PublicRepos       int       `json:"public_repos"`
	PublicGists       int       `json:"public_gists"`
	Followers         int       `json:"followers"`
	Following         int       `json:"following"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
	PrivateGists      int       `json:"private_gists,omitempty"`
	TotalPrivateRepos int64     `json:"total_private_repos,omitempty"`
	OwnedPrivateRepos int64     `json:"owned_private_repos,omitempty"`
}

UserDetails contains additional fields about a GitHub user not already present in MinimalUser. Used by get_me context tool but omitted from search_users.

type WithCategoryAndOrder added in v0.9.0

type WithCategoryAndOrder struct {
	Repository struct {
		Discussions DiscussionFragment `` /* 141-byte string literal not displayed */
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

func (*WithCategoryAndOrder) GetDiscussionFragment added in v0.9.0

func (q *WithCategoryAndOrder) GetDiscussionFragment() DiscussionFragment

type WithCategoryNoOrder added in v0.9.0

type WithCategoryNoOrder struct {
	Repository struct {
		Discussions DiscussionFragment `graphql:"discussions(first: $first, after: $after, categoryId: $categoryId)"`
	} `graphql:"repository(owner: $owner, name: $repo)"`
}

func (*WithCategoryNoOrder) GetDiscussionFragment added in v0.9.0

func (q *WithCategoryNoOrder) GetDiscussionFragment() DiscussionFragment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL