{"record":{"id":"0b5f4366e0756a48","repo":"alibaba/nacos","slug":"400-0b5f43","errorCode":"400","errorMessage":"Mcp server specification cannot be null.","messagePattern":"Mcp server specification cannot be null\\.","errorType":"exception","errorClass":"NacosException","httpStatus":null,"severity":"error","filePath":"maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerService.java","lineNumber":277,"sourceCode":"        return createLocalMcpServer(mcpName, serverSpec, toolSpec);\n    }\n    \n    /**\n     * Create new local mcp server to Nacos.\n     *\n     * @param mcpName    mcp server name of the new mcp server\n     * @param serverSpec mcp server specification, see {@link McpServerBasicInfo} which `type` is\n     *                   {@link AiConstants.Mcp#MCP_PROTOCOL_STDIO}.\n     * @param toolSpec   mcp server tools specification, see {@link McpToolSpecification}, nullable.\n     * @return mcp server id of the new mcp server\n     * @throws NacosException if fail to create mcp server.\n     */\n    @Since(\"3.0.0\")\n    default String createLocalMcpServer(String mcpName, McpServerBasicInfo serverSpec,\n        McpToolSpecification toolSpec)\n        throws NacosException {\n        if (Objects.isNull(serverSpec)) {\n            throw new NacosException(NacosException.INVALID_PARAM,\n                \"Mcp server specification cannot be null.\");\n        }\n        if (!AiConstants.Mcp.MCP_PROTOCOL_STDIO.equalsIgnoreCase(serverSpec.getProtocol())) {\n            throw new NacosException(NacosException.INVALID_PARAM,\n                String.format(\"Mcp server type must be `local`, input is `%s`\",\n                    serverSpec.getProtocol()));\n        }\n        return createMcpServer(mcpName, serverSpec, toolSpec, null);\n    }\n    \n    /**\n     * Create new remote mcp server to Nacos.\n     *\n     * @param mcpName      mcp server name of the new mcp server\n     * @param version      version of the new mcp server\n     * @param protocol     mcp protocol type not {@link AiConstants.Mcp#MCP_PROTOCOL_STDIO}.\n     * @param endpointSpec mcp server endpoint specification, see {@link McpEndpointSpec}, can't be null.\n     * @return mcp server id of the new mcp server","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerService.java#L259-L295","documentation":"Error \"Mcp server specification cannot be null.\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerService.java:277 when the library encounters an invalid state.","commonSituations":"Calling the MCP maintainer API with a null server specification.","solutions":["Provide a non-null value for mcp server specification null before invoking this operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}