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

Function addSafeOutputsConfig

pkg/parser/mcp.go:102–128  ·  view source on GitHub ↗
(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig)

Source from the content-addressed store, hash-verified

100}
101
102func addSafeOutputsConfig(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig) {
103 safeOutputsSection, hasSafeOutputs := frontmatter["safe-outputs"]
104 if !hasSafeOutputs {
105 return
106 }
107 mcpLog.Print("Found safe-outputs configuration")
108 if !serverFilterMatches(constants.SafeOutputsMCPServerID.String(), serverFilter) {
109 return
110 }
111
112 config := RegistryMCPServerConfig{
113 BaseMCPServerConfig: types.BaseMCPServerConfig{
114 Type: "stdio",
115 Command: "node",
116 Env: make(map[string]string),
117 },
118 Name: constants.SafeOutputsMCPServerID.String(),
119 }
120 if safeOutputsMap, ok := safeOutputsSection.(map[string]any); ok {
121 for toolType := range safeOutputsMap {
122 if mappedTool, ok := safeOutputToolName(toolType); ok {
123 config.Allowed = append(config.Allowed, mappedTool)
124 }
125 }
126 }
127 *configs = append(*configs, config)
128}
129
130func addSafeJobsConfig(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig) {
131 safeJobsSection, hasSafeJobs := frontmatter["safe-jobs"]

Callers 1

ExtractMCPConfigurationsFunction · 0.85

Calls 4

serverFilterMatchesFunction · 0.85
safeOutputToolNameFunction · 0.85
PrintMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected