{"record":{"id":"89f8fa4066954dd6","repo":"sipeed/picoclaw","slug":"mcp-integration-is-disabled","errorCode":null,"errorMessage":"MCP integration is disabled","messagePattern":"MCP integration is disabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/agent_command.go","lineNumber":207,"sourceCode":"\t\t\t}\n\n\t\t\tresolvedName := \"\"\n\t\t\tvar serverCfg config.MCPServerConfig\n\t\t\tfor name, candidate := range cfg.Tools.MCP.Servers {\n\t\t\t\tif strings.EqualFold(name, serverName) {\n\t\t\t\t\tresolvedName = name\n\t\t\t\t\tserverCfg = candidate\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif resolvedName == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"MCP server '%s' is not configured\", serverName)\n\t\t\t}\n\t\t\tif !serverCfg.Enabled {\n\t\t\t\treturn nil, fmt.Errorf(\"MCP server '%s' is configured but disabled\", resolvedName)\n\t\t\t}\n\t\t\tif !cfg.Tools.IsToolEnabled(\"mcp\") {\n\t\t\t\treturn nil, fmt.Errorf(\"MCP integration is disabled\")\n\t\t\t}\n\n\t\t\tif err := al.ensureMCPInitialized(ctx); err != nil {\n\t\t\t\tlogger.WarnCF(\"agent\", \"Failed to initialize MCP runtime for command\",\n\t\t\t\t\tmap[string]any{\n\t\t\t\t\t\t\"server\": resolvedName,\n\t\t\t\t\t\t\"error\":  err.Error(),\n\t\t\t\t\t})\n\t\t\t}\n\n\t\t\tmanager := al.mcp.getManager()\n\t\t\tif manager == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"MCP server '%s' is configured but not connected\", resolvedName)\n\t\t\t}\n\n\t\t\tconn, ok := manager.GetServer(resolvedName)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"MCP server '%s' is configured but not connected\", resolvedName)","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/agent_command.go#L189-L225","documentation":"The requested MCP server is configured and enabled, but cfg.Tools.IsToolEnabled(\"mcp\") is false: the MCP integration itself is globally disabled, so no MCP runtime exists and per-server tool listing is refused. This is a top-level kill switch checked after per-server validation.","triggerScenarios":"tools.mcp.enabled (or the equivalent tool gate) set to false in config, or MCP excluded from the enabled tools list; listing tools for any server in that state.","commonSituations":"User disabled MCP to troubleshoot or for air-gapped setups; deployment templates that turn off non-core tools; stale config after an upgrade that renamed the toggle.","solutions":["Enable the MCP tool gate in config (tools.mcp.enabled: true / include mcp in enabled tools) and reload","Search config for where mcp is disabled: grep -n 'mcp' on the active config file","After re-enabling, verify with /mcp list before listing tools"],"exampleFix":"# before\ntools:\n  mcp:\n    enabled: false\n\n# after\ntools:\n  mcp:\n    enabled: true","handlingStrategy":"validation","validationCode":"if !cfg.Tools.IsToolEnabled(\"mcp\") {\n    return fmt.Errorf(\"MCP is globally disabled; set tools.mcp.enabled=true\")\n}","typeGuard":"func mcpEnabled(cfg *config.Config) bool { return cfg.Tools.IsToolEnabled(\"mcp\") }","tryCatchPattern":null,"preventionTips":["Gate MCP-related UI/commands on the global MCP flag","Centralize the IsToolEnabled(\"mcp\") check in one preflight helper","Surface the flag in startup diagnostics"],"tags":["mcp","configuration","feature-flag"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}