extractBuiltinMCPTools reads the tools section and appends github/playwright configs to configs. It returns an error if a removed tool (serena) is present.
(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig)
| 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. |
| 231 | func extractBuiltinMCPTools(frontmatter map[string]any, serverFilter string, configs *[]RegistryMCPServerConfig) error { |
| 232 | toolsSection, hasTools := frontmatter["tools"] |
| 233 | if !hasTools { |
| 234 | return nil |
| 235 | } |
| 236 | tools, ok := toolsSection.(map[string]any) |
| 237 | if !ok { |
| 238 | return nil |
| 239 | } |
| 240 | for toolName, toolValue := range tools { |
| 241 | if toolName == "serena" { |
| 242 | return errors.New("tools.serena is removed") |
| 243 | } |
| 244 | if toolName == "github" || toolName == "playwright" { |
| 245 | config, err := processBuiltinMCPTool(toolName, toolValue, serverFilter) |
| 246 | if err != nil { |
| 247 | return err |
| 248 | } |
| 249 | if config != nil { |
| 250 | mcpLog.Printf("Added built-in MCP tool: %s", toolName) |
| 251 | *configs = append(*configs, *config) |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | return nil |
| 256 | } |
| 257 | |
| 258 | // processBuiltinMCPTool handles built-in MCP tools (github and playwright) |
| 259 | func processBuiltinMCPTool(toolName string, toolValue any, serverFilter string) (*RegistryMCPServerConfig, error) { |
no test coverage detected