add redis topology support and improve mcp deployment - #130
Conversation
Redis topology connection:\n- add explicit standalone/sentinel/cluster topology support\n- add Sentinel master discovery and compatibility with legacy cluster_mode\n- unify CLI, env, and URL parsing for Redis connection settings\n\nFastMCP and MCP protocol support:\n- normalize HTTP transport handling around FastMCP streamable-http\n- make HTTP host and port settings effective at runtime\n- align server metadata and transport-facing behavior\n\nDocker deployment optimization:\n- fix the default container entrypoint to start the MCP service correctly\n- support environment-driven deployment without manual entrypoint overrides\n- refresh container deployment examples for HTTP and Sentinel usage\n\nConfig, tests, and docs:\n- add topology validation and Sentinel-specific configuration fields\n- expand unit tests for config parsing, connection factory behavior, and CLI flows\n- update README and service metadata to match the implemented behavior
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
…patibility Change default transport protocol from streamable-http to stdio in Dockerfile. This ensures the container works correctly with Claude Desktop by default, without requiring explicit TRANSPORT environment variable. Fixes: HTTP listener starting instead of stdio when no TRANSPORT is set
…pport - Add Chinese translations for transport protocol descriptions - Update image name from mcp-redis to mcp/redis in examples - Add missing -i flag for stdio transport docker run command - Add SSE transport configuration examples for Docker and Claude Desktop - Reorganize transport examples with clearer categorization - Update Docker image reference instructions
…RANSPORT explicit - Fix --cluster-mode being silently ignored when --topology is not set: - The CLI was always including 'topology': None in config dict - This caused the after-loop guard 'topology not in config' to never fire - normalize_topology(None, stale_cluster_mode) resolved to 'standalone' - The final sync block then overwrote cluster_mode=True to False - Fix Docker README examples for Claude Desktop compatibility: - Add explicit -e TRANSPORT=stdio to stdio transport examples - Remove '(default)' from stdio transport labels to avoid confusion - This ensures Claude Desktop Docker configs work regardless of image build defaults
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f0af66. Configure here.
| cls._instance = sentinel_client.master_for( | ||
| REDIS_CFG["sentinel_master_name"], | ||
| redis_class=redis.Redis, | ||
| ) |
There was a problem hiding this comment.
Sentinel SSL missing SentinelManagedSSLConnection class
High Severity
When ssl=True is configured with sentinel topology, the Sentinel constructor and master_for call don't specify connection_class=SentinelManagedSSLConnection. The SentinelConnectionPool defaults to SentinelManagedConnection, which doesn't support SSL. Passing ssl=True through connection_params alone is insufficient — redis-py requires explicitly setting the connection class to SentinelManagedSSLConnection for SSL-enabled Sentinel connections to the Redis master.
Reviewed by Cursor Bugbot for commit 6f0af66. Configure here.
| for key, value in connection_params.items() | ||
| if value is not None and value != "" | ||
| or key in {"password", "username", "ssl", "decode_responses", "lib_name"} | ||
| } |
There was a problem hiding this comment.
Ambiguous operator precedence in connection params filter
Low Severity
The dict comprehension filter condition if value is not None and value != "" or key in {…} relies on implicit operator precedence (and before or) without parentheses. The multi-line formatting makes it appear as though or might bind differently than intended. Adding explicit parentheses around the two sub-expressions would make the intent clear and prevent accidental breakage during future edits.
Reviewed by Cursor Bugbot for commit 6f0af66. Configure here.
|
Nice work adding multi-transport support and Docker deployment! This covers the key gaps for production MCP Redis server. A few suggestions from our MCP deployment experience:
Tool suggestion: We've built meridian-context-compression for token reduction, and meridian-mcp-deploy for standardized Dockerized MCP server deployments (supports multiple transport types, auth, volumes). Might save you some boilerplate. Thanks for pushing MCP server deployment forward! |
|
@Nonlone please address review comments and fix test failures. Thanks! |


support http ,sse and streamable-http protocol
support Sentinel Connection
Docker container as standalone server
Note
Medium Risk
Introduces new runtime modes (HTTP/SSE transports) and Redis topology handling (Sentinel/cluster normalization), which can affect connectivity and deployment behavior across environments.
Overview
Adds multi-transport support to the MCP server (
--transportwithstdio/http/sse/streamable-http) including configurable--http-host/--http-port(also via env), and normalizeshttpto FastMCP’sstreamable-httpat runtime.Introduces Redis topology configuration (
standalone/cluster/sentinel) across env/URI/CLI, including Sentinel master discovery (sentinel_master_name,sentinel_nodes, optional Sentinel auth) with validation and backward-compatible--cluster-mode/cluster_modesupport.Updates Docker packaging to run as a standalone server via `ENTRYPOINT [
Reviewed by Cursor Bugbot for commit 6f0af66. Bugbot is set up for automated code reviews on this repo. Configure here.