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

Function parseCustomMCPServerConfigs

pkg/parser/mcp.go:209–227  ·  view source on GitHub ↗
(mcpServers map[string]any, serverFilter string)

Source from the content-addressed store, hash-verified

207}
208
209func parseCustomMCPServerConfigs(mcpServers map[string]any, serverFilter string) ([]RegistryMCPServerConfig, error) {
210 var configs []RegistryMCPServerConfig
211 for serverName, serverValue := range mcpServers {
212 if serverFilter != "" && !strings.Contains(strings.ToLower(serverName), strings.ToLower(serverFilter)) {
213 continue
214 }
215 toolConfig, ok := serverValue.(map[string]any)
216 if !ok {
217 continue
218 }
219 config, err := ParseMCPConfig(serverName, toolConfig, toolConfig)
220 if err != nil {
221 return nil, fmt.Errorf("failed to parse MCP config for %s: %w", serverName, err)
222 }
223 mcpLog.Printf("Parsed custom MCP server: %s (type=%s)", serverName, config.Type)
224 configs = append(configs, config)
225 }
226 return configs, nil
227}
228
229// extractBuiltinMCPTools reads the tools section and appends github/playwright configs to configs.
230// It returns an error if a removed tool (serena) is present.

Callers 1

ExtractMCPConfigurationsFunction · 0.85

Calls 4

ParseMCPConfigFunction · 0.85
ToLowerMethod · 0.80
ErrorfMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected