iflytek/astron-agent · error · BusinessException

SYSTEM_ERROR

SYSTEM_ERROR

Error message

MCP publishing not implemented

What it means

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.

Solutions

  1. Do not use the MCP publish type until the backend implements it — choose a supported release type instead
  2. Hide/disable the MCP option in the client UI or gate it behind a feature flag
  3. Implement McpPublishStrategy.publish() if MCP publishing is required
  4. Confirm the deployed backend version actually contains MCP support; upgrade if a newer release implements it
Defensive patterns

Strategy: fallback

Validate before calling

if ("MCP".equals(releaseType)) {
    throw new UnsupportedOperationException("MCP publishing is not implemented; choose another release type");
}

Try / catch

try {
    publishStrategy.publish(botId, data, uid, spaceId);
} catch (BusinessException e) {
    if (e.getMessage() != null && e.getMessage().contains("not implemented")) {
        // surface 'feature unavailable' to user or fall back to a supported publish type
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/48b474b5b2f599f5. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/strategy/publish/impl/McpPublishStrategy.java:24

import com.iflytek.astron.console.commons.response.ApiResult;
import com.iflytek.astron.console.hub.strategy.publish.PublishStrategy;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * MCP publish strategy implementation Handles bot publishing to MCP server channel
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class McpPublishStrategy implements PublishStrategy {

    @Override
    public ApiResult<Object> publish(Integer botId, Object publishData, String currentUid, Long spaceId) {
        log.info("MCP publishing request: botId={}", botId);
        // TODO: Implement MCP publishing logic
        throw new BusinessException(ResponseEnum.SYSTEM_ERROR, "MCP publishing not implemented");
    }

    @Override
    public ApiResult<Object> offline(Integer botId, Object publishData, String currentUid, Long spaceId) {
        log.info("MCP offline request: botId={}", botId);
        // TODO: Implement MCP offline logic
        throw new BusinessException(ResponseEnum.SYSTEM_ERROR, "MCP offline not implemented");
    }

    @Override
    public String getPublishType() {
        return ReleaseTypeEnum.MCP.name();
    }
}

View on GitHub (pinned to 5e758547a8)