Versions in this module Expand all Collapse all v2 v2.0.2 Oct 8, 2026 v2.0.1 Oct 7, 2026 Changes in this version + const MCPMethodDiscover + const MCPMethodInitialize + const MCPMethodPromptsGet + const MCPMethodPromptsList + const MCPMethodResourcesList + const MCPMethodResourcesRead + const MCPMethodResourcesTemplatesList + const MCPMethodToolsCall + const MCPMethodToolsList + const ProtocolVersionMultiRoundTrip + var ErrUnknownTools = errors.New("unknown tools specified in WithTools") + var HeaderParams = map[string]string + func AnnotateHeaderParams(tool *mcp.Tool) + func CachedInputSchemaFor[T any](options *jsonschema.ForOptions, enums ...SchemaEnum) (*jsonschema.Schema, error) + func CachedSchema(schema *jsonschema.Schema) (*jsonschema.Schema, error) + func CachedSchemaFor[T any](options *jsonschema.ForOptions, enums ...SchemaEnum) (*jsonschema.Schema, error) + func CloneSchema(schema *jsonschema.Schema) *jsonschema.Schema + func CloneSchemaWithoutDefaults(schema *jsonschema.Schema) *jsonschema.Schema + func EnumSchema(values ...string) *jsonschema.Schema + func PreserveToolHandlerContent(ctx context.Context) + func ResolveFeature(ctx context.Context, fallbackChecker FeatureFlagChecker, feature FeatureFlag) bool + func WithEnum(schema *jsonschema.Schema, path string, values ...string) (*jsonschema.Schema, error) + func WithFeatureState(ctx context.Context, checker FeatureFlagChecker) context.Context + type Builder struct + func NewBuilder() *Builder + func (b *Builder) Build() (*Inventory, error) + func (b *Builder) SetPrompts(prompts []ServerPrompt) *Builder + func (b *Builder) SetResources(resources []ServerResourceTemplate) *Builder + func (b *Builder) SetTools(tools []ServerTool) *Builder + func (b *Builder) WithDeprecatedAliases(aliases map[string]string) *Builder + func (b *Builder) WithExcludeTools(toolNames []string) *Builder + func (b *Builder) WithFeatureChecker(checker FeatureFlagChecker) *Builder + func (b *Builder) WithFilter(filter ToolFilter) *Builder + func (b *Builder) WithReadOnly(readOnly bool) *Builder + func (b *Builder) WithServerInstructions() *Builder + func (b *Builder) WithTools(toolNames []string) *Builder + func (b *Builder) WithToolsets(toolsetIDs []string) *Builder + type ElicitationMode string + const ElicitationModeForm + const ElicitationModeURL + type FeatureFlag string + type FeatureFlagChecker func(ctx context.Context, flag string) (bool, error) + type FeaturePredicate func(featureAsBool FeatureResolver) bool + type FeatureResolver func(flag FeatureFlag) bool + type FeatureRule struct + func NewFeatureRule(features []FeatureFlag, predicate FeaturePredicate) FeatureRule + func (r FeatureRule) Enabled(featureAsBool FeatureResolver) bool + func (r FeatureRule) Features() []FeatureFlag + func (r FeatureRule) IsZero() bool + type HandlerFunc func(deps any) mcp.ToolHandler + type InputNormalizer func(json.RawMessage) (json.RawMessage, error) + type Inventory struct + func (r *Inventory) AllTools() []ServerTool + func (r *Inventory) AvailablePrompts(ctx context.Context) []ServerPrompt + func (r *Inventory) AvailableResourceTemplates(ctx context.Context) []ServerResourceTemplate + func (r *Inventory) AvailableTools(ctx context.Context) []ServerTool + func (r *Inventory) AvailableToolsets(exclude ...ToolsetID) []ToolsetMetadata + func (r *Inventory) DefaultToolsetIDs() []ToolsetID + func (r *Inventory) EnabledToolsets() []ToolsetMetadata + func (r *Inventory) FilteredTools(ctx context.Context) ([]ServerTool, error) + func (r *Inventory) FindToolByName(toolName string) (*ServerTool, ToolsetID, error) + func (r *Inventory) ForMCPRequest(method string, itemName string) *Inventory + func (r *Inventory) HasToolset(toolsetID ToolsetID) bool + func (r *Inventory) Instructions() string + func (r *Inventory) RegisterAll(ctx context.Context, s *mcp.Server, deps any, ...) + func (r *Inventory) RegisterPrompts(ctx context.Context, s *mcp.Server) + func (r *Inventory) RegisterResourceTemplates(ctx context.Context, s *mcp.Server, deps any) + func (r *Inventory) RegisterTools(ctx context.Context, s *mcp.Server, deps any, ...) + func (r *Inventory) RegisterToolsForProtocolEra(ctx context.Context, s *mcp.Server, deps any, era ProtocolEra, ...) + func (r *Inventory) RequiredFeatures() []FeatureFlag + func (r *Inventory) ResolveToolAliases(toolNames []string) (resolved []string, aliasesUsed map[string]string) + func (r *Inventory) ToolsForRegistration(ctx context.Context) []ServerTool + func (r *Inventory) ToolsetDescriptions() map[ToolsetID]string + func (r *Inventory) ToolsetIDs() []ToolsetID + func (r *Inventory) UnrecognizedToolsets() []string + func (r *Inventory) WithFeatureState(ctx context.Context) context.Context + type ProtocolEra uint8 + const ProtocolEraDynamic + const ProtocolEraLegacy + const ProtocolEraModern + func ProtocolEraForVersion(version string) ProtocolEra + type ResourceHandlerFunc func(deps any) mcp.ResourceHandler + type SchemaEnum struct + Path string + Values []string + type ScopeAccess struct + ArgumentNormalizer InputNormalizer + Challenge ScopeChallenge + Dynamic bool + Scopes []string + Visible ScopeVisibility + type ScopeChallenge func(arguments map[string]any, activeScopes []string) []string + type ScopeVisibility func(activeScopes []string) bool + type ServerPrompt struct + FeatureRule FeatureRule + Handler mcp.PromptHandler + Prompt mcp.Prompt + Toolset ToolsetMetadata + func NewServerPrompt(toolset ToolsetMetadata, prompt mcp.Prompt, handler mcp.PromptHandler) ServerPrompt + type ServerResourceTemplate struct + FeatureRule FeatureRule + HandlerFunc ResourceHandlerFunc + Template mcp.ResourceTemplate + Toolset ToolsetMetadata + func NewServerResourceTemplate(toolset ToolsetMetadata, resourceTemplate mcp.ResourceTemplate, ...) ServerResourceTemplate + func (sr *ServerResourceTemplate) Handler(deps any) mcp.ResourceHandler + func (sr *ServerResourceTemplate) HasHandler() bool + type ServerTool struct + Enabled func(ctx context.Context) (bool, error) + FeatureRule FeatureRule + HandlerFunc HandlerFunc + MinimumProtocolVersion string + RequiredElicitationMode ElicitationMode + ScopeAccess ScopeAccess + Tool mcp.Tool + Toolset ToolsetMetadata + func NewServerTool(tool mcp.Tool, toolset ToolsetMetadata, handler mcp.ToolHandler) ServerTool + func NewServerToolWithContextHandlerAndSchemaOptions[In any, Out any](tool mcp.Tool, toolset ToolsetMetadata, handler mcp.ToolHandlerFor[In, Out], ...) ServerTool + func NewServerToolWithContextHandler[In any, Out any](tool mcp.Tool, toolset ToolsetMetadata, handler mcp.ToolHandlerFor[In, Out], ...) ServerTool + func (st *ServerTool) AddHandlerMiddleware(provider ToolHandlerMiddlewareProvider) + func (st *ServerTool) GetInputNormalizer() InputNormalizer + func (st *ServerTool) Handler(deps any) mcp.ToolHandler + func (st *ServerTool) HasHandler() bool + func (st *ServerTool) IsReadOnly() bool + func (st *ServerTool) RegisterFunc(s *mcp.Server, deps any, middleware ...ToolHandlerMiddleware) + func (st *ServerTool) RegisterFuncForProtocolEra(s *mcp.Server, deps any, era ProtocolEra, middleware ...ToolHandlerMiddleware) + type ToolCallPreflight func(context.Context, *mcp.CallToolRequest) (context.Context, *mcp.CallToolResult, error) + type ToolDoesNotExistError struct + Name string + func NewToolDoesNotExistError(name string) *ToolDoesNotExistError + func (e *ToolDoesNotExistError) Error() string + type ToolFilter func(ctx context.Context, tool *ServerTool) (bool, error) + func CreateExcludeToolsFilter(excluded []string) ToolFilter + type ToolHandlerMiddleware func(next mcp.ToolHandler) mcp.ToolHandler + type ToolHandlerMiddlewareProvider func(deps any) ToolHandlerMiddleware + type ToolInputError struct + Message string + func (err *ToolInputError) Error() string + type ToolsetDoesNotExistError struct + Name string + func NewToolsetDoesNotExistError(name string) *ToolsetDoesNotExistError + func (e *ToolsetDoesNotExistError) Error() string + func (e *ToolsetDoesNotExistError) Is(target error) bool + type ToolsetID string + type ToolsetMetadata struct + Default bool + Description string + ID ToolsetID + Icon string + InstructionsFunc func(inv *Inventory) string + func (tm ToolsetMetadata) Icons() []mcp.Icon + type TypedSchemaOptions struct + Input *jsonschema.ForOptions + InputEnums []SchemaEnum + Output *jsonschema.ForOptions + OutputEnums []SchemaEnum + Preflight ToolCallPreflight + PreserveHandlerContent bool + ValidationInputSchema *jsonschema.Schema Other modules containing this package github.com/github/github-mcp-server