apache/incubator-seata · error · IllegalStateException

MCP server properties not properly configured or unsupported

Error message

MCP server properties not properly configured or unsupported protocol

What it means

MCPProperties.afterPropertiesSet throws IllegalStateException when mcpServerProperties is present but its protocol is neither SSE (with SSE properties) nor STREAMABLE (with streamable-HTTP properties) — or the matching properties bean is null. This is startup-time validation of the console's MCP (Model Context Protocol) server endpoint wiring in spring-context.properties-based setup.

Source

Thrown at console/src/main/java/org/apache/seata/mcp/core/props/MCPProperties.java:90

    @PostConstruct
    public void init() {
        String maxQueryDurationStr = env.getProperty("seata.mcp.query.max-query-duration", "86400000");
        try {
            queryDuration = Long.parseLong(maxQueryDurationStr);
        } catch (NumberFormatException ex) {
            queryDuration = TimeUnit.DAYS.toMillis(1);
        }

        if (mcpServerProperties != null) {
            McpServerProperties.ServerProtocol protocol = mcpServerProperties.getProtocol();
            if (protocol == McpServerProperties.ServerProtocol.SSE && mcpServerSseProperties != null) {
                endpoints.add(mcpServerSseProperties.getSseEndpoint());
                endpoints.add(mcpServerSseProperties.getSseMessageEndpoint());
            } else if (protocol == McpServerProperties.ServerProtocol.STREAMABLE
                    && mcpServerStreamableHttpProperties != null) {
                endpoints.add(mcpServerStreamableHttpProperties.getMcpEndpoint());
            } else {
                throw new IllegalStateException(
                        "MCP server properties not properly configured or unsupported protocol");
            }
        } else {
            logger.warn("MCP server properties not properly configured");
        }
    }
}

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Set the protocol explicitly to a supported value: `seata.mcp.server.protocol: sse` or `streamable`
  2. Provide the matching nested properties: for sse set the sseEndpoint/sseMessageEndpoint block; for streamable set mcpEndpoint
  3. If you did not intend to run the MCP server, remove/comment the mcp server properties so the bean stays null (the else branch only warns)
  4. Check property prefix spelling so Spring actually binds the nested properties beans

Example fix

# before
seata:
  mcp:
    server:
      enabled: true   # protocol missing -> throws

# after
seata:
  mcp:
    server:
      protocol: sse
      sse:
        sse-endpoint: /sse
        sse-message-endpoint: /mcp/message
Defensive patterns

Strategy: validation

Validate before calling

if (props.getProtocol() != SSE && props.getProtocol() != STREAMABLE) throw new IllegalStateException("protocol must be sse or streamable");

Type guard

boolean isConfigured(McpServerProperties p) { return p != null && (p.getProtocol() == SSE || p.getProtocol() == STREAMABLE); }

Prevention

When it happens

Trigger: Setting seata.console.mcp.server properties (so mcpServerProperties bean exists) but leaving protocol unset/invalid, or specifying protocol: sse without mcpServerSseProperties, or protocol: streamable without mcpServerStreamableHttpProperties. Fires during Spring initialization of the console module.

Common situations: Enabling the seata MCP server via config copied from an older version where the protocol key did not exist; setting protocol to 'http' or 'STDIO'; defining server props but forgetting the nested sse/streamable endpoint blocks.

Related errors


AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14). Data as JSON: /api/errors/96b4bdc419bd320f. Report an issue: GitHub.