aminghadersohi commented on code in PR #37216:
URL: https://github.com/apache/superset/pull/37216#discussion_r2706522577
##########
superset/mcp_service/server.py:
##########
@@ -55,21 +65,79 @@ def configure_logging(debug: bool = False) -> None:
logging.info("🔍 SQL Debug logging enabled")
+def create_event_store(config: dict[str, Any] | None = None) -> Any | None:
+ """
+ Create an EventStore for MCP session management.
+
+ For multi-pod deployments, uses Redis-backed storage to share session state
+ across pods. For single-pod deployments, returns None (uses in-memory).
+
+ Args:
+ config: Optional config dict. If None, reads from MCP_STORE_CONFIG.
+
+ Returns:
+ EventStore instance if Redis URL is configured, None otherwise.
+ """
+ if config is None:
+ config = MCP_STORE_CONFIG
+
+ redis_url = config.get("CACHE_REDIS_URL")
+ if not redis_url:
+ logging.info("EventStore: Using in-memory storage (single-pod mode)")
+ return None
+
+ try:
+ from fastmcp.server.event_store import EventStore
+
+ # Reuse _create_redis_store with wrap=False for raw RedisStore
+ redis_store = _create_redis_store(config, wrap=False)
Review Comment:
Investigated this - EventStore wraps storage with PydanticAdapter which
already handles key
namespacing (collections like fastmcp_events, fastmcp_streams). Using
wrap=True would
double-prefix keys unnecessarily.
Our PrefixKeysWrapper doesn't provide encryption either - it only prefixes
keys. For encryption,
we rely on Redis TLS (transport) and can enable encryption at rest at the
ElastiCache level.
--
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]