MCPcopy
hub / github.com/github/github-mcp-server / NewFetcher

Function NewFetcher

pkg/scopes/fetcher.go:44–54  ·  view source on GitHub ↗

NewFetcher creates a new scope fetcher with the given options.

(apiHost utils.APIHostResolver, opts FetcherOptions)

Source from the content-addressed store, hash-verified

42
43// NewFetcher creates a new scope fetcher with the given options.
44func NewFetcher(apiHost utils.APIHostResolver, opts FetcherOptions) *Fetcher {
45 client := opts.HTTPClient
46 if client == nil {
47 client = &http.Client{Timeout: DefaultFetchTimeout}
48 }
49
50 return &Fetcher{
51 client: client,
52 apiHost: apiHost,
53 }
54}
55
56// FetchTokenScopes retrieves the OAuth scopes for a token by making an HTTP HEAD
57// request to the GitHub API and parsing the X-OAuth-Scopes header.

Callers 10

RunHTTPServerFunction · 0.92
NewHTTPMcpHandlerFunction · 0.92
fetchTokenScopesForHostFunction · 0.92
FetchTokenScopesFunction · 0.85
FetchTokenScopesWithHostFunction · 0.85

Calls

no outgoing calls