{"record":{"id":"4c5d011b006f76f3","repo":"alibaba/nacos","slug":"not-found","errorCode":"NOT_FOUND","errorMessage":"mcp server `%s` for version `%s` not found","messagePattern":"mcp server `(.+?)` for version `(.+?)` not found","errorType":"exception","errorClass":"NacosApiException","httpStatus":404,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java","lineNumber":203,"sourceCode":"     * @return detail info with {@link McpServerDetailInfo}\n     * @throws NacosException any exception during handling\n     */\n    public McpServerDetailInfo getMcpServerDetail(String namespaceId, String mcpServerId,\n        String mcpServerName,\n        String version) throws NacosException {\n        mcpServerId = resolveMcpServerId(namespaceId, mcpServerName, mcpServerId);\n        \n        McpServerVersionInfo mcpServerVersionInfo =\n            getMcpServerVersionInfo(namespaceId, mcpServerId);\n        if (StringUtils.isEmpty(version)) {\n            version = mcpServerVersionInfo.getLatestPublishedVersion();\n        }\n        \n        ConfigQueryChainRequest request =\n            buildQueryMcpServerRequest(namespaceId, mcpServerId, version);\n        ConfigQueryChainResponse response = configQueryChainService.handle(request);\n        if (McpConfigUtils.isConfigNotFound(response.getStatus())) {\n            throw new NacosApiException(NacosApiException.NOT_FOUND,\n                ErrorCode.MCP_SEVER_VERSION_NOT_FOUND,\n                String.format(\"mcp server `%s` for version `%s` not found\", mcpServerId, version));\n        }\n        \n        McpServerStorageInfo serverSpecification = JacksonUtils.toObj(response.getContent(),\n            McpServerStorageInfo.class);\n        \n        McpServerDetailInfo result = new McpServerDetailInfo();\n        result.setId(mcpServerId);\n        BeanUtils.copyProperties(serverSpecification, result);\n        result.setNamespaceId(namespaceId);\n        \n        List<ServerVersionDetail> versionDetails = mcpServerVersionInfo.getVersionDetails();\n        String latestVersion = mcpServerVersionInfo.getLatestPublishedVersion();\n        for (ServerVersionDetail versionDetail : versionDetails) {\n            versionDetail.setIs_latest(versionDetail.getVersion().equals(latestVersion));\n        }\n        result.setAllVersions(mcpServerVersionInfo.getVersionDetails());","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java#L185-L221","documentation":"Thrown by McpServerOperationService.getMcpServerDetail when the MCP server version exists in the version index but the specific version's detail config is not found (config query returns CONFIG_NOT_FOUND status). Returns NOT_FOUND with MCP_SEVER_VERSION_NOT_FOUND detail, naming the server id and version.","triggerScenarios":"Requesting detail for an MCP server with a version that was never published or whose detail config was deleted/lost, while the version info (McpServerVersionInfo) still exists. Also fires when an explicit version arg resolves to a non-existent config.","commonSituations":"Requesting a draft/unpublished version; the version detail config was removed but the version-list entry remains; passing a version that does not match any published version; data inconsistency after a failed publish.","solutions":["Omit the version parameter to fetch the latestPublishedVersion automatically.","List available versions first (McpServerVersionInfo.versionDetails) and request one that exists.","If the version detail is genuinely missing, republish that version or remove the stale version entry."],"exampleFix":"// before\nservice.getMcpServerDetail(ns, id, name, \"9.9.9\"); // unpublished version -> not found\n\n// after\n// omit version to get latest published detail\nservice.getMcpServerDetail(ns, id, name, null);","handlingStrategy":"validation","validationCode":"McpServerVersionInfo info = service.getMcpServerVersionInfo(ns, id);\nSet<String> versions = info.getVersionDetails().stream().map(ServerVersionDetail::getVersion).collect(Collectors.toSet());\nif (!versions.contains(version)) throw new IllegalArgumentException(\"version not published: \" + version);","typeGuard":"boolean versionExists(McpServerVersionInfo info, String v) {\n    return info.getVersionDetails().stream().anyMatch(d -> Objects.equals(d.getVersion(), v));\n}","tryCatchPattern":"try { service.getMcpServerDetail(ns, id, name, version); }\ncatch (NacosApiException e) { if (e.getDetailErrCode() == ErrorCode.MCP_SEVER_VERSION_NOT_FOUND.getCode()) { service.getMcpServerDetail(ns, id, name, null); } }","preventionTips":["Pass null version to fetch the latest published detail.","List versions first and only request ones that appear in versionDetails."],"tags":["mcp","not-found","version","config-query"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}