Skip to content

Commit 7bbe1bb

Browse files
committed
refactor: Move mcp_server to a new class
1 parent 544358b commit 7bbe1bb

File tree

2 files changed

+260
-285
lines changed

2 files changed

+260
-285
lines changed

main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from utils.app_config import get_app_config
1313

1414
# Register all tools so they attach to the MCP server
15-
from utils.mcp_server import run_stdio, run_http
15+
from utils.mcp_server import SysdigMCPServer
1616

1717
# Load environment variables from .env
1818
load_dotenv()
@@ -49,12 +49,15 @@ def main():
4949
▄▌▙▌▄▌▙▌▌▙▌ ▌▝ ▌▙▖▌ ▄▌▙▖▌ ▚▘▙▖▌
5050
▄▌ ▄▌
5151
""")
52+
53+
mcp_server = SysdigMCPServer(app_config=app_config)
54+
5255
if transport == "stdio":
5356
# Run MCP server over STDIO (local)
54-
run_stdio()
57+
mcp_server.run_stdio()
5558
else:
5659
# Run MCP server over streamable HTTP by default
57-
run_http()
60+
mcp_server.run_http()
5861

5962

6063
if __name__ == "__main__":

0 commit comments

Comments
 (0)