alibaba/nacos · error · NacosException

400

400

Error message

Mcp server specification cannot be null.

What it means

Error "Mcp server specification cannot be null." thrown in alibaba/nacos.

Source

Thrown at maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerService.java:277

        return createLocalMcpServer(mcpName, serverSpec, toolSpec);
    }
    
    /**
     * Create new local mcp server to Nacos.
     *
     * @param mcpName    mcp server name of the new mcp server
     * @param serverSpec mcp server specification, see {@link McpServerBasicInfo} which `type` is
     *                   {@link AiConstants.Mcp#MCP_PROTOCOL_STDIO}.
     * @param toolSpec   mcp server tools specification, see {@link McpToolSpecification}, nullable.
     * @return mcp server id of the new mcp server
     * @throws NacosException if fail to create mcp server.
     */
    @Since("3.0.0")
    default String createLocalMcpServer(String mcpName, McpServerBasicInfo serverSpec,
        McpToolSpecification toolSpec)
        throws NacosException {
        if (Objects.isNull(serverSpec)) {
            throw new NacosException(NacosException.INVALID_PARAM,
                "Mcp server specification cannot be null.");
        }
        if (!AiConstants.Mcp.MCP_PROTOCOL_STDIO.equalsIgnoreCase(serverSpec.getProtocol())) {
            throw new NacosException(NacosException.INVALID_PARAM,
                String.format("Mcp server type must be `local`, input is `%s`",
                    serverSpec.getProtocol()));
        }
        return createMcpServer(mcpName, serverSpec, toolSpec, null);
    }
    
    /**
     * Create new remote mcp server to Nacos.
     *
     * @param mcpName      mcp server name of the new mcp server
     * @param version      version of the new mcp server
     * @param protocol     mcp protocol type not {@link AiConstants.Mcp#MCP_PROTOCOL_STDIO}.
     * @param endpointSpec mcp server endpoint specification, see {@link McpEndpointSpec}, can't be null.
     * @return mcp server id of the new mcp server

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Provide a non-null value for mcp server specification null before invoking this operation.

When it happens

Trigger: Thrown at maintainer-client/src/main/java/com/alibaba/nacos/maintainer/client/ai/McpMaintainerService.java:277 when the library encounters an invalid state.

Common situations: Calling the MCP maintainer API with a null server specification.


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