Documentation
¶
Index ¶
- func NewUUID() string
- type Account
- type AddCommentInput
- type AddCommentOutput
- type AssetItem
- type CheckoutRepoInput
- type CheckoutRepoOutput
- type Comment
- type Config
- type CreateIssueInput
- type CreateIssueOutput
- type CreatePRInput
- type CreatePROutput
- type DownloadInput
- type DownloadOutput
- type GitTarget
- type Issue
- type ListCommentsInput
- type ListCommentsOutput
- type ListRepoInput
- type ListRepoIssuesInput
- type ListRepoIssuesOutput
- type ListRepoOutput
- type ListRepoPRsInput
- type ListRepoPRsOutput
- type ListReposInput
- type ListReposOutput
- type PendingAuth
- type PendingAuths
- type PullRequest
- type Repo
- type RepoRef
- type SearchIssuesInput
- type SearchIssuesOutput
- type Service
- func (s *Service) AddComment(ctx context.Context, in *AddCommentInput, prompt func(string)) (*AddCommentOutput, error)
- func (s *Service) BaseURL() string
- func (s *Service) CheckoutRepo(ctx context.Context, in *CheckoutRepoInput, prompt func(string)) (*CheckoutRepoOutput, error)
- func (s *Service) ClientID() string
- func (s *Service) CreateIssue(ctx context.Context, in *CreateIssueInput, prompt func(string)) (*CreateIssueOutput, error)
- func (s *Service) CreatePR(ctx context.Context, in *CreatePRInput, prompt func(string)) (*CreatePROutput, error)
- func (s *Service) Credential(ctx context.Context, alias, domain string, prompt func(string)) (string, error)
- func (s *Service) DeviceHandler() http.HandlerFunc
- func (s *Service) DeviceStartHandler() http.HandlerFunc
- func (s *Service) DownloadRepoFile(ctx context.Context, in *DownloadInput, prompt func(string)) (*DownloadOutput, error)
- func (s *Service) ElicitCooldown() time.Duration
- func (s *Service) ListComments(ctx context.Context, in *ListCommentsInput, prompt func(string)) (*ListCommentsOutput, error)
- func (s *Service) ListRepoIssues(ctx context.Context, in *ListRepoIssuesInput, prompt func(string)) (*ListRepoIssuesOutput, error)
- func (s *Service) ListRepoPRs(ctx context.Context, in *ListRepoPRsInput, prompt func(string)) (*ListRepoPRsOutput, error)
- func (s *Service) ListRepoPath(ctx context.Context, in *ListRepoInput, prompt func(string)) (*ListRepoOutput, error)
- func (s *Service) ListRepos(ctx context.Context, in *ListReposInput, prompt func(string)) (*ListReposOutput, error)
- func (s *Service) Namespace(ctx context.Context) string
- func (s *Service) NewOperationsHook(_ protoclient.Operations)
- func (s *Service) OOBHandler() http.HandlerFunc
- func (s *Service) PendingClearHandler() http.HandlerFunc
- func (s *Service) PendingListHandler() http.HandlerFunc
- func (s *Service) RegisterHTTP(mux *http.ServeMux)
- func (s *Service) SearchIssues(ctx context.Context, in *SearchIssuesInput, prompt func(string)) (*SearchIssuesOutput, error)
- func (s *Service) SetCmdRunner(r cmdRunner)
- func (s *Service) StorageDir() string
- func (s *Service) TokenCheckHandler() http.HandlerFunc
- func (s *Service) TokenIngestHandler() http.HandlerFunc
- func (s *Service) UseTextField() bool
- func (s *Service) VerifyHandler() http.HandlerFunc
- func (s *Service) WaitTimeout() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddCommentInput ¶
type AddCommentOutput ¶
type AddCommentOutput struct {
Comment Comment `json:"comment"`
}
type CheckoutRepoInput ¶
type CheckoutRepoInput struct {
GitTarget
Branch string `json:"branch,omitempty"`
Commit string `json:"commit,omitempty"`
DestDir string `json:"destDir,omitempty"`
Depth int `json:"depth,omitempty"`
}
Checkout repo types
type CheckoutRepoOutput ¶
type Config ¶
type Config struct {
ClientID string `json:"clientID"`
StorageDir string `json:"storageDir,omitempty"`
CallbackBaseURL string `json:"callbackBaseURL,omitempty"`
UseData bool `json:"useData,omitempty"`
UseText bool `json:"useText,omitempty"`
// SecretsBase is an AFS/scy URL root for persisting credentials per namespace.
// Examples: mem://localhost/mcp-github, file://~/.mcp/github, gs://bucket/path
SecretsBase string `json:"secretsBase,omitempty"`
}
type CreateIssueInput ¶
type CreateIssueOutput ¶
type CreateIssueOutput struct {
Issue Issue `json:"issue"`
}
type CreatePRInput ¶
type CreatePROutput ¶
type CreatePROutput struct {
Pull PullRequest `json:"pull"`
}
type DownloadInput ¶
type DownloadOutput ¶
type GitTarget ¶
type GitTarget struct {
URL string `json:"url,omitempty" description:"encapsulates repo identity https://domain/owner/name"`
Account Account `json:"account,omitempty" internal:"true"`
Repo RepoRef `json:"repo,omitempty" internal:"true"`
Ref string `json:"ref,omitempty"`
}
GitTarget encapsulates repo identity (url/domain/owner/name), revision (ref), and auth (alias via Account).
func (*GitTarget) GetAlias ¶
GetAlias returns the effective alias for repo-scoped operations using only target data. Order of precedence: 1) Explicit account.alias if provided. 2) If exactly one stored alias has a token for this repo, use that alias (inference). 3) Default to "owner/repo" derived from the target.
type ListCommentsInput ¶
type ListCommentsOutput ¶
type ListCommentsOutput struct {
Comments []Comment `json:"comments,omitempty"`
}
type ListRepoInput ¶
type ListRepoInput struct {
GitTarget
Path string `json:"path"`
Recursive bool `json:"recursive,omitempty" description:"traverse directories recursively"`
Contains string `json:"contains,omitempty" description:"return only entries whose name or path contains this substring (traversal unaffected)"`
Concurrency int `json:"concurrency,omitempty" description:"number of concurrent directory fetches (default 6)"`
Include []string `json:"include,omitempty" description:"glob patterns to include (e.g., ['*.go','*.sql'])"`
Exclude []string `json:"exclude,omitempty" description:"glob patterns to exclude (e.g., ['*_test.go','**/vendor/**'])"`
}
List path (assets) types
type ListRepoIssuesInput ¶
type ListRepoIssuesOutput ¶
type ListRepoIssuesOutput struct {
Issues []Issue `json:"issues,omitempty"`
}
type ListRepoOutput ¶
type ListRepoOutput struct {
Items []AssetItem `json:"items"`
}
type ListRepoPRsInput ¶
type ListRepoPRsOutput ¶
type ListRepoPRsOutput struct {
Pulls []PullRequest `json:"pulls,omitempty"`
}
type ListReposInput ¶
type ListReposInput struct {
Account Account `json:"account"`
Visibility string `json:"visibility,omitempty" description:"all|public|private"`
Affiliation string `json:"affiliation,omitempty" description:"owner,collaborator,organization_member (comma-separated)"`
PerPage int `json:"perPage,omitempty" description:"page size (default 30)"`
}
type ListReposOutput ¶
type ListReposOutput struct {
Repos []Repo `json:"repos,omitempty"`
}
type PendingAuth ¶
type PendingAuths ¶
type PendingAuths struct {
// contains filtered or unexported fields
}
func NewPendingAuths ¶
func NewPendingAuths() *PendingAuths
func (*PendingAuths) ClearNamespace ¶
func (p *PendingAuths) ClearNamespace(ns string) []string
func (*PendingAuths) Get ¶
func (p *PendingAuths) Get(uuid string) (*PendingAuth, bool)
func (*PendingAuths) ListNamespace ¶
func (p *PendingAuths) ListNamespace(ns string) []*PendingAuth
func (*PendingAuths) Put ¶
func (p *PendingAuths) Put(x *PendingAuth)
func (*PendingAuths) Remove ¶
func (p *PendingAuths) Remove(uuid string)
type PullRequest ¶
type SearchIssuesInput ¶
type SearchIssuesOutput ¶
type SearchIssuesOutput struct {
Issues []Issue `json:"issues,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddComment ¶
func (s *Service) AddComment(ctx context.Context, in *AddCommentInput, prompt func(string)) (*AddCommentOutput, error)
AddComment adds a comment to an issue or PR (PR comments use issue comments endpoint).
func (*Service) CheckoutRepo ¶
func (s *Service) CheckoutRepo(ctx context.Context, in *CheckoutRepoInput, prompt func(string)) (*CheckoutRepoOutput, error)
CheckoutRepo clones a repository and optionally checks out a branch or commit.
func (*Service) CreateIssue ¶
func (s *Service) CreateIssue(ctx context.Context, in *CreateIssueInput, prompt func(string)) (*CreateIssueOutput, error)
CreateIssue creates a new issue in a repository.
func (*Service) CreatePR ¶
func (s *Service) CreatePR(ctx context.Context, in *CreatePRInput, prompt func(string)) (*CreatePROutput, error)
CreatePR opens a pull request.
func (*Service) Credential ¶
func (*Service) DeviceHandler ¶
func (s *Service) DeviceHandler() http.HandlerFunc
func (*Service) DeviceStartHandler ¶
func (s *Service) DeviceStartHandler() http.HandlerFunc
DeviceStartHandler initiates device authorization and returns URL+code without blocking for completion.
func (*Service) DownloadRepoFile ¶
func (s *Service) DownloadRepoFile(ctx context.Context, in *DownloadInput, prompt func(string)) (*DownloadOutput, error)
DownloadRepoFile fetches raw bytes of a file at path and ref.
func (*Service) ElicitCooldown ¶
ElicitCooldown returns cooldown between repeated elicitations; configurable via GITHUB_MCP_ELICIT_COOLDOWN_SECS (default 60s).
func (*Service) ListComments ¶
func (s *Service) ListComments(ctx context.Context, in *ListCommentsInput, prompt func(string)) (*ListCommentsOutput, error)
ListComments lists comments for an issue or PR.
func (*Service) ListRepoIssues ¶
func (s *Service) ListRepoIssues(ctx context.Context, in *ListRepoIssuesInput, prompt func(string)) (*ListRepoIssuesOutput, error)
func (*Service) ListRepoPRs ¶
func (s *Service) ListRepoPRs(ctx context.Context, in *ListRepoPRsInput, prompt func(string)) (*ListRepoPRsOutput, error)
func (*Service) ListRepoPath ¶
func (s *Service) ListRepoPath(ctx context.Context, in *ListRepoInput, prompt func(string)) (*ListRepoOutput, error)
ListRepoPath lists repo directory entries or a single file at the given path and ref.
func (*Service) ListRepos ¶
func (s *Service) ListRepos(ctx context.Context, in *ListReposInput, prompt func(string)) (*ListReposOutput, error)
Public methods: ListRepos, ListRepoIssues, ListRepoPRs
func (*Service) Namespace ¶
Namespace returns the effective authorization namespace for this request context, or "default" when not set.
func (*Service) NewOperationsHook ¶
func (s *Service) NewOperationsHook(_ protoclient.Operations)
func (*Service) OOBHandler ¶
func (s *Service) OOBHandler() http.HandlerFunc
OOBHandler serves a page to collect credentials: bearer token, basic creds, or start device flow.
func (*Service) PendingClearHandler ¶
func (s *Service) PendingClearHandler() http.HandlerFunc
func (*Service) PendingListHandler ¶
func (s *Service) PendingListHandler() http.HandlerFunc
func (*Service) RegisterHTTP ¶
func (*Service) SearchIssues ¶
func (s *Service) SearchIssues(ctx context.Context, in *SearchIssuesInput, prompt func(string)) (*SearchIssuesOutput, error)
SearchIssues runs a GitHub issues/PRs search query.
func (*Service) SetCmdRunner ¶
func (s *Service) SetCmdRunner(r cmdRunner)
SetCmdRunner allows tests to inject a custom runner.
func (*Service) StorageDir ¶
func (*Service) TokenCheckHandler ¶
func (s *Service) TokenCheckHandler() http.HandlerFunc
TokenCheckHandler returns whether a token exists for alias/domain.
func (*Service) TokenIngestHandler ¶
func (s *Service) TokenIngestHandler() http.HandlerFunc
TokenIngestHandler accepts a token via Authorization header (Bearer or Basic) or JSON body and stores it for alias/domain.
func (*Service) UseTextField ¶
func (*Service) VerifyHandler ¶
func (s *Service) VerifyHandler() http.HandlerFunc
VerifyHandler checks whether the provided/stored credential can access the repo's default branch tree. GET /github/auth/verify?alias=...&domain=...&url=domain/owner/repo
func (*Service) WaitTimeout ¶
WaitTimeout returns maximum time to wait for credentials; configurable via GITHUB_MCP_WAIT_SECS (default 300s).