ghmcp

package
v0.0.0-...-0d759da Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMCPServer

func NewMCPServer(cfg MCPServerConfig) (*server.MCPServer, error)

func RunStdioServer

func RunStdioServer(cfg StdioServerConfig) error

RunStdioServer is not concurrent safe.

Types

type MCPServerConfig

type MCPServerConfig struct {
	// Version of the server
	Version string

	// GitHub Host to target for API requests (e.g. github.com or github.enterprise.com)
	Host string

	// GitHub Token to authenticate with the GitHub API
	// Deprecated: Use TokenProvider for dynamic token support
	Token string

	// TokenProvider is a function that returns the current GitHub token
	// If set, this takes precedence over Token
	TokenProvider TokenProvider

	// EnabledToolsets is a list of toolsets to enable
	// See: https://github.com/albertywu/github-mcp-server?tab=readme-ov-file#tool-configuration
	EnabledToolsets []string

	// Whether to enable dynamic toolsets
	// See: https://github.com/albertywu/github-mcp-server?tab=readme-ov-file#dynamic-tool-discovery
	DynamicToolsets bool

	// ReadOnly indicates if we should only offer read-only tools
	ReadOnly bool

	// Translator provides translated text for the server tooling
	Translator translations.TranslationHelperFunc
}

type StdioServerConfig

type StdioServerConfig struct {
	// Version of the server
	Version string

	// GitHub Host to target for API requests (e.g. github.com or github.enterprise.com)
	Host string

	// GitHub Token to authenticate with the GitHub API
	// Deprecated: Use TokenProvider for dynamic token support
	Token string

	// TokenProvider is a function that returns the current GitHub token
	// If set, this takes precedence over Token
	TokenProvider TokenProvider

	// EnabledToolsets is a list of toolsets to enable
	// See: https://github.com/albertywu/github-mcp-server?tab=readme-ov-file#tool-configuration
	EnabledToolsets []string

	// Whether to enable dynamic toolsets
	// See: https://github.com/albertywu/github-mcp-server?tab=readme-ov-file#dynamic-tool-discovery
	DynamicToolsets bool

	// ReadOnly indicates if we should only register read-only tools
	ReadOnly bool

	// ExportTranslations indicates if we should export translations
	// See: https://github.com/albertywu/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
}

type TokenProvider

type TokenProvider func() string

TokenProvider is a function that returns the current GitHub token. This allows for dynamic token refresh without restarting the server.

Jump to

Keyboard shortcuts

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