alibaba/nacos · error · NacosApiException

10000

10000

Error message

Required parameter 'mcpId' or 'mcpName' type String at lease one is not present

What it means

Thrown by McpForm.validate() when BOTH mcpId and mcpName are empty. The form requires at least one identifier to resolve an MCP server (id is preferred, name is the fallback). namespaceId defaults to the MCP default namespace. Maps to code 10000 (PARAMETER_MISSING), HTTP 400.

Source

Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/mcp/admin/McpForm.java:50

 */
public class McpForm implements NacosForm {
    
    @Serial
    private static final long serialVersionUID = 1314659974972866397L;
    
    private String mcpId;
    
    private String namespaceId;
    
    private String mcpName;
    
    private String version;
    
    @Override
    public void validate() throws NacosApiException {
        fillDefaultValue();
        if (StringUtils.isEmpty(mcpId) && StringUtils.isEmpty(mcpName)) {
            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
                "Required parameter 'mcpId' or 'mcpName' type String at lease one is not present");
        }
    }
    
    protected void fillDefaultValue() {
        if (StringUtils.isEmpty(namespaceId)) {
            namespaceId = AiConstants.Mcp.MCP_DEFAULT_NAMESPACE;
        }
    }
    
    public String getNamespaceId() {
        return namespaceId;
    }
    
    public void setNamespaceId(String namespaceId) {
        this.namespaceId = namespaceId;
    }
    

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Provide at least one of mcpId or mcpName in the request.
  2. Prefer mcpId for unambiguous targeting; fall back to mcpName+namespaceId.
  3. Double-check the exact field names (mcpId / mcpName), not generic name/id.

Example fix

// before
curl -X DELETE 'http://host/v3/admin/ai/mcp'
// after
curl -X DELETE 'http://host/v3/admin/ai/mcp' -d 'mcpName=myMcp&namespaceId=public'
Defensive patterns

Strategy: validation

Validate before calling

if ((mcpId == null || mcpId.isEmpty()) && (mcpName == null || mcpName.isEmpty())) {
    throw new IllegalArgumentException("mcpId or mcpName required");
}

Type guard

static boolean hasMcpIdentifier(String id, String name) {
    return (id != null && !id.isEmpty()) || (name != null && !name.isEmpty());
}

Try / catch

catch (NacosApiException e) {
    if (e.getErrCode() == 10000 && e.getMessage().contains("mcpId")) { /* supply id or name */ }
}

Prevention

When it happens

Trigger: Calling GET /v3/admin/ai/mcp (get server detail) or DELETE /v3/admin/ai/mcp (delete) without either mcpId or mcpName.

Common situations: Client assumes name is enough but sends it under `name` instead of `mcpName`; a deletion script passes an empty id after a failed lookup; refactoring renames the field on the caller side.

Related errors


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