codeant-ai-for-open-source[bot] commented on PR #38559:
URL: https://github.com/apache/superset/pull/38559#issuecomment-4031657892
## **Sequence Diagram**
This diagram shows how MCP messages pass through the logging middleware,
which now safely skips event logging when no Flask app context is available so
the initialize handshake still succeeds.
```mermaid
sequenceDiagram
participant Client
participant MCPServer
participant LoggingMiddleware
participant EventLogger
participant FlaskApp
Client->>MCPServer: Send MCP message
MCPServer->>LoggingMiddleware: on_message with context
LoggingMiddleware->>EventLogger: Log mcp_message
alt Flask app context present
EventLogger->>FlaskApp: Record event
LoggingMiddleware-->>MCPServer: Call next handler
else No app context available
EventLogger--xLoggingMiddleware: RuntimeError raised
LoggingMiddleware->>LoggingMiddleware: Catch error and skip logging
LoggingMiddleware-->>MCPServer: Call next handler
end
MCPServer-->>Client: Return MCP response
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]