File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 44
55load_dotenv ()
66
7+ MCP_TRANSPORT = os .getenv ('MCP_TRANSPORT' , 'stdio' )
8+
79REDIS_CFG = {"host" : os .getenv ('REDIS_HOST' , '127.0.0.1' ),
810 "port" : int (os .getenv ('REDIS_PORT' ,6379 )),
911 "username" : os .getenv ('REDIS_USERNAME' , None ),
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class RedisConnectionManager:
1515 def get_connection (cls , decode_responses = True ) -> Redis :
1616 if cls ._instance is None :
1717 try :
18- print ("Initializing Redis connection" , file = sys .stderr )
1918 cls ._instance = redis .Redis (
2019 host = REDIS_CFG ["host" ],
2120 port = REDIS_CFG ["port" ],
Original file line number Diff line number Diff line change 1+ import sys
2+
13from common .connection import RedisConnectionManager
24from common .server import mcp
35import tools .server_management
1113import tools .set
1214import tools .stream
1315import tools .pub_sub
16+ from common .config import MCP_TRANSPORT
1417
1518
1619class RedisMCPServer :
1720 def __init__ (self ):
18- redis_client = RedisConnectionManager . get_connection ( decode_responses = False )
21+ print ( "Starting the RedisMCPServer" , file = sys . stderr )
1922
2023 def run (self ):
21- mcp .run (transport = 'stdio' )
24+ mcp .run (transport = MCP_TRANSPORT )
2225
2326if __name__ == "__main__" :
2427 server = RedisMCPServer ()
You can’t perform that action at this time.
0 commit comments