alibaba/nacos · warning · NacosApiException

PARAMETER_MISSING

PARAMETER_MISSING

Error message

Required parameter 'serverSpecification' type McpServerBasicInfo is not present

What it means

Thrown by ReleaseMcpServerRequestHandler.checkParameters() when request.getServerSpecification() is null. The serverSpecification (McpServerBasicInfo) is the root required payload for releasing/publishing an MCP server. Mapped to PARAMETER_MISSING with an INVALID_PARAM top-level code; caught by handle() and placed into the response error info.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/remote/handler/ReleaseMcpServerRequestHandler.java:96

    @ExtractorManager.Extractor(rpcExtractor = McpServerRequestParamExtractor.class)
    @Secured(action = ActionTypes.WRITE, signType = SignType.AI)
    public ReleaseMcpServerResponse handle(ReleaseMcpServerRequest request, RequestMeta meta)
        throws NacosException {
        McpRequestUtil.fillNamespaceId(request);
        try {
            checkParameters(request);
            return doHandler(request, meta);
        } catch (NacosException e) {
            ReleaseMcpServerResponse response = new ReleaseMcpServerResponse();
            response.setErrorInfo(e.getErrCode(), e.getErrMsg());
            return response;
        }
    }
    
    private void checkParameters(ReleaseMcpServerRequest request) throws NacosException {
        McpServerBasicInfo serverSpecification = request.getServerSpecification();
        if (null == serverSpecification) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'serverSpecification' type McpServerBasicInfo is not present");
        }
        String mcpName = serverSpecification.getName();
        if (StringUtils.isEmpty(mcpName)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'serverSpecification.name' type String is not present");
        }
        if (null == serverSpecification.getVersionDetail() || StringUtils.isBlank(
            serverSpecification.getVersionDetail().getVersion())) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter `serverSpecification.versionDetail.version` not present");
        }
    }
    
    private ReleaseMcpServerResponse doHandler(ReleaseMcpServerRequest request, RequestMeta meta)
        throws NacosException {
        String namespaceId = request.getNamespaceId();
        McpServerBasicInfo serverSpecification = request.getServerSpecification();

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Populate request.setServerSpecification(mcpServerBasicInfo) with a fully-formed McpServerBasicInfo.
  2. Ensure the gRPC message is serialized with the serverSpecification field present (check field numbering/protobuf compatibility).
  3. Validate the request payload non-null client-side before sending.

Example fix

// before
ReleaseMcpServerRequest req = new ReleaseMcpServerRequest();
// serverSpecification never set

// after
McpServerBasicInfo spec = new McpServerBasicInfo();
spec.setName("my-mcp-server");
spec.setVersionDetail(buildVersion("1.0.0"));
req.setServerSpecification(spec);
Defensive patterns

Strategy: validation

Validate before calling

if (request.getServerSpecification() == null) {
    throw new IllegalArgumentException("serverSpecification (McpServerBasicInfo) is required");
}

Type guard

static boolean hasServerSpec(ReleaseMcpServerRequest r) {
    return r != null && r.getServerSpecification() instanceof McpServerBasicInfo;
}

Try / catch

ReleaseMcpServerResponse resp = handler.handle(request, meta);
if (resp.getErrCode() != 0 && resp.getErrMsg().contains("serverSpecification")) {
    // rebuild request with a non-null McpServerBasicInfo and retry
}

Prevention

When it happens

Trigger: A gRPC ReleaseMcpServerRequest with no serverSpecification object at all. The check is the very first validation, before name and version checks.

Common situations: Client constructs ReleaseMcpServerRequest but only sets tool/resource specs, forgetting the server spec; a serialization issue where the field is dropped on the wire; a test that sends an empty request.

Related errors


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/4997c47a19e40c3b. Report an issue: GitHub.