spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Fix: Prevent exceptions when disabling MCP Server

Open YunKuiLu opened this issue 11 months ago • 1 comments

  • Prevent projects depending on mcp-server-webmvc or mcp-server-webflux from exceptions when spring.ai.mcp.server.enabled is set to false.
  • Add unit tests to verify.

When the project depends on the spring-ai-starter-mcp-server-webmvc package but attempts to temporarily disable the MCP server (via spring.ai.mcp.server.enabled=false), the following exception is thrown: image

YunKuiLu avatar Apr 26 '25 08:04 YunKuiLu

Hi @tzolov , as the main author of MCP Server, could you review this PR? Thank you!

YunKuiLu avatar Apr 26 '25 09:04 YunKuiLu

Thanks you for catching and fixing this @YunKuiLu ! Bonus points for the tests ;)

Rebased and merged at c2843f19905b05ab734b20b736f83fc1e06e054d

tzolov avatar May 01 '25 11:05 tzolov