-
Notifications
You must be signed in to change notification settings - Fork 308
feat(mcp): refactor logging to use exchange for targeted client notifications #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't gone through all the tests yet as I have some concerns regarding the design and public API changes, let's address these first.
...ing/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java
Outdated
Show resolved
Hide resolved
...ing/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java
Outdated
Show resolved
Hide resolved
...ing/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java
Show resolved
Hide resolved
...ing/mcp-spring-webflux/src/test/java/io/modelcontextprotocol/WebFluxSseIntegrationTests.java
Outdated
Show resolved
Hide resolved
mcp-test/src/main/java/io/modelcontextprotocol/client/AbstractMcpAsyncClientTests.java
Outdated
Show resolved
Hide resolved
mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServerExchange.java
Outdated
Show resolved
Hide resolved
mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServerExchange.java
Outdated
Show resolved
Hide resolved
mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java
Outdated
Show resolved
Hide resolved
mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java
Outdated
Show resolved
Hide resolved
@@ -44,7 +45,7 @@ | |||
|
|||
public class HttpServletSseServerTransportProviderIntegrationTests { | |||
|
|||
private static final int PORT = 8185; | |||
private static final int PORT = 8189; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change? Perhaps we need a simple utility to allocate a random port instead of relying on a constant? https://stackoverflow.com/questions/2675362/how-to-find-an-available-port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Spring Boot used to have such utility but discarded it for some reason.
Lets handle this in a dedicated issue/pr
…ications Refactors the MCP logging system to use the exchange mechanism for sending logging notifications only to specific client sessions rather than broadcasting to all clients. - Move logging notification delivery from server-wide broadcast to per-session exchange - Implement per-session minimum logging level tracking and filtering - Change setLoggingLevel from notification to request/response pattern - Deprecate global server.loggingNotification in favor of exchange.loggingNotification - Add integration test demonstrating filtered logging notifications Resolves #131 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Implement AutoCloseable interface for McpAsyncClient, McpAsyncServer, and McpSyncServer - Refactor test methods to use try-with-resources for automatic resource cleanup - Add missing Javadoc for McpSyncServerExchange.setMinLoggingLevel - Change visibility of McpAsyncServerExchange.setMinLoggingLevel to package-private Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
…syncServerExchange Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
…ications (#132) Refactors the MCP logging system to use the exchange mechanism for sending logging notifications only to specific client sessions rather than broadcasting to all clients. - Move logging notification delivery from server-wide broadcast to per-session exchange - Implement per-session minimum logging level tracking and filtering - Add proper logging level filtering at the exchange level - Change setLoggingLevel from notification to request/response pattern (breaking change) - Deprecate global server.loggingNotification in favor of exchange.loggingNotification - Add SetLevelRequest record to McpSchema - Add integration test demonstrating filtered logging notifications Resolves #131 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com> Co-authored-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
rebased, squashed and merged at c88ac93 |
Refactors the MCP logging system to use the exchange mechanism for sending logging notifications only to specific client sessions rather than broadcasting to all clients.
Resolves #131