MCPcopy Create free account
hub / github.com/github/gh-aw / parseMCPRegistryValue

Function parseMCPRegistryValue

pkg/parser/mcp.go:499–508  ·  view source on GitHub ↗
(mcpConfig map[string]any, toolName string, config *RegistryMCPServerConfig)

Source from the content-addressed store, hash-verified

497}
498
499func parseMCPRegistryValue(mcpConfig map[string]any, toolName string, config *RegistryMCPServerConfig) error {
500 if registry, hasRegistry := mcpConfig["registry"]; hasRegistry {
501 registryStr, ok := registry.(string)
502 if !ok {
503 return fmt.Errorf("registry field must be a string, got %T. Example:\nmcp-servers:\n %s:\n registry: \"https://registry.npmjs.org/@my/tool\"\n command: \"npx @my/tool\"", registry, toolName)
504 }
505 config.Registry = registryStr
506 }
507 return nil
508}
509
510func parseMCPStdioTypeConfig(mcpConfig map[string]any, toolName string, config *RegistryMCPServerConfig) error {
511 if container, hasContainer := mcpConfig["container"]; hasContainer {

Callers 1

ParseMCPConfigFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected