MCPcopy Index your code
hub / github.com/github/github-mcp-server / RegisterPrompts

Method RegisterPrompts

pkg/inventory/registry.go:241–251  ·  view source on GitHub ↗

RegisterPrompts registers all available prompts with the server. The context is used for feature flag evaluation. Icons are automatically applied from the toolset metadata if not already set.

(ctx context.Context, s *mcp.Server)

Source from the content-addressed store, hash-verified

239// The context is used for feature flag evaluation.
240// Icons are automatically applied from the toolset metadata if not already set.
241func (r *Inventory) RegisterPrompts(ctx context.Context, s *mcp.Server) {
242 for _, prompt := range r.AvailablePrompts(ctx) {
243 // Make a shallow copy to avoid mutating the original
244 promptCopy := prompt.Prompt
245 // Apply icons from toolset metadata if not already set
246 if len(promptCopy.Icons) == 0 {
247 promptCopy.Icons = prompt.Toolset.Icons()
248 }
249 s.AddPrompt(&promptCopy, prompt.Handler)
250 }
251}
252
253// RegisterAll registers all available tools, resources, and prompts with the server.
254// The context is used for feature flag evaluation.

Callers 1

RegisterAllMethod · 0.95

Calls 2

AvailablePromptsMethod · 0.95
IconsMethod · 0.80

Tested by

no test coverage detected