flipped-aurora/gin-vue-admin · error
未找到 MCP 配置文件,请确认 cmd/mcp/config.yaml 或 server/config.yaml 存在
Error message
未找到 MCP 配置文件,请确认 cmd/mcp/config.yaml 或 server/config.yaml 存在
What it means
resolveMCPConfigPath checks a list of candidate config file locations (cmd/mcp/config.yaml and server/config.yaml among them) and returns the first that exists. It throws this error when none of the candidates can be found, because the standalone MCP service cannot start without its YAML configuration.
Source
Thrown at server/mcp/standalone_manager.go:396
return candidates[0]
}
return ""
}
func resolveMCPConfigPath(serverRoot string) (string, error) {
candidates := []string{
filepath.Join(serverRoot, "cmd", "mcp", "config.yaml"),
filepath.Join(serverRoot, "config.yaml"),
}
for _, candidate := range candidates {
if fileExists(candidate) {
return candidate, nil
}
}
return "", errors.New("未找到 MCP 配置文件,请确认 cmd/mcp/config.yaml 或 server/config.yaml 存在")
}
func ensureMCPRuntimeDir() (string, error) {
runtimeDir := filepath.Join(resolveMCPProjectRoot(), mcpRuntimeDirName, mcpRuntimeSubDir)
if err := os.MkdirAll(runtimeDir, 0o755); err != nil {
return "", err
}
return runtimeDir, nil
}
func resolveMCPProjectRoot() string {
root := strings.TrimSpace(global.GVA_CONFIG.AutoCode.Root)
if root != "" {
return root
}
serverRoot := resolveMCPServerRoot()
if serverRoot == "" {View on GitHub (pinned to 3136500ef3)
Solutions
- Create/copy cmd/mcp/config.yaml (or server/config.yaml) under the resolved server root
- If you renamed the config (e.g. config.yml), rename it back to config.yaml or place it at a candidate path
- Ensure deployment packages include yaml config files alongside binaries
- Verify the server root that was resolved (fix autocode.root/server if it points at the wrong directory)
Example fix
# before: config missing cp cmd/mcp/config.example.yaml cmd/mcp/config.yaml # restore expected candidate # verify ls cmd/mcp/config.yaml server/config.yaml
Defensive patterns
Strategy: validation
Validate before calling
for _, p := range []string{"cmd/mcp/config.yaml", "config.yaml"} {
if _, err := os.Stat(filepath.Join(serverRoot, p)); err == nil {
return nil // config present
}
}
return errors.New("place cmd/mcp/config.yaml (or server/config.yaml) under the server root first") Try / catch
if _, err := resolveMCPConfigPath(serverRoot); err != nil {
log.Fatalf("MCP config missing: %v — copy config.example.yaml to config.yaml", err)
} Prevention
- Always ship yaml config files in deploy artifacts (don't exclude *.yaml)
- Create cmd/mcp/config.yaml from the example template during provisioning
- Don't rename config.yaml to config.yml; the resolver looks for exact candidate names
When it happens
Trigger: StartManagedStandalone on a deployment where the server root exists but neither cmd/mcp/config.yaml nor server/config.yaml (nor other candidates) are present — e.g. config renamed, moved, or excluded from the build/deploy artifact.
Common situations: Docker images or CI artifacts that strip yaml files; config renamed to config.yml or config.example.yaml never copied to config.yaml; deploying only the compiled binary without the source tree; wrong server root resolution pointing to a directory without config.
Related errors
- 未找到 server 根目录,无法启动 MCP 独立服务
- GVA_MCP_BIN 指向的文件不存在: %s
- 未找到 MCP 独立配置文件,请在当前目录、cmd/mcp 目录或通过 -config / GVA_MCP_CONFIG
- 未能自动识别项目根目录,请在 MCP 配置中设置 autocode.root
- go.mod 中未找到 module 定义
AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31).
Data as JSON: /api/errors/fa575eeef028144e.
Report an issue: GitHub.