Skip to content

Commit bf152b0

Browse files
committed
fix(server): fix issue with tool discovery
1 parent c74e16f commit bf152b0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/common/server.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
import importlib
2+
import pkgutil
13
from mcp.server.fastmcp import FastMCP
24

5+
def load_tools():
6+
import src.tools as tools_pkg
7+
for _, module_name, _ in pkgutil.iter_modules(tools_pkg.__path__):
8+
importlib.import_module(f"src.tools.{module_name}")
9+
310
# Initialize FastMCP server
411
mcp = FastMCP("Redis MCP Server", dependencies=["redis", "dotenv", "numpy"])
12+
13+
# Load tools
14+
load_tools()

0 commit comments

Comments
 (0)