Merge pull request #1355 from trheyi/main

Enhance MCP loading functionality by checking for directory existence
This commit is contained in:
Max 2025-11-28 19:54:23 +08:00 committed by GitHub
commit fbfb1271d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -617,8 +617,14 @@ func loadConnector(t *testing.T, cfg config.Config) {
} }
func loadMCP(t *testing.T, cfg config.Config) { func loadMCP(t *testing.T, cfg config.Config) {
// Check if mcps directory exists
exists, err := application.App.Exists("mcps")
if err != nil || !exists {
return
}
exts := []string{"*.mcp.yao", "*.mcp.json", "*.mcp.jsonc"} exts := []string{"*.mcp.yao", "*.mcp.json", "*.mcp.jsonc"}
err := application.App.Walk("mcps", func(root, file string, isdir bool) error { err = application.App.Walk("mcps", func(root, file string, isdir bool) error {
if isdir { if isdir {
return nil return nil
} }