{"record":{"id":"96b4bdc419bd320f","repo":"apache/incubator-seata","slug":"mcp-server-properties-not-properly-configured-or-u","errorCode":null,"errorMessage":"MCP server properties not properly configured or unsupported protocol","messagePattern":"MCP server properties not properly configured or unsupported protocol","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"console/src/main/java/org/apache/seata/mcp/core/props/MCPProperties.java","lineNumber":90,"sourceCode":"    @PostConstruct\n    public void init() {\n        String maxQueryDurationStr = env.getProperty(\"seata.mcp.query.max-query-duration\", \"86400000\");\n        try {\n            queryDuration = Long.parseLong(maxQueryDurationStr);\n        } catch (NumberFormatException ex) {\n            queryDuration = TimeUnit.DAYS.toMillis(1);\n        }\n\n        if (mcpServerProperties != null) {\n            McpServerProperties.ServerProtocol protocol = mcpServerProperties.getProtocol();\n            if (protocol == McpServerProperties.ServerProtocol.SSE && mcpServerSseProperties != null) {\n                endpoints.add(mcpServerSseProperties.getSseEndpoint());\n                endpoints.add(mcpServerSseProperties.getSseMessageEndpoint());\n            } else if (protocol == McpServerProperties.ServerProtocol.STREAMABLE\n                    && mcpServerStreamableHttpProperties != null) {\n                endpoints.add(mcpServerStreamableHttpProperties.getMcpEndpoint());\n            } else {\n                throw new IllegalStateException(\n                        \"MCP server properties not properly configured or unsupported protocol\");\n            }\n        } else {\n            logger.warn(\"MCP server properties not properly configured\");\n        }\n    }\n}\n","sourceCodeStart":72,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/console/src/main/java/org/apache/seata/mcp/core/props/MCPProperties.java#L72-L98","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set the protocol explicitly to a supported value: `seata.mcp.server.protocol: sse` or `streamable`","Provide the matching nested properties: for sse set the sseEndpoint/sseMessageEndpoint block; for streamable set mcpEndpoint","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)","Check property prefix spelling so Spring actually binds the nested properties beans"],"exampleFix":"# before\nseata:\n  mcp:\n    server:\n      enabled: true   # protocol missing -> throws\n\n# after\nseata:\n  mcp:\n    server:\n      protocol: sse\n      sse:\n        sse-endpoint: /sse\n        sse-message-endpoint: /mcp/message","handlingStrategy":"validation","validationCode":"if (props.getProtocol() != SSE && props.getProtocol() != STREAMABLE) throw new IllegalStateException(\"protocol must be sse or streamable\");","typeGuard":"boolean isConfigured(McpServerProperties p) { return p != null && (p.getProtocol() == SSE || p.getProtocol() == STREAMABLE); }","tryCatchPattern":null,"preventionTips":["Always set protocol explicitly when enabling the MCP server","Provide the nested sse/streamable endpoint blocks together with protocol","Add a config lint step that validates console MCP keys on deploy"],"tags":["seata","mcp","spring-boot","config"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}