{"record":{"id":"48b474b5b2f599f5","repo":"iflytek/astron-agent","slug":"system-error-mcp-publishing-not-implemented","errorCode":"SYSTEM_ERROR","errorMessage":"MCP publishing not implemented","messagePattern":"MCP publishing not implemented","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/strategy/publish/impl/McpPublishStrategy.java","lineNumber":24,"sourceCode":"import com.iflytek.astron.console.commons.response.ApiResult;\nimport com.iflytek.astron.console.hub.strategy.publish.PublishStrategy;\nimport lombok.RequiredArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.stereotype.Component;\n\n/**\n * MCP publish strategy implementation Handles bot publishing to MCP server channel\n */\n@Slf4j\n@Component\n@RequiredArgsConstructor\npublic class McpPublishStrategy implements PublishStrategy {\n\n    @Override\n    public ApiResult<Object> publish(Integer botId, Object publishData, String currentUid, Long spaceId) {\n        log.info(\"MCP publishing request: botId={}\", botId);\n        // TODO: Implement MCP publishing logic\n        throw new BusinessException(ResponseEnum.SYSTEM_ERROR, \"MCP publishing not implemented\");\n    }\n\n    @Override\n    public ApiResult<Object> offline(Integer botId, Object publishData, String currentUid, Long spaceId) {\n        log.info(\"MCP offline request: botId={}\", botId);\n        // TODO: Implement MCP offline logic\n        throw new BusinessException(ResponseEnum.SYSTEM_ERROR, \"MCP offline not implemented\");\n    }\n\n    @Override\n    public String getPublishType() {\n        return ReleaseTypeEnum.MCP.name();\n    }\n}\n","sourceCodeStart":6,"sourceCodeEnd":39,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/strategy/publish/impl/McpPublishStrategy.java#L6-L39","documentation":"McpPublishStrategy.publish() is an unimplemented stub: it logs the request and unconditionally throws BusinessException(SYSTEM_ERROR, \"MCP publishing not implemented\"). The MCP release type exists in the enum/strategy registry but has no publish logic yet, so every publish attempt through this strategy fails.","triggerScenarios":"Selecting MCP as the release/publish type for a bot and calling the publish API — the strategy router dispatches to McpPublishStrategy.publish, which always throws.","commonSituations":"Frontend or API client exposing the MCP option before backend support landed; integration tests or scripts iterating over all ReleaseType values; users enabled onto an incomplete feature flag.","solutions":["Do not use the MCP publish type until the backend implements it — choose a supported release type instead","Hide/disable the MCP option in the client UI or gate it behind a feature flag","Implement McpPublishStrategy.publish() if MCP publishing is required","Confirm the deployed backend version actually contains MCP support; upgrade if a newer release implements it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (\"MCP\".equals(releaseType)) {\n    throw new UnsupportedOperationException(\"MCP publishing is not implemented; choose another release type\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    publishStrategy.publish(botId, data, uid, spaceId);\n} catch (BusinessException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"not implemented\")) {\n        // surface 'feature unavailable' to user or fall back to a supported publish type\n    } else throw e;\n}","preventionTips":["Hide MCP as a release option until backend support ships","Feature-flag incomplete publish strategies","Keep the strategy registry and UI options in sync"],"tags":["not-implemented","mcp","publishing"],"backgroundTag":"method-not-implemented","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}