Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to the MCP server's transport management for HTTP requests and adds new API endpoints and tooling for analyzing problematic SQL queries. The main focus is on making the server more robust by handling transport errors gracefully, and on providing richer diagnostics for SQL queries, including detection of duplicates and queries with EXPLAIN nodes.
Transport management improvements:
StreamableHTTPServerTransportonly when needed (i.e., when the previous transport is invalid or missing), improving error recovery and stability for both SSE and POST endpoints. The transport is now reset on error, and the server is properly closed and reconnected as required. [1] [2] [3] [4]stopmethod to asynchronously close the transport and reset its state, ensuring clean shutdowns.SQL query diagnostics and API enhancements:
/api/mcp/problematic-queriesthat returns SQL queries considered problematic (either duplicates or those with EXPLAIN nodes), including detailed metadata and support for limiting the number of returned entries./api/mcp/queries-fullfor retrieving the full set of stored queries with optional limiting.get_problematic_queriesin the MCP server, allowing clients to programmatically fetch problematic SQL queries via the new endpoint.