Bug description

We are trying to implement the MCP Server using the spring-ai-starter-mcp-server-webmvc dependency in a Spring Boot application that includes both spring-boot-starter-web and spring-boot-starter-webflux. Our goal is to register tools via @Tool annotations and expose MCP endpoints (e.g., /mcp, /sse) as configured in application.yml.

However, during runtime:

  • There are no logs indicating that tools were registered or capabilities enabled by the MCP server.

  • When we attempt to hit the /mcp or /sse endpoints via Postman or curl, the application returns:

    No static resource found for /mcp
    

    or a 404 Not Found.

It appears the MCP server is not fully initializing or exposing the defined endpoints under this setup.


Environment

Component Value
Spring Boot 3.2.x
Spring AI 1.0.0
MCP Starter spring-ai-starter-mcp-server-webmvc
Java 17
Web dependencies Both spring-boot-starter-web and spring-boot-starter-webflux are on classpath
Lazy Init spring.main.lazy-initialization=true
Model echo
Mode SYNC

Steps to reproduce

  1. Create a Spring Boot app with both starter-web and starter-webflux

  2. Add spring-ai-starter-mcp-server-webmvc as a dependency

  3. Add a @Tool-annotated class and register it via a ToolCallbackProvider bean

  4. Enable MCP server in application.yml with endpoints /mcp and /sse

  5. Run the app

  6. Observe:

    • No tool registration logs

    • No endpoint registration confirmation

  7. Try calling /mcp or /sse via Postman or curl → receive 404


Expected behavior

  • MCP Server logs should indicate that tools were registered and capabilities enabled (e.g., “Registered tools: X”)

  • Endpoints /mcp and /sse (or /completions for SYNC mode) should be exposed and respond correctly

  • /completions should accept standard payloads and return tool responses


Minimal Complete Reproducible example

@Component
@Lazy(false)
public class SampleTool {
    @Tool(name = "sayHello", description = "Greets user")
    public String sayHello(String name) {
        return "Hello, " + name;
    }
}
@Bean
@Lazy(false)
public ToolCallbackProvider toolCallbackProvider(SampleTool tool) {
    return MethodToolCallbackProvider.builder()
        .toolObjects(tool)
        .build();
}
spring:
  main:
    lazy-initialization: true

  ai:
    mcp:
      server:
        enabled: true
        type: SYNC
        model: echo
        sse-endpoint: /sse
        sse-message-endpoint: /mcp
curl -X POST http://localhost:8080/completions \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "call tool sayHello with name MCP" }'

Expected: "Hello MCP"
Actual: 404 Not Found / "No static resource found for /completions"


Comment From: vaibhav-v-verma

Hi @wilocu , What is the timeline for this fix to be available publicly ? Also, how can we use this server when both spring-boot-starter-web and spring-boot-starter-webflux dependency ? Does spring-ai support this ? if not then what are the timelines ?