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

  1. Create/copy cmd/mcp/config.yaml (or server/config.yaml) under the resolved server root
  2. If you renamed the config (e.g. config.yml), rename it back to config.yaml or place it at a candidate path
  3. Ensure deployment packages include yaml config files alongside binaries
  4. 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

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


AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31). Data as JSON: /api/errors/fa575eeef028144e. Report an issue: GitHub.