{"record":{"id":"4a740dd06fa3a835","repo":"alibaba/spring-ai-alibaba","slug":"the-current-mode-does-not-support-studio-s-mcp-nod","errorCode":null,"errorMessage":"The current mode does not support Studio's MCP node code generation. Please start the complete StudioApplication class","messagePattern":"The current mode does not support Studio's MCP node code generation\\. Please start the complete StudioApplication class","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/workflow/sections/MCPNodeSection.java","lineNumber":54,"sourceCode":"\n@Component\npublic class MCPNodeSection implements NodeSection<MCPNodeData> {\n\n\tprivate final McpServerService mcpServerService;\n\n\tpublic MCPNodeSection(@Autowired(required = false) McpServerService mcpServerService) {\n\t\tthis.mcpServerService = mcpServerService;\n\t}\n\n\t@Override\n\tpublic boolean support(NodeType nodeType) {\n\t\treturn NodeType.MCP.equals(nodeType);\n\t}\n\n\t@Override\n\tpublic String render(Node node, String varName) {\n\t\tif (this.mcpServerService == null) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"The current mode does not support Studio's MCP node code generation. Please start the complete StudioApplication class\");\n\t\t}\n\t\tMCPNodeData nodeData = (MCPNodeData) node.getData();\n\n\t\tRequestContext context = RequestContextHolder.getRequestContext();\n\t\tMcpServerEntity mcpServerEntity = mcpServerService.getMcpByCode(context.getWorkspaceId(),\n\t\t\t\tnodeData.getServerCode(), null);\n\t\tif (mcpServerEntity == null) {\n\t\t\tthrow new IllegalArgumentException(\"MCP Server [\" + nodeData.getServerCode() + \"] not found!\");\n\t\t}\n\n\t\tMcpServerDeployConfig deployConfig = JsonUtils.fromJson(mcpServerEntity.getDeployConfig(),\n\t\t\t\tMcpServerDeployConfig.class);\n\t\tString endPoint = deployConfig.getRemoteEndpoint();\n\t\tString baseUri = deployConfig.getRemoteAddress();\n\n\t\treturn String.format(\"\"\"\n\t\t\t\t// -- MCP Node [%s] --","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/workflow/sections/MCPNodeSection.java#L36-L72","documentation":"MCPNodeSection.render requires an injected McpServerService to look up MCP server definitions. In stripped-down runtime modes the service is null, so render throws IllegalArgumentException telling the developer to run the full StudioApplication.","triggerScenarios":"Generating code for a workflow containing an MCP node while Studio runs in a mode where McpServerService was not wired (e.g., not starting StudioApplication).","commonSituations":"Running Studio admin via a partial/test bootstrap or embedded mode that excludes MCP beans; deployment using a slimmed application class without MCP support.","solutions":["Start the application via the complete StudioApplication class so MCP beans are registered","Remove the MCP node from the workflow before generating code in lightweight mode","Provide/wire an McpServerService bean implementation in your custom bootstrap"],"exampleFix":"// before\nSpringApplication.run(SomeLiteApp.class, args);\n// after\nSpringApplication.run(StudioApplication.class, args);","handlingStrategy":"fallback","validationCode":"if (applicationContext.getBeanProvider(McpServerService.class).getIfAvailable() == null) { throw new IllegalStateException(\"MCP support unavailable; start StudioApplication\"); }","typeGuard":"null","tryCatchPattern":"try { section.render(node, varName); } catch (IllegalArgumentException e) { /* fall back: skip MCP nodes or abort generation with guidance */ }","preventionTips":["Always bootstrap Studio via StudioApplication when workflows use MCP nodes","Check MCP bean presence at startup and warn","Strip MCP nodes for lightweight deployments"],"tags":["java","spring-boot","mcp","missing-bean"],"backgroundTag":"missing-dependency","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}