Class McpRootsListChangedFilter
java.lang.Object
com.xebialabs.xlrelease.mcp.config.McpRootsListChangedFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
Acknowledges and discards
notifications/roots/list_changed before it reaches the MCP servlet.
The SDK's handler for that notification (McpAsyncServer#asyncRootsListChangedNotificationHandler)
calls exchange.listRoots() unconditionally — it substitutes a logging consumer when no roots
consumers are registered, as is the case here, so the round-trip to the client goes out regardless. The
servlet transport handles notifications by blocking the request thread on that result, so a client that
announces roots but never answers the roots/list request pins a worker thread for the full request
timeout and then logs a TimeoutException. Claude Desktop (through mcp-remote) does exactly that.
Nothing in Release consumes roots, so the notification is answered with 202 and dropped here.
-
Constructor Summary
ConstructorsConstructorDescriptionMcpRootsListChangedFilter(tools.jackson.databind.json.JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.Filter
destroy, init
-
Constructor Details
-
McpRootsListChangedFilter
public McpRootsListChangedFilter(tools.jackson.databind.json.JsonMapper jsonMapper)
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-