Documentation
¶
Index ¶
- func DefaultGitHubMCPServerFactory(r *http.Request, deps github.ToolDependencies, inventory *inventory.Inventory, ...) (*mcp.Server, error)
- func InventoryFiltersForRequest(r *http.Request, builder *inventory.Builder) *inventory.Builder
- func PATScopeFilter(b *inventory.Builder, r *http.Request, fetcher scopes.FetcherInterface) *inventory.Builder
- func RunHTTPServer(cfg ServerConfig) error
- type GitHubMCPServerFactoryFunc
- type Handler
- type HandlerOption
- func WithFeatureChecker(checker inventory.FeatureFlagChecker) HandlerOption
- func WithGitHubMCPServerFactory(f GitHubMCPServerFactoryFunc) HandlerOption
- func WithInventoryFactory(f InventoryFactoryFunc) HandlerOption
- func WithOAuthConfig(cfg *oauth.Config) HandlerOption
- func WithScopeFetcher(f scopes.FetcherInterface) HandlerOption
- type HandlerOptions
- type InventoryFactoryFunc
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InventoryFiltersForRequest ¶
InventoryFiltersForRequest applies filters to the inventory builder based on the request context and headers
func PATScopeFilter ¶
func RunHTTPServer ¶
func RunHTTPServer(cfg ServerConfig) error
Types ¶
type GitHubMCPServerFactoryFunc ¶
type GitHubMCPServerFactoryFunc func(r *http.Request, deps github.ToolDependencies, inventory *inventory.Inventory, cfg *github.MCPServerConfig) (*mcp.Server, error)
GitHubMCPServerFactoryFunc is a function type for creating a new MCP Server instance. middleware are applied AFTER the default GitHub MCP Server middlewares (like error context injection)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHTTPMcpHandler ¶
func NewHTTPMcpHandler( ctx context.Context, cfg *ServerConfig, deps github.ToolDependencies, t translations.TranslationHelperFunc, logger *slog.Logger, apiHost utils.APIHostResolver, options ...HandlerOption) *Handler
func (*Handler) RegisterMiddleware ¶
func (*Handler) RegisterRoutes ¶
RegisterRoutes registers the routes for the MCP server URL-based values take precedence over header-based values
type HandlerOption ¶
type HandlerOption func(*HandlerOptions)
func WithFeatureChecker ¶
func WithFeatureChecker(checker inventory.FeatureFlagChecker) HandlerOption
func WithGitHubMCPServerFactory ¶
func WithGitHubMCPServerFactory(f GitHubMCPServerFactoryFunc) HandlerOption
func WithInventoryFactory ¶
func WithInventoryFactory(f InventoryFactoryFunc) HandlerOption
func WithOAuthConfig ¶
func WithOAuthConfig(cfg *oauth.Config) HandlerOption
func WithScopeFetcher ¶
func WithScopeFetcher(f scopes.FetcherInterface) HandlerOption
type HandlerOptions ¶
type HandlerOptions struct {
GitHubMcpServerFactory GitHubMCPServerFactoryFunc
InventoryFactory InventoryFactoryFunc
OAuthConfig *oauth.Config
ScopeFetcher scopes.FetcherInterface
FeatureChecker inventory.FeatureFlagChecker
}
type InventoryFactoryFunc ¶
func DefaultInventoryFactory ¶
func DefaultInventoryFactory(_ *ServerConfig, t translations.TranslationHelperFunc, featureChecker inventory.FeatureFlagChecker, scopeFetcher scopes.FetcherInterface) InventoryFactoryFunc
DefaultInventoryFactory creates the default inventory factory for HTTP mode
type ServerConfig ¶
type ServerConfig struct {
// Version of the server
Version string
// GitHub Host to target for API requests (e.g. github.com or github.enterprise.com)
Host string
// Port to listen on (default: 8082)
Port int
// BaseURL is the publicly accessible URL of this server for OAuth resource metadata.
// If not set, the server will derive the URL from incoming request headers.
BaseURL string
// ResourcePath is the externally visible base path for this server (e.g., "/mcp").
// This is used to restore the original path when a proxy strips a base path before forwarding.
ResourcePath string
// ExportTranslations indicates if we should export translations
// See: https://github.com/github/github-mcp-server?tab=readme-ov-file#i18n--overriding-descriptions
ExportTranslations bool
// EnableCommandLogging indicates if we should log commands
EnableCommandLogging bool
// Path to the log file if not stderr
LogFilePath string
// Content window size
ContentWindowSize int
// LockdownMode indicates if we should enable lockdown mode
LockdownMode bool
// RepoAccessCacheTTL overrides the default TTL for repository access cache entries.
RepoAccessCacheTTL *time.Duration
// ScopeChallenge indicates if we should return OAuth scope challenges, and if we should perform
// tool filtering based on token scopes.
ScopeChallenge bool
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mark provides a mechanism for tagging errors with a well-known error value.
|
Package mark provides a mechanism for tagging errors with a well-known error value. |
|
Package oauth provides OAuth 2.0 Protected Resource Metadata (RFC 9728) support for the GitHub MCP Server HTTP mode.
|
Package oauth provides OAuth 2.0 Protected Resource Metadata (RFC 9728) support for the GitHub MCP Server HTTP mode. |
Click to show internal directories.
Click to hide internal directories.