Environment

Spring Boot Version:

3.5.3

Dependency:

<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
<version>1.0.0</version>
</dependency>

Configuration

spring.ai.mcp.server.type=sync
spring.ai.mcp.server.name=mcp-server-aigc-tools
spring.ai.mcp.server.version=1.0.0

With this configuration, I can successfully connect to the MCP service using a third-party MCP tool at:

http://localhost:9000/sse

Problem

When I add the following configuration:

server.servlet.context-path=/hsrcm/hsrcm-aigc-tool/v

I expect the MCP endpoint to be:

http://localhost:9000/hsrcm/hsrcm-aigc-tool/v/sse

However, I cannot connect to this URL no matter what I try.

The third-party tools I am using are Trae and CherryStudio, and neither of them can connect successfully.

Expected Behavior

The MCP service should be accessible at the new path with the configured context:

http://localhost:9000/hsrcm/hsrcm-aigc-tool/v/sse

Actual Behavior

Connection fails when using the new path.

Question

Could you please provide the correct way to configure MCP with a custom server.servlet.context-path?