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 4
4
5
5
load_dotenv ()
6
6
7
+ MCP_TRANSPORT = os .getenv ('MCP_TRANSPORT' , 'stdio' )
8
+
7
9
REDIS_CFG = {"host" : os .getenv ('REDIS_HOST' , '127.0.0.1' ),
8
10
"port" : int (os .getenv ('REDIS_PORT' ,6379 )),
9
11
"username" : os .getenv ('REDIS_USERNAME' , None ),
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class RedisConnectionManager:
15
15
def get_connection (cls , decode_responses = True ) -> Redis :
16
16
if cls ._instance is None :
17
17
try :
18
- print ("Initializing Redis connection" , file = sys .stderr )
19
18
cls ._instance = redis .Redis (
20
19
host = REDIS_CFG ["host" ],
21
20
port = REDIS_CFG ["port" ],
Original file line number Diff line number Diff line change
1
+ import sys
2
+
1
3
from common .connection import RedisConnectionManager
2
4
from common .server import mcp
3
5
import tools .server_management
11
13
import tools .set
12
14
import tools .stream
13
15
import tools .pub_sub
16
+ from common .config import MCP_TRANSPORT
14
17
15
18
16
19
class RedisMCPServer :
17
20
def __init__ (self ):
18
- redis_client = RedisConnectionManager . get_connection ( decode_responses = False )
21
+ print ( "Starting the RedisMCPServer" , file = sys . stderr )
19
22
20
23
def run (self ):
21
- mcp .run (transport = 'stdio' )
24
+ mcp .run (transport = MCP_TRANSPORT )
22
25
23
26
if __name__ == "__main__" :
24
27
server = RedisMCPServer ()
You can’t perform that action at this time.
0 commit comments